ex <- function(n=400, beta=c(0,0,.5), alpha=c(.5,.25), sig=0, ioptw=4, M=36) # ----------------------------------------------------- # # Interpreting the phase spectrum # # ----------------------------------------------------- { k <- length(beta) z <- arima.sim(list(order(length(alpha),0,0),ar=alpha),n=n+k) fz <- filter(z,beta,sides=1) # fz = beta(B)*z(t) fz <- fz[(1+k):(n+k)] # the first k-1 are NA's fz <- fz + sig*rnorm(n) z <- z[(1+k):(n+k)] # align them coher(z,fz,ioptw,M) }