[R] arima.sim help
granitemathematics at gmail.com
granitemathematics at gmail.com
Tue Jan 20 22:37:16 CET 2009
I am trying to simulate time series data for an ar(1) and ma(1) process. I want the error term to have either a t distribution with 1 degree of freedom or a normal distribution with mean=0 and sd=1. Here is my code:
error.model=function(n){rnorm(n,mean=0, sd=1)}
data<-arima.sim(model=list(ar=c(0.1)), n=1000,
n.start=200, start.innov=rnorm(200,mean=0, sd=1),
rand.gen=error.model )
data
error.model=function(n){rnorm(n,mean=0, sd=1)}
data<-arima.sim(model=list(ma=c(0.1)), n=1000,
n.start=200, start.innov=rnorm(200,mean=0, sd=1),
rand.gen=error.model )
data
error.model=function(n){rt(n,1)}
data<-arima.sim(model=list(ma=c(0.1)), n=1000,
n.start=200, start.innov=rt(200,1),
rand.gen=error.model )
data
error.model=function(n){rt(n,1)}
data<-arima.sim(model=list(ar=c(0.1)), n=1000,
n.start=200, start.innov=rt(200,1),
rand.gen=error.model )
data
My question is: am I actually accomplishing my goal???
Thank you,
Neill
More information about the R-help
mailing list