simAR1 {ptest}R Documentation

Simulate AR(1) series

Description

An AR(1) series with mean zero and variance 1 and with autocorrelation paramater phi is simulated.

Usage

simAR1(n, phi = 0.3)

Arguments

n

Length of series.

phi

Autocorrelation parameter.

Details

The model equation is: z[t] = phi*z[t-1]+a[t], where z[1] is N(0,1) and a[t] are NID(0, siga), siga=√(1/(1-phi^2)).

Value

Series of length n.

Author(s)

A.I. McLeod

References

McLeod, A.I., Yu, Hao and Krougly, Z. (2007), Algorithms for Linear Time Series Analysis: With R Package, Journal of Statistical Software 23, 5 1-26.


[Package ptest version 1.0-8 Index]