grid.roll.reg: Computes 'roll.reg' Function for Multiple Values of 'window'.

grid.roll.regR Documentation

Computes roll.reg Function for Multiple Values of window.

Description

Sometimes it is necessary to consider various values of parameter window in Rolling Regression. This function computes roll.reg function for all values of window for a given grid.

This function is a wrapper of roll.reg.

Usage

grid.roll.reg(y,x=NULL,grid.window,parallel.grid=NULL,c=NULL)

Arguments

y

see roll.reg

x

see roll.reg

grid.window

a numeric vector of different values of window, see roll.reg

parallel.grid

optional, logical, indicate whether parallel computations should be used, by default parallel=FALSE

c

optional, see roll.reg

Value

an object of class grid.roll.reg, list of

$models

list of reg objects

$fq

matrix with Root Mean Squared Error (RMSE) and Mean Absolute Error (MAE) for all estimated models

See Also

print.grid.roll.reg, summary.grid.roll.reg, plot.grid.roll.reg.

Examples

wti <- crudeoil[-1,1]
drivers <- (lag(crudeoil[,-1],k=1))[-1,]
ld.wti <- (diff(log(wti)))[-1,]
ld.drivers <- (diff(log(drivers)))[-1,]

grw <- c(50,100,150)
g <- grid.roll.reg(y=ld.wti,x=ld.drivers,grid.window=grw)

# extract model with window=100
model <- g$models[[2]]


fDMA documentation built on July 26, 2023, 6:09 p.m.

Related to grid.roll.reg in fDMA...