comp_models: Plot/table hindcast performance

View source: R/comp_models.R

comp_modelsR Documentation

Plot/table hindcast performance

Description

Plot/table hindcast estimates versus actual values and produce a table with hindcast performance metrics.

Usage

comp_models(dat, comp_age, years = 5, metric = c("md", "mad"))

Arguments

dat

A data frame with a column providing:

byr

brood year

age#

one or more columns proving the total return of age # fish using the naming convention age#

xxx_pred

one or more columns containing the hindcast prediction for the return of fish of "comp_age" using the naming convention xxx_pred. The prefix "xxx" will be used to name the prediction in the output.

comp_age

The total age of fish being forecast.

years

The number of past years used to evaluate forecast accuracy.

metric

The performance metrics used to evaluate forecast accuracy; "md" = "mean deviation", "mad" = "mean absolute deviation" or "mape" = "mean absolute percent error".

Value

A list containing one figure and one table.

Examples

dat6 <- prep_brood(deshka, 4:6)
ARIMA6_ar1 <- arima(dat6$age6_ln, order=c(1,0,0))
dat6$ARIMA_pred <- exp(pred_arima(ARIMA6_ar1, x = dat6$age6_ln)[1,])
dat6$es_pred <- pred_es(dat6$age6_ln)
comp_models(dat = dat6, comp_age = 6, years = 5)


adamreimer/preseason documentation built on Feb. 3, 2024, 3:39 a.m.