This RLDM
(Rational Linear Dynamic Models) R package provides models for stationary processes with a rational spectral density and methods for their estimation. We will refer to them as rational models. It builds heavily on its sister R package rationalmatrices
, see https://bfunovits.github.io/rationalmatrices/.
Installation
You can install the latest version of the code using the remotes
R package.
remotes::install_github("bfunovits/RLDM")
Content
The package provides the following sets of functions whose documentation can be found in the reference page https://bfunovits.github.io/RLDM/reference of the website https://bfunovits.github.io/RLDM/ (created with https://pkgdown.r-lib.org/):
- Classes for the construction of rational models (consisting of an input covariance matrix and a rational matrix function from the
rationalmatrices
package): - Templates for filling the linear parameters with deep parameters through an affine mapping. Consists of
- a matrix H where the number of rows is the number of linear parameters in a given model and the number of columns is the number of deep parameters in a given model
- a column vector h of appropriate dimension
See help("model structures")
and help("local model structures")
for more details.
-
Generic functions to create objects which are derived from these rational models
- The autocovariance sequence, see
autocov()
- Spectral density, see
spectrald()
- The transfer function/impulse response function (IRF), see
impresp()
- Forecast error variance decomposition, see
fevardec()
, for a given IRF
- Forecast error variance decomposition, see
- Frequency response (the transfer function evaluated on the unit circle), see
freqresp()
- The autocovariance sequence, see
-
Several other generic functions which extend R’s generic functions
Some helpers for estimation methods:
solve_de()
,solve_inverse_de()
, and more-
Moment estimation methods for
- AR models, see e.g.
est_ar()
- ARMA models, see the Hannan-Rissannen-Kavalieris algorithm in
est_arma_hrk3()
- state space models, see e.g.
est_stsp_cca()
- AR models, see e.g.
-
Likelihood estimation methods
ll()
-
ll_theta()
andll_FUN()
for the estimation of the deep parameters of a rational model ll_kf()
-
Some more tooling like
- simulation in
sim()
- model comparison in
KL_divergence()
,pm_test()
,compare_estimates()
- simulation in
Usage
See the case study vignette("d_casestudy2")
for a detailed example of how to use the package.