lspec model
to a time-series or a periodogram.lspec(data, period, penalty, minmass, knots, maxknots, atoms, maxatoms,
maxdim , odd = FALSE, updown = 3, silent = TRUE)data and period should be specified).
If data is specified, lspec first computes the modulus
of the fast Fourier transform
of the series using the function
(odd = TRUE) or even (odd = FALSE).
Exac-2 * loglikelihood + penalty * (number of basis
functions).
Default is to use a penalty parameter of penalty = log(lengthminmass are
included in the model. If minmass takes its default value, in
95% of the samples, when data is Gaussian white noise, the model will not
contain atoms.knots is not specified, the program starts with one knot at zero and then
employs stepwise addition of knots and atoms.maxdim and
the number of dimensions equals the number of knots plus the number of
atoms. If maxknots = 1 the fittmaxdim and
the number of dimensions equals the number of knots plus the number of
atoms. If maxatoms = 0period. If period is not specified, odd is not relevant.lspec should go through a cycle of stepwise
addition and stepwise deletion until a stable solution is reached.lspec.
The output is organized to serve as input for plot.lspec
(summary plots),
summary.lspec (summarizes fitting), clspec (for
autocorrelations and autocovariances), dlspec (for spectral density and line-spectrum,)
plspec (for the spectral distribution), and rlspec
(for random time series with the same spectrum).atom[k].length(data) or
as (2 * length(period)) when odd = FALSE or as
(2 * length(period) + 1) when odd = TRUE.lspec went through a cycle of
stepwise addition and stepwise deletion
until a stable solution was reached, or
minus the number of times that lspec went through a cycle of
stepwise addition and stepwise deletion until it decided to quit.Charles J. Stone, Mark Hansen, Charles Kooperberg, and Young K. Truong. The use of polynomial splines and their tensor products in extended linear modeling (with discussion) (1997). Annals of Statistics, 25, 1371--1470.
plot.lspec, summary.lspec, clspec, dlspec,
plspec, rlspec.data(co2)
co2.detrend <- unstrip(lm(co2~c(1:length(co2)))$residuals)
fit <- lspec(co2.detrend)Run the code above in your browser using DataLab