armatrix.fit | R Documentation |
Model to smooth and fill in year*age matrix
armatrix.fit(year, age, x, cv, shrink.cv = 0.5, ...)
year |
vector of years |
age |
vector of ages |
x |
vector of values (e.g., weight-at-age) |
cv |
coefficient of variation |
shrink.cv |
numeric (0 = original values,1 = identical to historic average for all years) |
... |
extra arguments to MakeADFun |
Models a matrix (e.g., weight-at-age) using an AR1 process over time, age and cohort (separable extension of two densities, see see section 6.4 of https://kaskr.github.io/adcomp/_book/Densities.html). This will smooth predictions over the three dimensions and fill in gaps (NA values can be used).
Developed by Noel Cadigan.
Log(x) = age + year + cohort + age*year + residual
fixed effect
random AR1 effect
random AR1 effect
random separable AR1 effect in age and year
based on shrinkage CVs. see shrink.cv
list with model output
d <- expand.grid(year=2001:2010,age=1:10) d$x <- exp(log(d$age)+rnorm(nrow(d),1,0.1)) d$cv <- d$x/10 fit <- do.call(armatrix.fit,as.list(d))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.