knitr::opts_chunk$set( collapse = TRUE, comment = "#>", fig.path = "man/figures/README-", out.width = "100%" )
WORK IN PROGRESS
The tvRRR package implements time-varying reduced rank regression as proposed in A state-space approach to time-varying reduced-rank regression (Work in progress, Brune, Bura and Scherrer).
The development version can be installed from GitHub with:
if (!require(devtools)) { install.packages("devtools") } devtools::install_github("b-brune/tvRRR")
We fit a reduced-rank regression with time-varying coefficient matrices. We implement two types of time-variation, called model (A) and model (B):
[(A) \quad y_t = \alpha_t\beta'x_t + \Gamma{u}_t + \varepsilon_t]
[(B) \quad y_t = \alpha\beta_t'x_t + \Gamma{u}_t + \varepsilon_t]
Model fitting is carried out using a Gaussian linear state-space model and the Kalman filter.
The function dataset()
draws data from models (A) and (B) with different specifications of the time-variation in the parameter matrix.
library(tvRRR) set.seed(712) dat <- dataset("VARbreak", p = 5, d = 2, q = 5, t = 100, model = "A") X <- dat$X; y <- dat$y
The main function of the dataset is tvRRR()
. It automatically selects the rank of the model using BIC (in case it is unknown) and fits the tvRRR model.
fit <- tvRRR(X = X, y = y, select_rank = TRUE, d_max = 5, silent = TRUE, model = "A") fit
tvRRR()
returns a list of the filtered time-varying parameters (one-step-ahead, filtered and smoothed), as well as the fitted parameters and some information on the data log-likelihood and convergence.
For more information on the model fitting algorithm see the paper, the accompanying vignette, and the function's documentation.
We are grateful for any contribution to the further development of the R package. If you experience any problems using the package or have suggestions for new features, please open an issue in the issue tracker.
Barbara Brune ( b-brune ) - TU Wien, Vienna, Austria
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.