# NOT RUN {
set.seed(12345)
# Simulate AR(4) data
n = 2 ^ 7
ar.ex = c(0.9, -0.9, 0.9, -0.9)
data = arima.sim(n, model = list(ar = ar.ex))
data = data - mean(data)
# Run MCMC with linear B-spline prior (may take some time)
mcmc = gibbs_bspline(data, 10000, 5000, degree = 1)
# Plot result
plot(mcmc)
# Plot result on original scale with title
plot(mcmc, ylog = FALSE, main = "Estimate of PSD using the linear B-spline prior")
# }
Run the code above in your browser using DataLab