fit_predict: Fit and Predict Function

Description Usage Arguments Value

View source: R/fit_predict.R

Description

For each rolling sample, fit_predict uses the training data set to fit a GLM. Then, it uses the testing data set to get the predictions.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
fit_predict(
  forecast.lead,
  eq.number,
  sample.number,
  glm.family,
  Y.name,
  all.equations.rhs,
  DF.Fit.Predict,
  ...
)

Arguments

forecast.lead

A numeric value with the number of the forecast lead.

eq.number

A numeric value with the number of the equation being estimated.

sample.number

A numeric value with the number of the rolling sample being used in the estimation/prediction.

glm.family

A description of the error distribution to be used in the model. Inherits from gears.

Y.name

Name of the y variable (variable to be forecasted) created by gears.

all.equations.rhs

Vector with all possible combinations of right-hand side variables.

DF.Fit.Predict

a data frame with training data and test data for the estimation estage.

...

Other parameters passed on the glm.

Value

Returns a numerical value giving the prediction for the selected equation, rolling sample, and forecast lead.


gu-stat/gears documentation built on Oct. 20, 2021, 2:53 a.m.