statespace_augmented#
The augmented Kalman filter and smoother (DK §5.7): an alternative to the exact initial filter for diffuse states, and the basis of regression estimation (DK §6.2).
With \(\alpha_1 = a + A\delta + R_0\eta_0\) and \(\delta\) unknown, the filter runs once with \(\delta = 0\), giving \(v^*_t, F_t, K_t, P_t\), and carries the effect of \(\delta\) as extra columns:
so that \(v_t(\delta) = v^*_t + V^A_t \delta\). The generalized least squares estimate is \(\hat\delta = -S^{-1} s\) with variance \(S^{-1}\), and the diffuse log likelihood (DK §7.2.2-7.2.3) is
The smoother adds the uncertainty about \(\delta\) to \(V_t\) by the law of total variance. The filter needs \(F_t\) nonsingular over the observed elements; the exact initial filter does not.
augmented_result_t#
type :: augmented_result_t
integer :: k_diffuse ! k
type(filter_result_t) :: filter ! the delta = 0 filter
real(dp), allocatable :: A(:, :, :) ! (m, k, n+1)
real(dp), allocatable :: VA(:, :, :) ! (p, k, n)
real(dp), allocatable :: s(:), S_mat(:, :)
real(dp), allocatable :: delta(:), delta_cov(:, :)
real(dp) :: llf, llf_fixed, llf_marginal
end type
llfDiffuse log likelihood; equal to that of the exact initial filter.
llf_fixedLog likelihood with \(\delta\) fixed but unknown, concentrated at \(\hat\delta\) (DK §7.2.4):
llf+ \(\tfrac12 \log|S|\).llf_marginalMarginal log likelihood (DK §7.2.6); see
marginal_correctionin statespace_filter.
augmented_filter#
subroutine augmented_filter(rep, res, info)
type(ssm_rep_t), intent(in) :: rep
type(augmented_result_t), intent(out) :: res
integer, intent(out) :: info
info is SS_ERR_NOT_PD if S is singular: the data do not identify
\(\delta\).
augmented_smoother#
subroutine augmented_smoother(rep, res, alphahat, V, info)
real(dp), intent(out) :: alphahat(:, :), V(:, :, :) ! (m, n), (m, m, n)