Random walk with age-correlated increments: density and simulation
Source:R/process.R
process_cor_rw.RdA random walk whose annual changes are correlated between neighbouring ages.
Changes are independent between years, with no tendency to return to a mean.
tinyAM uses this process for F_settings$process = "cor_rw".
Arguments
- x
Numeric matrix with years in rows and ordered ages in columns. For simulation, only the first row supplies starting values.
- sd
Positive marginal SD of annual increments: a scalar shared by all ages, or a vector with one value per column of
x.- rho
Correlation between adjacent columns, strictly between -1 and 1. Negative values allow alternating changes between neighbouring ages.
Value
dprocess_cor_rw() returns the summed log density of annual
increment vectors (zero for one row). rprocess_cor_rw() returns a matrix
with the dimensions and names of x, leaving its first row unchanged.
Details
For a year by age matrix x, each vector of annual increments
\(x_{t,a}-x_{t-1,a}\) has a multivariate Normal distribution with mean zero
and covariance \(\Sigma_{ab}=\sigma_a\sigma_b\rho^{|a-b|}\).
Distance is measured by column position, not by numerical age labels.
Each sd is a marginal increment SD; correlation does not inflate it.
At rho = 0, increments are independent between ages, as in dprocess_rw().
The first row has no density contribution. rprocess_cor_rw() retains it
and simulates later rows conditionally. In tinyAM, x contains deviations
from the log-F mean, rather than the absolute latent log-F states.
dprocess_cor_rw() supports RTMB automatic differentiation.