How to generate the time series from a given model? We consider a sparse autoregressive time series of length 1000 obeying the model
$$X(t)=0.2X(t-1)+0.1X(t-3)+0.2X(t-5)+0.3X(t-10)+0.1X(t-15)+Z(t)$$
with nonzero coefficients at lags 1,3,5,10 and 15,where the innovations Z(t) are i.i.d. Gaussians with mean zero and standard deviation 0.1.
The question is how to simulate 1000 time series from the model with R or SAS?
 A: In R, fill a vector with Gaussian white noise of zero mean and sd 0.1, then use the filter function. Notice that since the first 15 observations are white noise (and thence not generated by your model), you have to discard a section of your generated observations (say 10 times the maximum lag).
A: This is another way of simulating the result using arima.sim. It includes the code and some simple checks.
# Test it on a more well behaved model:
n <- 10000
n.sub <- 9000
maxlag <- 15
x <- arima.sim(n=n,list(ar=c(0,0,0,0,.5)),rand.gen=rnorm,sd=0.1)
x <- x[n-n.sub:1]
acf(x,lag.max=maxlag,type="partial")            # check!
armod <- ar(x,order.max=maxlag,method="mle")
armod       # check!
resi <- armod$resid[(1+maxlag):length(armod$resid)]
qqplot(y=resi,x=rnorm(n.sub-maxlag))          # normal residuals
qqline(resi,probs=c(.3,.7))
mean(resi)
sd(resi)                                      # distributionally proper

# For your example:
n <- 2000
n.sub <- 1000
x <- arima.sim(n=n,list(ar=c(.2,0,.1,0,.2,0,0,0,0,.3,0,0,0,0,.1)),rand.gen=rnorm,sd=0.1)
x <- x[n-n.sub:1]

