SimulateAR1 {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

SimulateAR1(n, phi)

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=sqrt(1/(1-phi^2)).

Value

series of length n

Author(s)

A.I. McLeod

See Also

~~objects to See Also as help, ~~~

Examples

e<-SimulateAR1(10^4, phi=0.8)
mean(e)
sd(e)
acf(e, lag.max=5, plot=FALSE)


[Package ptest version 1.01 Index]