# fdensity: Spectral density In LSTS: Locally Stationary Time Series

## Description

Returns theoretical spectral density evaluated in ARMA and ARFIMA processes.

## Usage

 1 fdensity(ar = numeric(), ma = numeric(), d = 0, sd = 1, lambda = NULL) 

## Arguments

 ar, ma AR or MA vector, respectively. If the time serie doesn't have AR (or MA) term then omit it. To more details see examples. d d is a long-memory parameter. If d is zero, then the process is ARMA(p,q) sd Noise scale factor, by default is 1. lambda λ parameter on which the spectral density is calculated/computed. If lambda=NULL then it is considered a sequence between 0 and π.

## Details

The spectral density of an ARFIMA(p,d,q) processes is

f(λ) = \frac{σ^2}{2π} \cdot \bigg(2\, \textmd{sin}(λ/2)\bigg)^{-2d} \cdot \frac{\bigg|θ\bigg(\textmd{exp}\bigg(-iλ\bigg)\bigg)\bigg|^2}{\bigg|φ\bigg(\textmd{exp}\bigg(-iλ\bigg)\bigg)\bigg|^2}

with -π ≤ λ ≤ π and -1 < d < 1/2. |x| is the Mod of x. fdensity returns the values corresponding to f(λ). When d is zero, the spectral density corresponds to an ARMA(p,q).

## Author(s)

Ricardo Olea <[email protected]>

## References

Brockwell, Peter J., and Richard A. Davis. Introduction to time series and forecasting. 2002. ISBN-13: 978-0387953519.

Palma W. Long-Memory Time Series. Theory and Methods. 1st ed. New Jersey: John Wiley & Sons, Inc.; 2007. 285 p.

## Examples

  1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 ## Example 1: Spectral Density AR(1) lambda = seq(0,pi,0.01) f = fdensity(ar = 0.5, lambda = lambda) plot(f~lambda, bty = "n", type = "l", las = 1, xlab = expression("Frequency"), ylab = expression("Spectral Density")) ## Example 2: Spectral Density AR(2) lambda = seq(0,pi,0.01) f = fdensity(ar = c(1.3,-0.6), lambda = lambda, sd=10) plot(f~lambda, bty = "n", type = "l", las = 1, xlab = expression("Frequency"), ylab = expression("Spectral Density")) ## Spectral Density ARMA(1,1) lambda = seq(0,pi,0.01) f = fdensity(ar = 0.5, ma = 0.8, lambda = lambda) plot(f~lambda, bty = "n", type = "l", las = 1, xlab = expression("Frequency"), ylab = expression("Spectral Density")) ## Spectral Density ARFIMA(1,d,1) lambda = seq(0,pi,0.01) f = fdensity(ar = 0.5, ma = 0.8, d = 0.2, lambda = lambda) plot(f~lambda, bty = "n", type = "l", las = 1, xlab = expression("Frequency"), ylab = expression("Spectral Density")) 

LSTS documentation built on May 29, 2017, 6:36 p.m.