armatrix.fit: Model to smooth and fill in year*age matrix

View source: R/armatrix.fit.r

armatrix.fitR Documentation

Model to smooth and fill in year*age matrix

Description

Model to smooth and fill in year*age matrix

Usage

armatrix.fit(year, age, x, cv, shrink.cv = 0.5, ...)

Arguments

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

Details

General info

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.

specifics

Log(x) = age + year + cohort + age*year + residual

age

fixed effect

year

random AR1 effect

cohort

random AR1 effect

age*year

random separable AR1 effect in age and year

residual

based on shrinkage CVs. see shrink.cv

Value

list with model output

Examples

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))

iml-assess/catchR documentation built on Nov. 27, 2022, 7:35 p.m.