tvp {fDMA} | R Documentation |
Computes Time-Varying Parameters Regression.
Description
This function computes Time-Varying Parameters Regression (TVP) with the updating procedure as in Raftery et. al (2010).
Usage
tvp(y,x,V,lambda,W=NULL,kappa=NULL,c=NULL)
Arguments
y |
|
x |
|
V |
|
lambda |
|
W |
optional, |
kappa |
optional, |
c |
optional, |
Details
It is not possible to set c=FALSE
if ncol(x)=0
. In such a case the function will automatically reset c=TRUE
inside the code.
Value
class tvp
object, list
of
$y.hat |
fitted (forecasted) values |
$thetas |
estimated regression coefficients |
$pred.dens. |
predicitive densities from each period |
$y |
|
References
Raftery, A. E., Karny, M., Ettler, P., 2010. Online prediction under model uncertainty via Dynamic Model Averaging: Application to a cold rolling mill. Technometrics 52, 52–66.
Sanderson, C., Curtin, R., 2016. Armadillo: A template-based C++ library for linear algebra. Journal of Open Source Software 1, https://arma.sourceforge.net/armadillo_joss_2016.pdf.
See Also
grid.tvp
, print.tvp
, summary.tvp
, plot.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,]
t1 <- tvp(y=ld.wti,x=ld.drivers,V=1,lambda=0.99)
t2 <- tvp(y=ld.wti,x=ld.drivers,V=1,lambda=0.99,W=1)
t3 <- tvp(y=ld.wti,x=ld.drivers,V=1,lambda=0.99,W=1,kappa=0.75)
# Model with constant only
empty <- matrix(,nrow=nrow(ld.drivers),ncol=0)
t4 <- tvp(y=ld.wti,x=empty,lambda=0.99,V=1)