The variance of each grid cell given the cells the model already knows
Source:R/model_precision.R
get_dsem_margvar.RdA lognormal deviation with variance \(v\) has \(E[\exp(x)] = \exp(\mu + v/2)\), so recruitment keeps its mean at \(R_0\) only if the cell's mean drops by \(v/2\). The \(v\) that does it is the cell's variance conditional on what the model already knows (the observed covariate values, and the years before a series starts), not the sd line's square: under a self path \(\rho\) a settled year has \(\sigma^2 / (1 - \rho^2)\), and every lagged path adds to it. For unknown cells \(U\) and known cells \(K\), \(\mathrm{Var}(x_U \mid x_K) = (Q_{UU})^{-1}\), the inverse of the unknown block of the precision, so each cell's variance is a diagonal entry of that inverse.
Arguments
- dsem_beta, ln_dsem_sd, dsem_model
As in
get_dsem_arrow_values.- x_grid
Matrix
[year, series]of the grid, needed when an arrow is moderated.- dsem_cells
Output of
get_dsem_cells.- known_cell
Logical over the
n_grid_yrs * n_seriescells (years within series),TRUEwhere the model already knows the value.
Details
A solved series (an sd of zero) has no row of its own in the precision. Its
cells move with whatever sets them, and get_dsem_Q_oo folds
that into the rows that keep an innovation, so the correction and the
density use the same precision.