Estimate spectral density at zero
The spectral density at frequency zero is estimated by fitting a glm to
the low-frequency end of the periodogram.
estimates the variance of
spectrum0(x, max.freq = 0.5, order = 1, max.length = 200)
- A time series.
- The glm is fitted on the frequency range (0, max.freq]
- Order of the polynomial to fit to the periodogram.
- The data
xis aggregated if necessary by taking batch means so that the length of the series is less than
max.length. If this is set to
NULLno aggregation occurs.
The raw periodogram is calculated for the series
x and a generalized
linear model with family
Gamma and log link is fitted to
The linear predictor is a polynomial in terms of the frequency. The
degree of the polynomial is determined by the parameter
- A list with the following values
spec The predicted value of the spectral density at frequency zero.
The definition of the spectral density used here differs from that used by
spec.pgram. We consider the frequency range to be between 0 and 0.5,
not between 0 and
The model fitting may fail on chains with very high autocorrelation.
Heidelberger and Welch (1991) observed that the usual non-parametric estimator of the spectral density, obtained by smoothing the periodogram, is not appropriate for frequency zero. They proposed an alternative parametric method which consisted of fitting a linear model to the log periodogram of the batched time series. Some technical problems with model fitting in their original proposal can be overcome by using a generalized linear model.
Batching of the data, originally proposed in order to save space, has the side effect of flattening the spectral density and making a polynomial fit more reasonable. Fitting a polynomial of degree zero is equivalent to using the `batched means' method.
Heidelberger, P and Welch, P.D. A spectral method for confidence interval generation and run length control in simulations. Communications of the ACM, Vol 24, pp233-245, 1981.