grid.DMA: Computes 'fDMA' Function for Multiple Values of 'alpha' and...

grid.DMAR Documentation

Computes fDMA Function for Multiple Values of alpha and lambda.

Description

Sometimes it is necessary to consider various values of parameters alpha and lambda in Dynamic Model Averaging (or Dynamic Model Selection, etc.). This function computes fDMA function for all combinations of alpha and lambda for given grids.

This function is a wrapper of fDMA.

Usage

grid.DMA(y,x,grid.alpha,grid.lambda,initvar,W=NULL,initial.period=NULL,V.meth=NULL,
kappa=NULL,gprob=NULL,omega=NULL,model=NULL,parallel.grid=NULL,m.prior=NULL,
mods.incl=NULL,DOW=NULL,DOW.nmods=NULL,DOW.type=NULL,DOW.limit.nmods=NULL,
forced.models=NULL,forbidden.models=NULL,forced.variables=NULL,bm=NULL,
small.c=NULL,av=NULL)

Arguments

y

see fDMA

x

see fDMA

grid.alpha

a numeric vector of different values of alpha

grid.lambda

a numeric vector of different values of lambda or a list of numeric vectors for multiple lambda in one model (see fDMA)

initvar

see fDMA

W

see fDMA

initial.period

see fDMA

V.meth

see fDMA

kappa

see fDMA

gprob

see fDMA

omega

see fDMA

model

see fDMA

parallel.grid

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

m.prior

see fDMA

mods.incl

see fDMA

DOW

see fDMA

DOW.nmods

see fDMA

DOW.type

see fDMA

DOW.limit.nmods

see fDMA

forced.models

see fDMA

forbidden.models

see fDMA

forced.variables

see fDMA

bm

see fDMA

small.c

see fDMA

av

see fDMA

Value

an object of class grid.dma, list of

$models

list of list of models

$RMSE

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

$MAE

matrix with Mean Absolute Error (MAE) for all estimated models

See Also

print.grid.dma, summary.grid.dma, plot.grid.dma.

Examples

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

gra <- c(0.99,0.98,0.97)
grl <- c(0.99,0.95)
g1 <- grid.DMA(y=ld.wti,x=ld.drivers,grid.alpha=gra,grid.lambda=grl,initvar=10)


# extract model with alpha=0.97 and lambda=0.95
model <- g$models[[3]][[2]]

# models with various multiple lambdas

gra <- c(0.99,0.98,0.97)
grl <- list(c(0.99,0.95,0.90),c(0.99,0.98,0.97,0.96,0.95))
g2 <- grid.DMA(y=ld.wti,x=ld.drivers,grid.alpha=gra,grid.lambda=grl,initvar=10)


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

Related to grid.DMA in fDMA...