Commit a49fde27 authored by Michel Juillard's avatar Michel Juillard
Browse files

adding ystar, Zstar, Hstar in some workspaces

parent ff3f5922
......@@ -52,6 +52,7 @@ struct KalmanLikelihoodWs{T, U} <: KalmanWs{T, U}
cholHset::Bool
ystar::Vector{T}
Zstar::Matrix{T}
Hstar::Matrix{T}
tmp_ns::Vector{T}
PZi::Vector{T}
kalman_tol::T
......@@ -78,13 +79,14 @@ struct KalmanLikelihoodWs{T, U} <: KalmanWs{T, U}
cholHset = false
ystar = Vector{T}(undef, ny)
Zstar = Matrix{T}(undef, ny, ns)
Hstar = Matrix{T}(undef, ny, ny)
tmp_ns = Vector{T}(undef, ns)
PZi = Vector{T}(undef, ns)
kalman_tol = 1e-12
new(csmall, Zsmall, iZsmall, RQ, QQ, v, F, cholF, cholH, LTcholH,
iFv, a1, K, ZP, iFZ, PTmp, oldP, lik, cholHset, ystar,
Zstar, tmp_ns, PZi, kalman_tol)
Zstar, Hstar, tmp_ns, PZi, kalman_tol)
end
end
......@@ -394,6 +396,9 @@ struct FastKalmanLikelihoodWs{T, U} <: KalmanWs{T, U}
TW::Matrix{T}
iFZW::Matrix{T}
KtiFZW::Matrix{T}
ystar::Vector{T}
Zstar::Matrix{T}
Hstar::Matrix{T}
lik::Vector{T}
kalman_tol::T
......@@ -419,9 +424,13 @@ struct FastKalmanLikelihoodWs{T, U} <: KalmanWs{T, U}
TW = Matrix{T}(undef, ns, ny)
iFZW = Matrix{T}(undef, ny, ny)
KtiFZW = Matrix{T}(undef, ns, ny)
ystar = Vector{T}(undef, ny}
Zstar = Matrix{T}(undef, ny, ns}
Hstar = Matrix{T}(undef, ny, ny}
lik = Vector{T}(undef, nobs)
kalman_tol = 1e-12
new(csmall, Zsmall, iZsmall, QQ, v, F, cholF, iFv, a1, K, RQ, ZP, M, W, ZW, ZWM, iFZWM, TW, iFZW, KtiFZW, lik, kalman_tol)
new(csmall, Zsmall, iZsmall, QQ, v, F, cholF, iFv, a1, K, RQ, ZP, M, W,
ZW, ZWM, iFZWM, TW, iFZW, KtiFZW, ystar, Ztar, Hstar, lik, kalman_tol)
end
end
......@@ -584,6 +593,9 @@ struct DiffuseKalmanLikelihoodWs{T, U} <: KalmanWs{T, U}
uKinf::Vector{T}
uKstar::Vector{T}
Kinf_Finf::Vector{T}
ystar::Vector{T}
Zstar::Matrix{T}
Hstar::Matrix{T}
lik::Vector{T}
kalman_tol::T
function DiffuseKalmanLikelihoodWs{T, U}(ny::U, ns::U, np::U, nobs::U) where {T <: AbstractFloat, U <: Integer}
......@@ -608,9 +620,14 @@ struct DiffuseKalmanLikelihoodWs{T, U} <: KalmanWs{T, U}
uKinf = Vector{T}(undef, ns)
uKstar = Vector{T}(undef, ns)
Kinf_Finf = Vector{T}(undef, ns)
ystar = Vector{T}(undef, ny}
Zstar = Matrix{T}(undef, ny, ns}
Hstar = Matrix{T}(undef, ny, ny}
lik = zeros(T, nobs)
kalman_tol = 1e-12
new(csmall, Zsmall, iZsmall, QQ, RQ, v, F, iF, iFv, a1, cholF, ZP, Fstar, ZPstar, K, iFZ, Kstar, PTmp, uKinf, uKstar, Kinf_Finf, lik, kalman_tol)
new(csmall, Zsmall, iZsmall, QQ, RQ, v, F, iF, iFv, a1, cholF, ZP, Fstar,
ZPstar, K, iFZ, Kstar, PTmp, uKinf, uKstar, Kinf_Finf, ystar, Zstar, Hstar,
lik, kalman_tol)
end
end
......@@ -970,6 +987,9 @@ struct KalmanSmootherWs{T, U} <: KalmanWs{T, U}
lik::Vector{T}
KT::Matrix{T}
D::Matrix{T}
ystar::Vector{T}
Zstar::Matrix{T}
Hstar::Matrix{T}
tmp_np::Vector{T}
tmp_ns::Vector{T}
tmp_ny::Vector{T}
......@@ -1007,6 +1027,9 @@ struct KalmanSmootherWs{T, U} <: KalmanWs{T, U}
lik = Vector{T}(undef, nobs)
KT = Matrix{T}(undef, ny, ns)
D = Matrix{T}(undef, ny, ny)
ystar = Vector{T}(undef, ny}
Zstar = Matrix{T}(undef, ny, ns}
Hstar = Matrix{T}(undef, ny, ny}
tmp_np = Vector{T}(undef, np)
tmp_ns = Vector{T}(undef, ns)
tmp_ny = Vector{T}(undef, ny)
......@@ -1016,8 +1039,8 @@ struct KalmanSmootherWs{T, U} <: KalmanWs{T, U}
new(csmall, Zsmall, iZsmall, RQ, QQ, v, F, cholF, cholH, iF,
iFv, r, r1, at_t, K, KDK, L, L1, N, N1, ZP, Pt_t, Kv,
iFZ, PTmp, oldP, lik, KT, D, tmp_np, tmp_ns,
tmp_ny, tmp_ns_np, tmp_ny_ny, kalman_tol)
iFZ, PTmp, oldP, lik, KT, D, ystar, Zstar, Hstar, tmp_np,
tmp_ns, tmp_ny, tmp_ns_np, tmp_ny_ny, kalman_tol)
end
end
......
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