VAR.spec-package {VAR.spec} | R Documentation |
Allows Specifying a Bivariate VAR (Vector Autoregression) with Desired Spectral Characteristics
Description
The spectral characteristics of a bivariate series (Marginal Spectra, Coherency- and Phase-Spectrum) determine whether there is a strong presence of short-, medium-, or long-term fluctuations (components of certain frequencies in the spectral representation of the series) in each one of them. These are induced by strong peaks of the marginal spectra of each series at the corresponding frequencies. The spectral characteristics also determine how strongly these short-, medium-, or long-term fluctuations of the two series are correlated between the two series. Information on this is provided by the Coherency spectrum at the corresponding frequencies. Finally, certain fluctuations of the two series may be lagged to each other. Information on this is provided by the Phase spectrum at the corresponding frequencies. The idea in this package is to define a VAR (Vector autoregression) model with desired spectral characteristics by specifying a number of polynomials, required to define the VAR. See Ioannidis(2007) <doi:10.1016/j.jspi.2005.12.013>. These are specified via their roots, instead of via their coefficients. This is an idea borrowed from the Time Series Library of R. Dahlhaus, where it is used for defining ARMA models for univariate time series. This way, one may e.g. specify a VAR inducing a strong presence of long-term fluctuations in series 1 and in series 2, which are weakly correlated, but lagged by a number of time units to each other, while short-term fluctuations in series 1 and in series 2, are strongly present only in one of the two series, while they are strongly correlated to each other between the two series. Simulation from such models allows studying the behavior of data-analysis tools, such as estimation of the spectra, under different circumstances, as e.g. peaks in the spectra, generating bias, induced by leakage.
Details
The DESCRIPTION file:
Package: | VAR.spec |
Type: | Package |
Title: | Allows Specifying a Bivariate VAR (Vector Autoregression) with Desired Spectral Characteristics |
Version: | 1.0 |
Date: | 2024-06-7 |
Authors@R: | c( person("Evangelos", "Ioannidis", email = "eioannid@aueb.gr", role = c("cre", "aut", "cph") ), person("Panagiotis", "Papastamoulis", email = "papapast@yahoo.gr", role = c("aut", "cph"))) |
Description: | The spectral characteristics of a bivariate series (Marginal Spectra, Coherency- and Phase-Spectrum) determine whether there is a strong presence of short-, medium-, or long-term fluctuations (components of certain frequencies in the spectral representation of the series) in each one of them. These are induced by strong peaks of the marginal spectra of each series at the corresponding frequencies. The spectral characteristics also determine how strongly these short-, medium-, or long-term fluctuations of the two series are correlated between the two series. Information on this is provided by the Coherency spectrum at the corresponding frequencies. Finally, certain fluctuations of the two series may be lagged to each other. Information on this is provided by the Phase spectrum at the corresponding frequencies. The idea in this package is to define a VAR (Vector autoregression) model with desired spectral characteristics by specifying a number of polynomials, required to define the VAR. See Ioannidis(2007) <doi:10.1016/j.jspi.2005.12.013>. These are specified via their roots, instead of via their coefficients. This is an idea borrowed from the Time Series Library of R. Dahlhaus, where it is used for defining ARMA models for univariate time series. This way, one may e.g. specify a VAR inducing a strong presence of long-term fluctuations in series 1 and in series 2, which are weakly correlated, but lagged by a number of time units to each other, while short-term fluctuations in series 1 and in series 2, are strongly present only in one of the two series, while they are strongly correlated to each other between the two series. Simulation from such models allows studying the behavior of data-analysis tools, such as estimation of the spectra, under different circumstances, as e.g. peaks in the spectra, generating bias, induced by leakage. |
License: | GPL-2 |
LazyData: | true |
Author: | Evangelos Ioannidis [cre, aut, cph], Panagiotis Papastamoulis [aut, cph] |
Maintainer: | Evangelos Ioannidis <eioannid@aueb.gr> |
Index of help topics:
Init.var Initializes an object of class 'var' VAR.inv.roots.from.det.cross An example 'data.frame' defining a VAR (Vector autoregression) model. VAR.inv.roots.from.eta.ksi.zeta An example 'data.frame' defining a VAR model. VAR.spec-package Allows Specifying a Bivariate VAR (Vector Autoregression) with Desired Spectral Characteristics calc.VAR.spec.from.coefs Calculates the spectral matrix of a multivariate VAR (Vector autoregression) model. calculate.VAR Attempts to define a bivariate VAR (Vector autoregression) model. plot_VAR.Phase.details Plots details related to the Phase spectrum of a bivariate VAR (Vector autoregression) model. plot_VAR.spectra Plots spectra of a bivariate VAR (Vector autoregression) model. simulate.VAR Simulates a bivariate series from a bivariate VAR (Vector autoregression) model.
The specification of the VAR (Vector autoregression) model is based on the following fact (see Ioannidis (2007))
<doi:10.1016/j.jspi.2005.12.013>:
For any four complex polynomials det(z), cross(z)
of degree 2p
and chi.1(z), chi.2(z)
of degree p
, satisfying
EQ(*)
|det(z)|^2+|cross(z)|^2 = |chi.1(z)|^2 * |chi.2(z)|^2
on |z|=1
, there exists a bivariate VAR(p) with marginal spectra
f.i (w) = (1/2\pi) |chi.i(z)|^2 /|det(z)|^2,
and cross-spectrum
f.1.2 (w) = (1/2\pi) z^{(-p)}cross(z) /|det(z)|^2,
where z=exp(-iw)
. The squared Coherency is then given by
|cross(z)|^2 /(|det(z)|^2+|cross(z)|^2).
The idea in this package is to define the necessary polynomials by specifying their roots, instead of their coefficients. This is an idea borrowed from the Time Series Library of R. Dahlhaus, where it is used for defining ARMA models for univariate time series.
Moreover, the package allows the user to specify only some of the roots of det(z), cross(z)
and chi.1(z), chi.2(z)
, while it attempts to find further non-specified roots in a way such that EQ(*) is satisfied.
By specifying certain roots of det(z), cross(z)
and chi.1(z), chi.2(z)
one can induce desired features in the spectra and in the series. For example,
if one wishes a strong presence of frequency
w_0
components in series 1, there should be a root with modulus close to 1 and angle equal tow_0
, the multiplicity of which fordet(z)
is higher than its multiplicity forchi.1(z)
, forcing the spectrum of series 1 to have a peak atw_0
.If the frequency-
w_0
-components should be strongly correlated between series 1 and series 2, the multiplicity of this root fordet(z)
should be higher than its multiplicity forcross(z)
, forcing the Coherency atw_0
close to 1.
Required polynomials (see argument calc.method
of function calculate.VAR
and related Details
) are first passed to function Init.var
, via a data.frame
or a text file, which contains the multiplicities of desired roots (rows) for each required polynomial (columns).
After calling Init.var
, function calculate.VAR
must be called, which attempts to find a VAR model which is compatible with the polynomials specified in its attribute inv.roots
, by making necessary adjustments, calculates its spectra, coefficients and order, makes the necessary checks and plots it's spectra. Then, one can simulate from the specified model calling simulate.VAR
.
Author(s)
Evangelos Ioannidis [cre, aut, cph], Panagiotis Papastamoulis [aut, cph]
Maintainer: Evangelos Ioannidis <eioannid@aueb.gr>
References
Ioannidis, E. E. (2007). Spectra of bivariate VAR(p) models. Journal of Statistical Planning and Inference 137(2), 554-566.
Ioannidis, E. E. and Chronis, G. A. (2005). Extreme spectra of VAR models and orders of near-cointegration. J. Time Ser. Anal. 26, 399-421.
See Also
Init.var
, calculate.VAR
, simulate.VAR
,
plot_VAR.spectra
, plot_VAR.Phase.details
,
Examples
my.var <- Init.var(grid=501, order.max.init=10, inv.roots.def=NULL)
my.var$inv.roots[2,]<- c(0.98,0.017261,2,3,1,1,2, rep(0,8))
my.var$inv.roots[3,]<- c(0.92,0.897598,2,1,1,1,2, rep(0,8))
my.var$inv.roots[4,]<- c(0.98,1.795196,1,1,0,1,1, rep(0,8))
my.var <- calculate.VAR (a.var = my.var, calc.method="from.det.cross",
plot.spectra=TRUE,suppr.spec.check.warn=TRUE)
print(my.var$validity.msg)