spec_pspline | R Documentation |
This function allows to estimate the spectrum
spec_pspline(
data,
l,
p,
eq = TRUE,
Ntotal1,
burnin1,
thin1,
Ntotal,
burnin,
thin,
tau.alpha = 0.001,
tau.beta = 0.001,
phi.alpha = 1,
phi.beta = 1,
delta.alpha = 1e-04,
delta.beta = 1e-04,
k = NULL,
eqSpacedKnots = FALSE,
degree = 3,
diffMatrixOrder = 1,
printIter = 1000,
recycl = FALSE,
likePlot = FALSE
)
data |
numeric vector |
l |
length of the data subset to be analysed |
p |
overlapping percentage of the data subsets |
eq |
if is |
Ntotal1 |
total number of iterations to run the pilot Markov chain |
burnin1 |
number of initial iterations to be discarded in the pilot mcmc run |
thin1 |
thinning number in the pilot mcmc run (post-processing) |
Ntotal |
total number of iterations to run the Markov chain |
burnin |
number of initial iterations to be discarded |
thin |
thinning number (post-processing) |
tau.alpha, tau.beta |
prior parameters for tau (Inverse-Gamma) |
phi.alpha, phi.beta |
prior parameters for phi (Gamma) |
delta.alpha, delta.beta |
prior parameters for delta (Gamma) |
k |
number of B-spline densities in the mixture |
eqSpacedKnots |
logical value indicating whether the knots are equally spaced or defined according to the periodogram |
degree |
positive integer specifying the degree of the B-spline densities (default is 3) |
diffMatrixOrder |
positive integer specifying the order of the difference penalty matrix in the P-splines (default is 2) |
printIter |
positive integer specifying the periodicity of the iteration number to be printed on screen (default 100) |
recycl |
if |
likePlot |
if |
A list with S3 class ‘psds’ containing the the power spectral estimates for the data subsets and and a list with relevant information about the analysis
gibbs_pspline
## 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);
# Spectrum estimate via p-splines (may take some time)
spec = spec_pspline(data, l=50, p=90, Ntotal1=2000, burnin1=500, thin1=5,
Ntotal=1000, burnin=500, thin=5, k=30, recycl = TRUE);
image(spec) # Plot log PSD (see documentation of image.plot.psd)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.