rar: Simulate a multivariate autoregressive time series

Description Usage Arguments Value Examples

Description

Simulate n observarions multivariate autoregressive time series, i.e.

X_t = ∑_{k=0}^p A_k X_{t-k} + \varepsilon_t,

where \varepsilon_t is a d-dimensional white noise and A_k are d \times d matrices and X_t = 0 for t ≤q 0.

Usage

1
rar(n, d = NULL, Psi = NULL, first = NULL, noise = NULL, sd = 1)

Arguments

n

number of observations to generate

d

dimension of the process

Psi

serie of regression operators (if one matrix is given it is treated as regressor with lag 1)

first

the first element of a series

noise

the noise we want to add

sd

standard deviation of the gaussian noise if the noise wasn't provided

Value

an AR series of vectors

Examples

1
2
3
4
5
6
7
nbase = 10
Psi = t((1:nbase) %*% t(sin(1:nbase * 2*pi/nbase)) / (nbase*nbase))
process = rar(30, Psi=Psi, sd=0.2)
pdf(file='simulated.arh1.pdf')
plot(process)
title("Simulated ARH(1)")
dev.off()

freqdom documentation built on May 2, 2019, 5:55 p.m.

Related to rar in freqdom...