I have to simulate a sample of size n=1000 for the model X_t=0.9 X_{t-1}+ Z_t (Z_t) with (Zt) iid student t-distributed with 10 degrees of freedom.

I have to plot the sample ACF for the first 20 lags with the program acf in R.

I’m not the best to R but I thought that I have made a plot:

set.seed(123)

ma1_sim <- arima.sim(model = list(ma = 0.9), n = 1000, mean = 0, sd = 0.1)

acf_ma1_model <-

par(mfrow = c(3, 1))

plot(ma1_sim, type = “l”, main = “MA(1) Process: theta = 0.9”, xlab = “time”, ylab = “y(t)”)

abline(h = 0)

plot(1:20, acf_ma1_model(2:21), type = “h”, col = “blue”, ylab = “ACF”, main = “theoretical ACF”)

tmp <-

par(mfrow = c(1, 1))

Then I get the plot:

But I’m not sure that this is correct and I can’t see anywhere in my problem the value for sd so I have just set it to 0.1. Can anyone help me with the problem and maybe correct some of my code?