checks: Checks the arguments for the GEARS function.

Description Usage Arguments Value

View source: R/checks.R

Description

This function checks the arguments and stops the program if encounters an error. An error message is returned to the user.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
checks(
  DATA,
  forecast.horizon,
  size.rs,
  number.rs,
  glm.family,
  level,
  y.name = NULL,
  y.max.lags = NULL,
  x.names = NULL,
  x.max.lags = NULL,
  x.fixed.names = NULL,
  x.fixed.lags = NULL,
  x.interaction.names = NULL,
  x.interaction.lags = NULL,
  last.obs,
  use.intercept,
  error.measure,
  betas.selection
)

Arguments

DATA

A data frame or a univariate time series.

forecast.horizon

Number of periods for forecasting.

size.rs

Number of observations in the rolling sample.

number.rs

Number of rolling samples.

glm.family

A description of the error distribution to be used in the model. See glm for details.

level

Confidence level for prediction intervals. Numeric value between 0 and 100.

y.name

The name of the Y (left-hand side) variable. If NULL (default), the function creates a temporary name.

y.max.lags

A numeric value that gives the maximum number of lags of the Y (left-hand side) variable (see Details). Can be NULL (default) if the past values of the Y variable are not included in the model.

x.names

List with names of the X (right-hand side) variables that have a maximum number of lags (see Details). Can be NULL (default) if univariate model or if your model does not have variables of this type.

x.max.lags

List of numeric values that give the maximum number of lags of the X (right-hand side) variables. Can be NULL (default).

x.fixed.names

List with names of the X (right-hand side) variables that have a fixed number of lags (see Details). Can be NULL (default) if univariate model or if your model does not have variables of this type.

x.fixed.lags

List of numeric values that give the fixed number of lags of the variables in x.fixed.names. Can be NULL (default).

x.interaction.names

List of character vectors with names of the variables to be included as interaction terms (see Details). Can be NULL (default) if your model does not have interaction terms.

x.interaction.lags

List of numeric vectors with lags of the variables to be included as interaction terms. List and numeric vectors should have the same length as the ones in x.interaction.names. Can be NULL (default) if your model does not have interaction terms.

last.obs

Index number of the last observation to be considered.

use.intercept

Possible values c("both", "with", "without").

error.measure

Possible values c("mse", "mae", "mase", "smape", "owa").

betas.selection

Possible values c("last", "average", "both").

Value

Stops the program and returns an error message.


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