Skip to contents

Calculates the lag-one correlation used for the terminal recruitment deviations in the assessment prior.

Usage

get_rho(first_yr = 1931L, last_yr = 2022L, rdev)

Arguments

first_yr

An integer specifying the first model year for the analysis.

last_yr

An integer specifying the last model year for the analysis.

rdev

A numeric vector of recruitment deviations, length equal to (last_yr - first_yr + 1).

Value

A numeric scalar containing the lag-one correlation coefficient.

Details

This is an assessment-specific calculation, not a general AR(1) estimator. It uses recruitment deviations from 1965 through five years before last_yr. Constant or otherwise degenerate input can produce a non-finite result because no variance guard is applied.

Examples

first_yr <- 1931
last_yr <- 2022
N <- length(first_yr:last_yr)
rdev <- arima.sim(list(order = c(1, 0, 0), ar = 0.5), n = N)
get_rho(first_yr, last_yr, rdev)
#> [1] 0.378793