Displaying 1 result from an estimated 1 matches for "y_sampl".
Did you mean:
y_sample
2008 May 06
0
Model Based Bootstrap
...o be differentiated of order one or above and the additional MA-part?
Sample code for a series, which follows a pure AR-process:
#Series y of 192 observations, which follows an AR(1)-process
#Fit of an AR(1)-Model to y
ar.coef <- ar(y)$ar
ar.resid <- ar(y)$resid
#Sampling for mean
y_sample <- numeric(192)
y_sample[1] <- y[1]
mean_y <- numeric(10000)
for (i in 1:10000)
{
for (j in 1:191)
{
idx <- sample(2:192,1,replace=TRUE)
y_sample[j+1] <- y_sample[j]*ar.coef+ar.resid[idx]
}
mean_y[i] <- mean(y_sample)
}
What would the function...