evaluateVAR1fit: Visualize the fit of a VAR(1) model

Description Usage Arguments Value Author(s) See Also Examples

View source: R/evaluateVAR1fit.r

Description

Simple plots for assessment of the fit of an estimated VAR(1) model.

Usage

1
2
evaluateVAR1fit(Y, A, SigmaE, unbalanced=NULL, diag=FALSE, 
                fileType="eps", dir=getwd())

Arguments

Y

Three-dimensional array containing the data. The first, second and third dimensions correspond to covariates, time and samples, respectively. The data are assumed to be centered covariate-wise.

A

A matrix \mathbf{A} of autoregression parameters.

SigmaE

Covariance matrix of the errors (innovations).

unbalanced

A matrix with two columns, indicating the unbalances in the design. Each row represents a missing design point in the (time x individual)-layout. The first and second column indicate the time and individual (respectively) specifics of the missing design point.

diag

A logical, should the diagonal be included in the evaluation of the fit.

fileType

A character specifying the format in which figures should be save. Either 'pdf' or 'eps'.

dir

A character specifying the directory where plots should be saved.

Value

Plots are saved in the specified directory.

Author(s)

Wessel N. van Wieringen <w.vanwieringen@vumc.nl>

See Also

evaluateSfit, ridgeVAR1, dataVAR1.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
# set dimensions (p=covariates, n=individuals, T=time points)
p <- 3; n <- 4; T <- 10

# set model parameters
SigmaE <- diag(p)/4
A      <- createA(p, "chain")

# generate data
Y <- dataVAR1(n, T, A, SigmaE)

# center data
Y <- centerVAR1data(Y)

# fit VAR(1) model
VAR1hat <- ridgeVAR1(Y, 1, 1)

# evaluate fit VAR(1) model
## Not run:  evaluateVAR1fit(Y, VAR1hat$A, symm(VAR1hat$P)) 

ragt2ridges documentation built on Jan. 28, 2020, 5:08 p.m.