grid.DMA | R Documentation |
fDMA
Function for Multiple Values of alpha
and lambda
.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
.
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)
y |
see |
x |
see |
grid.alpha |
a |
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 |
an object of class grid.dma
, list
of
$models |
|
$RMSE |
|
$MAE |
|
print.grid.dma
, summary.grid.dma
, plot.grid.dma
.
wti <- crudeoil[-1,1]
drivers <- (lag(crudeoil[,-1],k=1))[-1,]
ld.wti <- (diff(log(wti)))[-1,]
ld.drivers <- drivers[-1,]
ld.drivers[,c(4,6)] <- (diff(drivers[,c(4,6)]))[-1,]
ld.drivers[,c(1:2,5,7)] <- (diff(log(drivers[,c(1:2,5,7)])))[-1,]
ld.drivers[,c(3,6)] <- ld.drivers[,c(3,6)]/100
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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.