This function computes Time-Varying Parameters Regression (TVP) with the updating procedure as in Raftery et. al (2010).
tvp(y,x,V,lambda,W=NULL,kappa=NULL,c=NULL)
Arguments
y: numeric or a column matrix of a dependent variable
x: matrix of independent variables, different columns should correspond to different variables
V: numeric, initial variance in the state space equation for the recursive moment estimator updating method, as in Raftery et al. (2010)
lambda: numeric, a forgetting factor between 0 and 1 used in variance approximations
W: optional, numeric, initial value of variance for the model equations, if not specified the method based on the linear regression, as in Raftery et al. (2010) is used
kappa: optional, numeric, a parameter in the exponentially weighted moving average in variance updating (see also fDMA), between 0 and 1, if not specified the method as in Raftery et al. (2010) is used
c: optional, logical, a parameter indicating whether constant is included, if not specified c=TRUE is used, i.e., constant is included
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.
Returns
class tvp object, list of - $y.hat: fitted (forecasted) values
$thetas: estimated regression coefficients
$pred.dens.: predicitive densities from each period
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.