postprocess | R Documentation |
This function allows to discard a specified number of samples as burn-in period and apply thinning factor to a psd
object.
postprocess(x, burnin, thin = 1)
x |
a psd object |
burnin |
number of initial iterations to be discarded |
thin |
thinning number (post-processing) |
A list with S3 class ‘psd’ containing the following updated components:
psd.median,psd.mean |
psd estimates: (pointwise) posterior median and mean |
psd.p05,psd.p95 |
90% pointwise credibility interval |
psd.u05,psd.u95 |
90% uniform credibility interval |
fpsd.sample |
posterior power spectral density estimates |
tau,phi,delta,V |
posterior traces of model parameters |
ll.trace |
trace of log likelihood |
DIC |
deviance information criterion |
count |
acceptance probabilities for the weigths |
plot.psd
## Not run:
set.seed(1)
# Generate AR(1) data with rho = 0.9
n = 128;
data = arima.sim(n, model = list(ar = 0.9));
data = data - mean(data);
# Run MCMC (may take some time)
mcmc = gibbs_pspline(data, 5000, 0);
mcmc = postprocess(mcmc, burnin = 500, thin = 10);
require(beyondWhittle) # For psd_arma() function
freq = 2 * pi / n * (1:(n / 2 + 1) - 1)[-c(1, n / 2 + 1)] # Remove first and last frequency
psd.true = psd_arma(freq, ar = 0.9, ma = numeric(0), sigma2 = 1) # True PSD
plot(mcmc) # Plot log PSD (see documentation of plot.psd)
lines(freq, log(psd.true), col = 2, lty = 3, lwd = 2) # Overlay true PSD
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.