grid.tvp: Computes 'tvp' Function for Multiple Values of 'lambda'.

grid.tvpR Documentation

Computes tvp Function for Multiple Values of lambda.

Description

Sometimes it is necessary to consider various values of parameter lambda in Time-Varying Parameters Regression. This function computes tvp function for all values of lambda for a given grid.

This function is a wrapper of tvp.

Usage

grid.tvp(y,x,V,grid.lambda,W=NULL,kappa=NULL,parallel.grid=NULL,c=NULL)

Arguments

y

see tvp

x

see tvp

V

see tvp

grid.lambda

a numeric vector of different values of lambda, see tvp

W

optional, see tvp

kappa

optional, see tvp

parallel.grid

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

c

optional, see tvp

Value

an object of class grid.tvp, list of

$models

list of tvp objects

$fq

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

See Also

print.grid.tvp, summary.grid.tvp, plot.grid.tvp.

Examples

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

grl <- c(0.99,0.98,0.97,0.96,0.95)
g <- grid.tvp(y=ld.wti,x=ld.drivers,V=1,grid.lambda=grl)

# extract model with lambda=0.95
model <- g$models[[5]]


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

Related to grid.tvp in fDMA...