Calculate initial power spectral density estimates
This PSD is used as the starting point – the pilot spectrum – for the adaptive estimation routine.
pilot_spec(x, ...) ## S3 method for class 'ts' pilot_spec(x, ...) ## S3 method for class 'matrix' pilot_spec(x, x.frequency, ...) ## Default S3 method: pilot_spec( x, x.frequency = NULL, ntap = NULL, remove.AR = NULL, plot = FALSE, verbose = FALSE, fast = FALSE, ... )
x |
vector; the data series to find a pilot spectrum for |
... |
additional parameters passed to |
x.frequency |
scalar; the sampling frequency (e.g. Hz) of the series |
ntap |
scalar; the number of tapers to apply during spectrum estimation |
remove.AR |
scalar; the max AR model to be removed from the data. |
plot |
logical; should a plot be created? |
verbose |
logical; should messages be given? |
fast |
logical; use fast method in |
A fixed number
of tapers is applied across all frequencies using psdcore
, and
subsequent taper-refinements are based on the spectral derivatives
of this spectrum; hence, changes in the number of tapers can affect
how many adaptive stages may be needed (though there are no formal convergence
criteria to speak of).
The taper series of the returned spectrum is constrained using
as.tapers(..., minspan=TRUE)
.
The default behavior (remove.AR <= 0
) is to remove the standard linear
model [f(x) = α x + β] from the data; however,
the user can model the effect of an autoregressive process by specifying
remove.AR
.
Invisibly, an object with class 'spec'
, and
"pilot_psd"
in the working environment.
If remove.AR > 0
the argument is used as AR.max
in
prewhiten
, from which an AR-response spectrum is calculated using
the best fitting model.
If the value of remove.AR
is too low the spectrum
could become distorted,
so use with care.
Note, however, that the
value of remove.AR
will be restricted to within the
range [1,100].
If the AR order is much larger than this, it's unclear how prewhiten
will perform and whether the AR model is appropriate.
Note that this function does not produce a parametric spectrum estimation; rather,
it will return the amplitude response of the best-fitting AR model as spec.ar
would. Interpret these results with caution, as an AR response spectrum
can be misleading.
A.J. Barbour
## Not run: #REX library(psd) ## ## Pilot spectrum ## data(magnet) ## simply calculate the pilot spectrum with a few tapers plot(pilot_spec(xc <- magnet$clean), log="dB", main="Pilot PSDs for MAGNET and its AR-innovations (red)") ## remove the effect of an AR model # note: remove.AR -- the max AR model to be removed from the data plot(pilot_spec(xc, remove.AR=10), log="dB", add=TRUE, col="red") ## End(Not run)#REX
Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.