simAR1: AR(1) simulation

Description Usage Arguments Details Value Examples

Description

AR(1) simulation

Usage

1
simAR1(y0, n, phi, distfun = rnorm, ...)

Arguments

y0

initial value

n

numer of steps

phi

parameter of the model

distfun

a distribution function

...

parameters to the function disfun

Details

The AR(1) process is a Markov chain, in which the parts (in lack of a better word) is defined recursively;

Y_n+1=phi*Y_n+e_n+1

the e_n's are i.i.d.

Value

Returns a vector of length n, that is a simulation for an AR(1) process with the given parameters.

Examples

1
2
y<-simAR1(0, 1000, 0.8, rnorm, 1000)
x<-simAR1(10, 300, 0, rt, 300, 1.5)

AUMath-AdvancedR2018/AR1 documentation built on May 24, 2019, 7:36 a.m.