You are on page 1of 9

Package mAr

February 20, 2015


Title Multivariate AutoRegressive analysis
Version 1.1-2
Author S. M. Barbosa
Description R functions for multivariate autoregressive analysis
Depends MASS
Maintainer S. M. Barbosa <susana.barbosa@fc.up.pt>
License GPL (>= 2)
Repository CRAN
Date/Publication 2012-10-29 08:59:08
NeedsCompilation no

R topics documented:
mAr.eig
mAr.est
mAr.pca
mAr.sim
pinkham
sparrows
waves .

.
.
.
.
.
.
.

.
.
.
.
.
.
.

.
.
.
.
.
.
.

.
.
.
.
.
.
.

.
.
.
.
.
.
.

.
.
.
.
.
.
.

.
.
.
.
.
.
.

.
.
.
.
.
.
.

.
.
.
.
.
.
.

.
.
.
.
.
.
.

.
.
.
.
.
.
.

.
.
.
.
.
.
.

.
.
.
.
.
.
.

.
.
.
.
.
.
.

.
.
.
.
.
.
.

.
.
.
.
.
.
.

.
.
.
.
.
.
.

.
.
.
.
.
.
.

.
.
.
.
.
.
.

.
.
.
.
.
.
.

.
.
.
.
.
.
.

.
.
.
.
.
.
.

.
.
.
.
.
.
.

.
.
.
.
.
.
.

.
.
.
.
.
.
.

.
.
.
.
.
.
.

.
.
.
.
.
.
.

.
.
.
.
.
.
.

.
.
.
.
.
.
.

.
.
.
.
.
.
.

.
.
.
.
.
.
.

.
.
.
.
.
.
.

Index

mAr.eig

.
.
.
.
.
.
.

.
.
.
.
.
.
.

.
.
.
.
.
.
.

.
.
.
.
.
.
.

.
.
.
.
.
.
.

.
.
.
.
.
.
.

.
.
.
.
.
.
.

.
.
.
.
.
.
.

.
.
.
.
.
.
.

.
.
.
.
.
.
.

.
.
.
.
.
.
.

1
2
4
5
6
7
7
9

Eigendecomposition of m-variate AR(p) model

Description
Eigen-decomposition of the estimated matrix of autoregressive coefficients from an m-variate AR(p)
model
1

mAr.est

Usage
mAr.eig(A, C = NULL, ...)
Arguments
A

matrix of estimated autoregression coefficients

noise covariance matrix

...

additional arguments for specific methods

Value
A list with components:
modes

periods and damping times associated to each eigenmode

eigv

m*p m-dimensional eigenvectors

Author(s)
S. M. Barbosa
References
Neumaier, A. and Schneider, T. (2001), Estimation of parameters and eigenmodes of multivariate
autoregressive models. ACM Transactions on Mathematical Software, 27, 1, 27-57.
Schneider, T. and Neumaier, A. (2001), A Matlab package fo the estimation of parameters and
eigenmodes of multivariate autoregressive models, 27, 1, 58-65.

Examples
data(pinkham)
y=mAr.est(pinkham,2,5)
mAr.eig(y$AHat,y$CHat)

mAr.est

Estimation of multivariate AR(p) model

Description
Stepwise least-squares estimation of a multivariate AR(p) model based on the algorithm of Neumaier and Schneider (2001).
Usage
mAr.est(x, p, ...)

mAr.est

Arguments
x

matrix of multivariate time series

model order

...

additional arguments for specific methods

Details
Fits by stepwise least squares an m-variate AR(p) model given by
X[t] = w + A1X[t 1] + ... + ApX[t p] + e[t]
where
X[t]=[X1(t)...Xm(t)] is a vector of length m
w is a m-length vector of intercept terms
A=[A1 ... Ap] is a mp x m matrix of autoregressive coefficients
e(t) is a m-length uncorrelated noise vector with mean 0 and m x m covariance matrix C
Value
A list with components:
SBC

Schwartz Bayesian Criterion

wHat

vector of intercept terms

AHat

matrix of estimated autoregression coefficients for the fitted model

CHat

noise covariance matrix

resid

residuals from the fitted model

Author(s)
S. M. Barbosa
References
Neumaier, A. and Schneider, T. (2001), Estimation of parameters and eigenmodes of multivariate
autoregressive models. ACM Transactions on Mathematical Software, 27, 1, 27-57.
Schneider, T. and Neumaier, A. (2001), A Matlab package fo the estimation of parameters and
eigenmodes of multivariate autoregressive models, 27, 1, 58-65.
Lutkepohl, H. (1993), Introduction to Multiple Time Series Analysis. Springer-Verlag, Berlin.
Examples
data(pinkham)
y=mAr.est(pinkham,2,5)

