Next: compfa() Up: Time Series Macros Help Previous: bandwidth   Contents


burg(Y, P [,degree:d, nfreq:Nfreq]), Y a REAL vector, P an integer > 0,
  Nfreq an integer > 0 (length of DFT used).

Keywords: spectrum analysis, frequency domain, time domain
burg(Y,P,degree:D,nfreq:Nfreq) estimates the spectrum of Y considered
as a discrete parameter AR(P) (order P autoregression) time series.

The value returned is a structure with the following components:
   phi       REAL vector of length P containing estimated AR
   var       REAL scalar containing the estimated variance of the res-
             iduals (innovations)
   spectrum  REAL vector of length Nfreq (see below) containing the
             estimated spectrum computed at frequencies 0, 1/Nfreq,
             2/Nfreq, ..., (Nfreq-1)/Nfreq cycles per Delta-t, the
             interval between observations.

Y must be a REAL vector and P an integer > 0.  The keyword phrases are
optional.  See below for the default values of D and Nfreq.

Before estimating the spectrum, Y is detrended by subtracting a degree D
polynomial in time fit by least squares.  D = 0 corresponds to
subtracting the sample mean and D < 0 directs that no detrending is
to be done, not even subtracting a mean.

Nfreq must be an integer >= nrows(Y) + P and must have no prime factors
> 29.

If degree:D is omitted, the default value for D is 0 (subtract the

If nfreq:Nfreq is omitted, the default value for Nfreq = S if S is a
positive integer variable; it is an error if S has a prime factor >

When such an S does not exist, Nfreq = smallest integer >= N + P that
has no prime factors > 29 otherwise, that is Nfreq = goodfactors(N+P),
where N = nrows(Y).

The estimated AR coefficients are computed using an algorithm due to
Burg which does not involve computing the sample autocorrelations.  The
method is sometimes called the maximum entropy method, although that can
equally well describe any method of estimating a spectrum by fitting an
autoregressive model.

See also arspectrum(), detrend(), getmacros().

Gary Oehlert 2003-01-15