Ageing error for Pacific Hake is based on an overall ageing error for each mean age and a multiplier to decrease ageing error for strong cohorts. If you were to plot ageing error, you could see diagonal patterns for cohorts that are moving through the population. This necessitates an ageing error that is specific to each year of data since 1975, i.e., the first year of fishery ages.

calc_ageerror(
  ages,
  x = c(0.329242, 0.329242, 0.346917, 0.368632, 0.395312, 0.42809, 0.468362, 0.517841,
    0.57863, 0.653316, 0.745076, 0.857813, 0.996322, 1.1665, 1.37557, 1.63244, 1.858,
    2.172, 2.53, 2.934, 3.388),
  multiplier = 0.55
)

Arguments

ages

The ages that have strong cohorts and decreased ageing error. Note that this should be the age-bin not the mean age in the first row of the returned matrix.

x

A vector of ageing error used for each definition of ageing error in the stock assessment model.

multiplier

A single value that is multiplied times certain entries of x to account for cohort effects. The default for Pacific Hake is 0.55.

Value

A 2 x 21 matrix is returned with column names. The rationale for the number of columns comes from the number of population age bins plus one because age-0 fish have an ageing error assigned to them as well. The first row is the mean age and the second row is the standard deviation based on a normal distribution. Mean age will be different from 0.5 + age if there is bias. Standard deviation will be different than zero if there imprecision.

Examples

# 2019 ageing error was
error <- calc_ageerror(ages = c(5, 9, 20))
#> Error in calc_ageerror(ages = c(5, 9, 20)): could not find function "calc_ageerror"
# \dontshow{
test_that("2019 ageing error", {
  expect_equal(error[2, 6], c("age5" = 0.2354495),
    label = "2019 ageing error for age 5"
  )
})
#> Error in test_that("2019 ageing error", {    expect_equal(error[2, 6], c(age5 = 0.2354495), label = "2019 ageing error for age 5")}): could not find function "test_that"
# }
if (FALSE) {
plot(error[1, ], error[2, ],
  xlab = "Mean age",
  ylab = "Standard deviation (SD)",
  pch = 19
)
}