make_fit_season_model: Make a fit_model function that takes a seasonality component

View source: R/season_model_functions.R

make_fit_season_modelR Documentation

Make a fit_model function that takes a seasonality component

Description

This method returns a function that will fit a model both with and without lagged outcomes.

Usage

make_fit_season_model(formula, no_lag = NULL)

Arguments

formula

Formula specifying seasonality. No outcome or time needed.

no_lag

Formula specifying additional covariates that should be included, but without lag (usually used due to colinearity of lagged outcomes, such as with a sin and cos component).

Details

You hand it a formula object specifying the seasonality, e.g., " ~ Q2 + Q3 + Q4", if you have quarterly season effects. This method assumes you want models with a linear time component as well, and will add that and an intercept in automatically.

It gives you a function back, that you can use to analyze data.

Value

Callable function. See make_fit_model.

See Also

make_fit_model for the type of function this method will generate.

Examples

data( "newjersey")
modF = make_fit_season_model( ~ temperature, timename = "month" )
newjersey = add_lagged_covariates( newjersey, "n.warrant", covariates = c("temperature") )
modF( newjersey, "n.warrant" )

lmiratrix/simITS documentation built on Sept. 1, 2023, 9:02 p.m.