i want to simulate an AR(1) process with non gaussian innovations. i tried it on the following way, but i`m not sure:
n<-25
e=rpareto(n,2,1) #can i take any distribution i want for my innovations
phi=0.2
PAR=rep(0,n)
for(t in 2:n)
{
PAR[1]<-1
PAR[t]<-phi*PAR[t-1]+e[t]
}
and another way: in the R-function arima.sim the innovations are N(0,sigma) distributed, but i want to generate N(m,sigma) innovations.
sigma<-2
mu<-10
arima.sim(n=25,model=list(order=c(1,0,0),ar=0.2), sd=sqrt(sigma))+mu
thanks for your help
Just supply the innovations as the argument innov
:
# The first problem:
e1<-rpareto(25,2,1)
arima.sim(n=25,model=list(order=c(1,0,0),ar=0.2), innov=e1)
# And the socond:
sigma<-2
mu<-10
e2<-rnorm(25,mean=mu,sd=sqrt(sigma))
arima.sim(n=25,model=list(order=c(1,0,0),ar=0.2), innov=e2)
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.