ar_psd | R Documentation |
Compute the power spectral density of an autoregressive model.
ar_psd(
a,
v = 1,
freq = 256,
fs = 1,
range = ifelse(is.numeric(a), "half", "whole"),
method = ifelse(length(freq) == 1 && bitwAnd(freq, freq - 1) == 0, "fft", "poly")
)
## S3 method for class 'ar_psd'
plot(
x,
yscale = c("linear", "log", "dB"),
xlab = NULL,
ylab = NULL,
main = NULL,
...
)
## S3 method for class 'ar_psd'
print(
x,
yscale = c("linear", "log", "dB"),
xlab = NULL,
ylab = NULL,
main = NULL,
...
)
a |
numeric vector of autoregressive model coefficients. The first element is the zero-lag coefficient, which always has a value of 1. |
v |
square of the moving average coefficient, specified as a positive scalar Default: 1 |
freq |
vector of frequencies at which power spectral density is calculated, or a scalar indicating the number of uniformly distributed frequency values at which spectral density is calculated. Default: 256. |
fs |
sampling frequency (Hz). Default: 1 |
range |
character string. one of:
Default: If model coefficients |
method |
method used to calculate the power spectral density, either
|
x |
object to plot. |
yscale |
character string specifying scaling of Y-axis; one of
|
xlab , ylab , main |
labels passed to plotting function. Default: NULL |
... |
additional arguments passed to functions |
This function calculates the power spectrum of the autoregressive model
M x(n) = sqrt(v).e(n) + SUM a(k).x(n-k) k=1
where x(n)
is the output of the model and e(n)
is white noise.
An object of class "ar_psd"
, which is a list containing two
elements, freq
and psd
containing the frequency values and
the estimates of power-spectral density, respectively.
Peter V. Lanspeary, pvl@mecheng.adelaide.edu.au.
Conversion to R by Geert van Boxtel, gjmvanboxtel@gmail.com
a <- c(1, -2.7607, 3.8106, -2.6535, 0.9238)
psd <- ar_psd(a)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.