View source: R/internal_gibbs_s3.R
plot.psd | R Documentation |
This function plots the log periodogram, log posterior median PSD, and log 90% credible region PSD. The x-axis uses angular frequency and the y-axis is plotted on the log scale. The PSD at the zero frequency is removed from the plot. If the time series is even length, the PSD at the last frequency is also removed from the plot. Function taken from bsplinePsd package.
## S3 method for class 'psd'
plot(x, legend.loc = "topright", ylog = TRUE, ...)
x |
an object of class psd |
legend.loc |
location of legend out of "topright" (default), "topleft", "bottomright", "bottomleft". If set to NA then no legend will be produced |
ylog |
logical value (default is TRUE) to determine if PSD (y-axis) should be on natural log scale |
... |
other graphical parameters from the plot.default function |
plot of the estimate of the (log) PSD
Edwards, M. C., Meyer, R., and Christensen, N. (2018), bsplinePsd: Bayesian power spectral density estimation using B-spline priors. R package
gibbs_pspline
## 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 (may take some time)
mcmc = gibbs_pspline(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 P-spline method")
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.