From 5f28e4f58f4644b6f01efd649af5207f9ba4d592 Mon Sep 17 00:00:00 2001 From: Quint Wiersma Date: Wed, 7 Aug 2024 15:28:21 +0200 Subject: [PATCH] Change initial values spatial dependence --- src/fit/utilities.jl | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/fit/utilities.jl b/src/fit/utilities.jl index e3a5ebc..8b78116 100644 --- a/src/fit/utilities.jl +++ b/src/fit/utilities.jl @@ -178,12 +178,14 @@ function init!(ε::SpatialAutoregression, method::Symbol) if method == :data # estimate spatial filter if length(spatial(ε)) == 1 - ρ = dot(weights(ε) * resid(ε), resid(ε)) / sum(abs2, weights(ε) * resid(ε)) - spatial(ε) .= max(-0.99 * ε.ρ_max, min(0.99 * ε.ρ_max, ρ)) + # ρ = dot(weights(ε) * resid(ε), resid(ε)) / sum(abs2, weights(ε) * resid(ε)) + # spatial(ε) .= max(-0.99 * ε.ρ_max, min(0.99 * ε.ρ_max, ρ)) + spatial(ε) .= 0.0 else for i ∈ eachindex(spatial(ε)) - ρi = dot(weights(ε)[i,:]' * resid(ε), resid(ε)[i,:]) / sum(abs2, weights(ε)[i,:]' * resid(ε)) - spatial(ε)[i] = max(-0.99 * ε.ρ_max, min(0.99 * ε.ρ_max, ρi)) + # ρi = dot(weights(ε)[i,:]' * resid(ε), resid(ε)[i,:]) / sum(abs2, weights(ε)[i,:]' * resid(ε)) + # spatial(ε)[i] = max(-0.99 * ε.ρ_max, min(0.99 * ε.ρ_max, ρi)) + spatial(ε)[i] = 0.0 end end