grid.DMA {fDMA} | R 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 |
x |
see |
grid.alpha |
|
grid.lambda |
a |
initvar |
see |
W |
see |
initial.period |
see |
V.meth |
see |
kappa |
see |
gprob |
see |
omega |
see |
model |
see |
parallel.grid |
optional, |
m.prior |
see |
mods.incl |
see |
DOW |
see |
DOW.nmods |
see |
DOW.type |
see |
DOW.limit.nmods |
see |
forced.models |
see |
forbidden.models |
see |
forced.variables |
see |
bm |
see |
small.c |
see |
av |
see |
Value
an object of class grid.dma
, list
of
$models |
|
$RMSE |
|
$MAE |
|
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)