One draw of a deviation surface from the process the estimation model penalizes
Source:R/sim_biologicals.R
draw_growth_pe_surface.RdThe reverse of Get_PE_loglik. A shared level is drawn once and
written wherever it appears, at the sd of the slot the penalty reads it at.
Under iid every level is its own normal. Under the random walk each level
steps from the year before. A first year the estimation model gives a diffuse
start (rw_init_sigma) keeps the replicate's own value, since that start
leaves the level to the data, as the recruitment and F walks do; under
NA it starts at the walk's own sd, as the penalty does. The 3D GMRF and
the separable AR1 draw each population, region and sex's whole surface over
years and bins from the form's precision, conditional on the cells
the map fixes at zero, which is the density the penalty evaluates at them.
Usage
draw_growth_pe_surface(
PE_model,
map,
pe_pars,
bins,
fit_devs = NULL,
n_cond = 0,
rw_init_sigma = NA
)Arguments
- PE_model
Integer process error code, as
Get_PE_loglikreads it.- map
Integer array
[pop, region, year, bin, sex]of the levels,NAwhere a cell is fixed.- pe_pars
Array
[pop, region, slot, sex], the half ofgrowth_pe_parsthe form reads.- bins
Bins the correlated forms run over.
- fit_devs
The fit's deviations, shaped as
map, read in the firstn_condyears only.- n_cond
Integer. Years that keep the fit's deviations. Default
0draws every year.- rw_init_sigma
The sd the estimation model gives a walk's first year, or
NA(default) for the walk's own.