Unverified Commit 5c1ec2d8 authored by Sébastien Villemot's avatar Sébastien Villemot
Browse files

Merge remote-tracking branch 'origin/covariance'

parents 30656597 3cbbbecc
......@@ -50,6 +50,8 @@ function calib_smoother!(context, field)
Valpha = zeros(ns, ns, nobs)
Vepsilon = zeros(ny, ny, nobs)
Veta = zeros(np, np, nobs)
start = 1
last = nobs
presample = 0
data_pattern = Vector{Vector{Int64}}(undef, 0)
for i = 1:nobs
......@@ -57,8 +59,6 @@ function calib_smoother!(context, field)
end
if count(results.stationary_variables) == model.endogenous_nbr
kws = KalmanSmootherWs{Float64, Int64}(ny, ns, model.exogenous_nbr, nobs)
start = 1
last = nobs
kalman_smoother!(Y, c, Z, H, d, T, R, Q, a0, att, P, Ptt, alphah, epsilonh, etah,
Valpha, Vepsilon, Veta, start, last, presample,
kws, data_pattern)
......@@ -83,8 +83,6 @@ function calib_smoother!(context, field)
end
Pinftt = zeros(ns, ns, nobs + 1)
kws = DiffuseKalmanSmootherWs{Float64, Int64}(ny, ns, model.exogenous_nbr, nobs)
start = 1
last = nobs
diffuse_kalman_smoother!(Y, c, tZ, H, td, T, tR, Q, a0, att,
Pinf, Pinftt, P, Ptt, alphah,
epsilonh, etah, Valpha, Vepsilon,
......
......@@ -129,7 +129,10 @@ function compute_variance!(context)
fill!(stationary_variables, true)
state_stationary_variables = view(stationary_variables, m.i_bkwrd_b)
nonstate_stationary_variables = view(stationary_variables, m.i_non_states)
if any(ws.nonstationary_variables)
if ws.stationary_model
state_stationary_nbr = m.n_states
nonstate_stationary_nbr = m.endogenous_nbr - m.n_states
else
fill!(Σy, NaN)
state_stationary_variables .= .!ws.nonstationary_variables
state_stationary_nbr = count(state_stationary_variables)
......@@ -143,9 +146,6 @@ function compute_variance!(context)
end
end
nonstate_stationary_nbr = count(nonstate_stationary_variables)
else
state_stationary_nbr = m.n_states
nonstate_stationary_nbr = m.endogenous_nbr - m.n_states
end
# state / state
stationary_nbr = state_stationary_nbr + nonstate_stationary_nbr
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment