
Kalman-filter log-likelihood of the SIRD-GA state-space model
Source:R/sird_ga_kalman.R
sird_ga_loglik.RdRuns the predict/update Kalman recursion of the linear-Gaussian state-space representation of the SIRD-GA model and returns the approximate log-likelihood of the observed (partially reported, noisy) infectious counts.
Arguments
- theta
Named numeric vector with elements
lambda,gamma,alpha,s0,i0,r0,p,tau2(all strictly positive exceptr0, which may be zero;pin(0,1)).- y
Numeric vector of observed infectious head counts \(y_0, y_1, \ldots, y_n\) (not normalised; normalisation by
Nis performed internally, matching the \(O_N(t_k)=O(t_k)/N\) observation model of the manuscript).- N
Population size.
- Delta
Time step between consecutive observations (default
1).- n_sub
Internal quadrature resolution, passed to
sird_ga_transition().- Q0_diag
Variance assigned to each component of the initial-state distribution (small, reflects near-certainty about
x0).- keep_states
Logical; if
TRUE, also return the filtered state trajectory (in normalised units) and the predictive mean on the original (head-count) scale.
Value
If keep_states is FALSE (default), the scalar approximate
log-likelihood. Otherwise a list with elements loglik, filtered
(matrix of filtered means \(\bar X_k\), normalised units), predicted
(matrix of one-step-ahead predicted means \(\hat X_k\), normalised
units) and fitted (predictive mean of y, on the original head-count
scale, i.e. N * p * predicted[, "i"]).
Details
The state-space system is
$$X_k = F_k(\eta,\Delta) + A_{k-1}(\eta,\Delta) X_{k-1} + U_k, \quad
U_k \sim N_3(0, Q_k(\eta,\Delta)),$$
$$Y_k/N = p \, X_{k,2} + V_k, \quad V_k \sim N(0, R_k(\theta)),$$
with \(X_k=(S_k,I_k,R_k)/N\), observation operator B = (0, p, 0) and
\(R_k(\theta) = N^{-1}(p(1-p)+\tau^2) \, i(\eta,t_k)\), following the
observation model of Narci et al. (2021) extended to the three-event
SIRD jump process.