Class "ArmaSpectrum"
ArmaSpectrum-class.Rd
Objects from class "ArmaSpectrum"
spectra computed by
spectrum
.
Details
The methods for show
, print
and plot
work
analogously to those for class "Spectrum"
(which
is a super class of "ArmaSpectrum"
). In addition, print
and show
print also the parameters of the ARMA model.
Objects from the Class
Objects contain spectra produced by sarima::spectrum
(recommended), see spectrum
for details.
Objects can also be created by calls of the form
new("ArmaSpectrum", ar = , ma = , sigma2 = , ...)
,
where ar
and ma
are numeric vectors and sigma2
is
a number. sigma2
may be omitted but then only normalized
spectra can be computed. There further possibilities for the arguments
but they should be considered internal and subject to change.
Slots
All slots are inherited from class "Spectrum"
.
.Data
:Object of class
"function"
.call
:Object of class
"call"
.model
:Object of class
"ANY"
.
Examples
## spectral density of the stationary part of a fitted 'airline model'
fit0 <- arima(AirPassengers, order = c(0,1,1),
seasonal = list(order = c(0,1,1), period = 12))
sd.air <- spectrum(fit0)
show(sd.air)
#> standardized spectral density of the following ARMA(0,13) model:
#> ar coef:
#> ma coef: -0.3087 0 0 0 0 0 0 0 0 0 0 -0.1074 0.03317
#> sigma2: 135.4237
#>
#>
#>
#> Peaks:
#> freq spec period
#> [1,] 0.04330709 0.5534585 23.090909
#> [2,] 0.12992126 0.7355095 7.696970
#> [3,] 0.21259843 1.0438583 4.703704
#> [4,] 0.29527559 1.3951830 3.386667
#> [5,] 0.37795276 1.6971778 2.645833
#> [6,] 0.46062992 1.8701110 2.170940
#>
#> Troughs:
#>
#> freq spec period
#> [1,] 0.00000000 0.3436561 0.000000
#> [2,] 0.08267717 0.4023487 12.095238
#> [3,] 0.16535433 0.5631871 6.047619
#> [4,] 0.24803150 0.7843876 4.031746
#> [5,] 0.33070866 1.0084214 3.023810
#> [6,] 0.41732283 1.1732882 2.396226
#> [7,] 0.50000000 1.2314609 2.000000
#>
#> max peak/min trough:
#> 5.441809
#>
plot(sd.air, log = "y") # plot log of the spectral density
## use the "ArmaSpectrum" object as a function to evaluate the sp. density:
sd.air(seq(0, 0.5, length.out = 13))
#> [1] 0.3436561 0.5523423 0.4031278 0.7292153 0.5656073 1.0355684 0.7875585
#> [8] 1.3893145 1.0095097 1.6956676 1.1719893 1.8725407 1.2314609
sd.air(seq(0, 0.5, length.out = 13), standardize = FALSE)
#> [1] 51.56190 82.87301 60.48498 109.41090 84.86329 155.37589 118.16468
#> [8] 208.45168 151.46606 254.41666 175.84437 280.95456 184.76745
## white noise (constant spectral density)
sp.wn <- spectrum(ArmaModel(sigma2 = 2))
sp.wn
#> standardized spectral density of the following ARMA(0,0) model:
#> ar coef:
#> ma coef:
#> sigma2: 2
#>
#> constant, equal to 1 for all frequencies
print(sp.wn)
#> standardized spectral density of the following ARMA(0,0) model:
#> ar coef:
#> ma coef:
#> sigma2: 2
#>
#> constant, equal to 1 for all frequencies
print(sp.wn, standardize=FALSE)
#> spectral density of the following ARMA(0,0) model:
#> ar coef:
#> ma coef:
#> sigma2: 2
#>
#> constant, equal to 2 for all frequencies
show(sp.wn)
#> standardized spectral density of the following ARMA(0,0) model:
#> ar coef:
#> ma coef:
#> sigma2: 2
#>
#> constant, equal to 1 for all frequencies