Init.var {VAR.spec}R Documentation

Initializes an object of class var

Description

Initializes an object of class var, representing a VAR (Vector autoregression) model, sets some of its parameters and reads the specification of certain polynomials which determine the VAR model from a data.frame or from a tab-delimited text file (, which is converted to a data.frame). In this data.frame each polynomial is specified via it's (complex) roots and constant. If no such text file or data.frame is specified, an appropriate default data.frame is created, which can then be modified by the user.

Usage

Init.var(grid = 1001, order.max.init = 10, inv.roots.def = NULL,
              a.niter = 5000, a.eps.max.for.UIA = 1e-10, 
              a.eps.for.roots = 1e-05,a.eps.for.spectra=1E-4)
              

Arguments

grid

An integer specifying the number of equidistant gridpoints in [0,\pi] used for plotting and numerical approximations. They are given by j\pi /((grid-1)), j=0,...,grid.

order.max.init

An integer providing an initial limitation on the order of the VAR model. The degrees of the polynomials specified in the inv.roots.def should not exceed 2*order.max.init and the lines of the inv.roots.def should be at least equal to 6*order.max.init+2 (if this not the case, appropriate lines will be automatically added).

inv.roots.def

Either NULL or a data.frame or a tab-delimited text file (, which is converted to a data.frame). This data.frame contains the roots (rows) of the polynomials (columns) used to specify the VAR model. See Details for the specific structure of the text file. If set to NULL, a data.frame of the appropriate structure will be created, which contains no roots, and corresponds, thus, to a bivariate white noise series. The data.frame in any of the above cases may be modified after the call of init.var, via e.g. var.name$inv.roots <- edit(var.name$inv.roots).

a.niter

An integer specifying the maximal number of iterations for the Innovations algorithm.

a.eps.max.for.UIA

Numeric close to 0. Specifies the threshold for the relative increase in precision achieved at a step of the Innovations algorithm, for accepting that the algorithm has converged.

a.eps.for.roots

Numeric close to 0. A threshold for considering two roots as identical, if a) the inverses of their radii and b) their angles (in their polar representation) differ by less than this threshold.

a.eps.for.spectra

Numeric close to 0. A threshold for checking the validity of the calculation of the VAR model. It's spectra are calculated on the basis of the polynomials used to specify the VAR model in inv.roots.def should coincide with the spectra calculated on the basis of the VAR model's coefficients. If they differ by more than a.eps.for.spectra warning messages will be written out to the console.

Details

The text file [/ data.frame] passed in argument inv.roots.def should have a specific structure:

Two example text files of the appropriate structure, VAR.inv.roots.from.det.cross.txt and VAR.inv.roots.from.eta.ksi.zeta.txt may be found in the extdata folder of the package. A path to them may be obtained via

fpath<-system.file("extdata","text.file",package="VAR.spec").

The corresponding example data.frames are also directly accessible to the user as

VAR.inv.roots.from.det.cross and VAR.inv.roots.from.eta.ksi.zeta.

Value

An object of class var, basically a list including elements:

grid

The integer contained in argument grid. The number of equidistant gridpoints in [0,\pi], used for plotting and numerical approximations.

p.max.init

The integer contained in argument order.max.init. An initial limitation on the order of the VAR model.

inv.roots

A data.frame containing the roots of certain polynomials, required to specify the VAR model.

niter

The integer contained in argument a.niter. An integer specifying the maximal number of iterations for the Innovations algorithm.

eps.max.for.UIA

Numeric close to 0. Specifies the threshold for the relative increase in precision achieved at a step of the Innovations algorithm, for accepting that the algorithm has converged.

eps.for.roots

Numeric close to 0. A threshold for considering two roots as identical, if a) the inverses of their radii and b) their angles (in their polar representation) differ by less than this threshold.

eps.for.spectra

Numeric close to 0. A threshold for checking the validity of the calculation of the VAR model. It's spectra are calculated on the basis of the polynomials used to specify the VAR model in inv.roots.def should coincide with the spectra calculated on the basis of the VAR model's coefficients. If they differ by more than a.eps.for.spectra warning messages will be written out to the console.

See Also

VAR.spec-package, calculate.VAR, simulate.VAR,

plot_VAR.spectra, plot_VAR.Phase.details,

calc.VAR.spec.from.coefs

Examples

my.var <- Init.var(grid=201, 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$inv.roots


[Package VAR.spec version 1.0 Index]