Skip to contents

Calculates the AR1 autocorrelation coefficient (phi) for recruitment deviations.

Usage

get_rho(first_yr = 1931, last_yr = 2022, 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 of the estimated AR1 autocorrelation coefficient (phi).

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