mAr.pca

Multivariate autoregressive analysis in PCA space

mAr.pca

Description
Estimation of m-variate AR(p) model in reduced PCA space (for dimensionality reduction) and
eigen-decomposition of augmented coefficient matrix
Usage
mAr.pca(x, p, k = dim(x)[2], ...)
Arguments
x

matrix of multivariate time series

model order

number of principal components to retain

...

additional arguments for specific methods

Value
A list with components:
p

model order

SBC
Schwartz Bayesian Criterion
fraction.variance
fraction of variance explained by the retained components
resid

residuals from the fitted model

eigv

m*p m-dimensional eigenvectors

modes

periods and damping times associated to each eigenmode

Author(s)
S. M. Barbosa
References
Neumaier, A. and Schneider, T. (2001), Estimation of parameters and eigenmodes of multivariate
autoregressive models. ACM Transactions on Mathematical Software, 27, 1, 27-57.

See Also
mAr.est

mAr.sim

Examples
data(sparrows)
A=mAr.est(sparrows,1)$AHat
mAr.eig(A)$modes
mAr.pca(sparrows,1,k=4)$modes

mAr.sim

Simulation from a multivariate AR(p) model

Description
Simulation from an m-variate AR(p) model
Usage
mAr.sim(w, A, C, N, ...)
Arguments
w

vector of intercept terms

matrix of AR coefficients

noise covariance matrix

length of output time series

...

additional arguments

Details
Simulation from an m-variate AR(p) model given by
X[t] = w + A1X[t 1] + ... + ApX[t p] + e[t]
where
X[t]=[X1(t)...Xm(t)] is a vector of length m
w is a m-length vector of intercept terms
A=[A1 ... Ap] is a m x mp matrix of autoregressive coefficients
e(t) is a m-length uncorrelated noise vector with mean 0 and m x m covariance matrix C
Value
returns a list containg the N simulated observations for each of the m time series
Author(s)
S. M. Barbosa

pinkham

References
Neumaier, A. and Schneider, T. (2001), Estimation of parameters and eigenmodes of multivariate
autoregressive models. ACM Transactions on Mathematical Software, 27, 1, 27-57.
Schneider, T. and Neumaier, A. (2001), A Matlab package fo the estimation of parameters and
eigenmodes of multivariate autoregressive models, 27, 1, 58-65.
Lutkepohl, H. (1993), Introduction to Multiple Time Series Analysis. Springer-Verlag, Berlin.
Examples
w=c(0.25,0.1)
C=rbind(c(1,0.5),c(0.5,1.5))
A=rbind(c(0.4,1.2,0.35,-0.3),c(0.3,0.7,-0.4,-0.5))
x=mAr.sim(w,A,C,N=300)

pinkham

Lydia Pinkham Annual Advertising and Sales data

Description
Annual domestic advertising and sales of Lydia E. Pinkham Medicine Company in thousands of
dollars 1907-1960
Usage
data(pinkham)
Format
A data frame with 54 observations on the 2 variables.
Source
Pankratz, A. (1991) Forecasting With Dynamic Regression Models, Wiley.

References
Wei, W. (1994) Time series analysis - univariate and multivariate methods

sparrows

sparrows

Body measurements of sparrows

Description
Body measurements of 48 female sparrows.
Usage
data(sparrows)
Format
A data frame with 48 observations on 5 variables
Source
Manly, B. F. J. (1994). Multivariate Statistical Methods, second edition, Chapman and Hall.

waves

Time series of ocean wave height measurements

Description
Ocean wave height measurements from an wire wave gauge and an infrared wave gauge
Usage
data(waves)
Format
A data frame with 4096 observations on the following 2 variables.
wire.gauge height of ocean waves from wire wave gauge
ir.gauge height of ocean waves from infrared wave gauge
Details
Time series of ocean wave height measurements (sampling = 1/ 30 seconds)
Source
Applied Physics Laboratory (Andy Jessup)

waves

References
Jessup, A. T., Melville, W. K., Keller, W. C. (1991). Breaking Waves Affecting Microwave Backscatter: Detection and Verification (1991). Journal of Geophysical Research, 96, C11, 20,54759.

Percival, D. B. (1993). Spectral Analysis of Univariate and Bivariate Time Series, Chapter 11 of
"Statistical Methods for Physical Science," Stanford, J. L. and Vardeman, S. B. (Eds), Academic
Press

Index
Topic datasets
pinkham, 6
sparrows, 7
waves, 7
Topic multivariate
mAr.eig, 1
mAr.est, 2
mAr.pca, 4
mAr.sim, 5
mAr.eig, 1
mAr.est, 2, 4
mAr.pca, 4
mAr.sim, 5
pinkham, 6
sparrows, 7
waves, 7

You might also like