The goal of sibregresr is to predict salmon returns using sibling regression. The regressions are conducted within a dynamic linear modeling framework and model averaging is used.
You can install the development version of sibregresr from GitHub with:
# install.packages("devtools")
devtools::install_github("wdfw-fp/sibregresr")
This is a basic example which shows you how to solve a common problem:
library(sibregresr)
## basic example code
## to come...
The first step in forecasting the returns of a given stock
where
The seven other models are simplified versions of this full model where:
- the slope is assumed to constant through time (i.e.,
$w_{\beta, t}=0$ ); - the intercept is assumed to be constant through time;
- the slope and intercept are assumed to be constant through time;
- the intercept is assumed to be zero (i.e.,
$\alpha_t=0$ ); - the intercept is assumed to be zero and the slope is assumed to be constant through time;
- the slope is assumed to be zero; and
- the slope is assumed to be zero and the intercept is assumed to be constant through time.
Together with the full model, this list comprises the eight models
considered in forecasting. The models are fit using the dlm
package
(Petris 2010) in the R statistical computing environment.
Once the eight models have been fit, each is used to make a prediction
of returns in the upcoming year and an ensemble forecast is generated by
taking a weighted average of the predictions. By default, the ensemble
model weights are calculated for each model
Alternatively, the user may choose to weight models based on their
observed performance
Giovanni Petris (2010). An R Package for Dynamic Linear Models. Journal of Statistical Software, 36(12), 1-16. URL https://www.jstatsoft.org/v36/i12/.
Petris, Petrone, and Campagnoli. Dynamic Linear Models with R. Springer (2009).