memEstimate: memEstimate

memEstimateR Documentation

memEstimate

Description

Calculates the estimated value of the MEM-based spectral amplitude at the specified frequency or frequencies.

Usage

memEstimate(freq, .cf)

Arguments

freq

The frequency multiplied by the sample interval. For example, when using a time series sampled at 10 Hz, the Nyquist frequency is 5 Hz and this is specified by freq=5*0.1 or freq=0.5. When plotted or used to calculate variance, the sample interval must be considered unless the sample interval is 1 s. A vector of frequencies will produce a corresponding vector of spectral estimates in the output.

.cf

The list produced by a call to memCoef(). See that function for details.

Details

Uses the list provided by memCoef(), which contains the Burg-algorithm coefficient, as input. Calculates the spectral amplitude as a function of (frequency * deltaT) where deltaT is the time between samples. The variance spectrum P is then the square of the magnitude of the complex number that is returned. The result is normalized so that twice the integral over positive frequencies > 0 gives the variance; i.e., Var=2 (integral sign) P(f*deltaT) d(f*deltaT) where P is the spectral variance and f is the frequency.

Value

A possibly single-element complex vector of estimates corresponding to the specified values of freq. These are complex numbersi representing the amplitude, and the spectral estimate is usually obtained from the square of the modulus (R function mod()) of these numbers, or equivalently the product of this amplitude and its complex conjugate. The estimates are returned as complex numbers for possible use in the calculation of covariance, quadrature, coherence, and phase when multiplied by the complex conjugate of the amplitudes returned for a second variable. The amplitude is double-sided in frequency, so the estimate of spectral density should be multiplied by 2 to obtain a spectrum for the positive frequency range.

Author(s)

William Cooper

References

p. 575, Numerical Recipes in C, second edition (Press et al.), but here coded independently in R following the algorithm specified there.

Examples

ps <- 2 * Mod(memEstimate (0.25, memCoef(RAFdata[, 'TASX'])))^2


NCAR/Ranadu documentation built on Jan. 27, 2023, 1:09 a.m.