Description Usage Arguments Details Value References Examples

View source: R/spectral_density.R

Returns theoretical spectral density evaluated in ARMA and ARFIMA processes.

1 |

`ar` |
(type: numeric) AR vector. If the time serie doesn't have AR term then omit it. For more details see the examples. |

`ma` |
(type: numeric) MA vector. If the time serie doesn't have MA term then omit it. For more details see the examples. |

`d` |
(type: numeric) Long-memory parameter. If d is zero, then the process is ARMA(p,q). |

`sd` |
(type: numeric) Noise scale factor, by default is 1. |

`lambda` |
(type: numeric) |

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

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

With *-π ≤ λ ≤ π* and *-1 < d < 1/2*. *|x|* is the
`Mod`

of *x*. `LSTS_sd`

returns the
values corresponding to *f(λ)*. When `d`

is zero, the spectral
density corresponds to an ARMA(p,q).

An unnamed vector of numeric class.

For more information on theoretical foundations and estimation methods see \insertRefbrockwell2002introductionLSTS \insertRefpalma2007longLSTS

1 2 3 4 5 6 7 | ```
# Spectral Density AR(1)
require(ggplot2)
f <- spectral.density(ar = 0.5, lambda = malleco)
ggplot(data.frame(x = malleco, y = f)) +
geom_line(aes(x = as.numeric(x), y = as.numeric(y))) +
labs(x = "Frequency", y = "Spectral Density") +
theme_minimal()
``` |

Embedding an R snippet on your website

Add the following code to your website.

For more information on customizing the embed code, read Embedding Snippets.