Classes ArmaModel, ArModel and MaModel in package sarima
ArmaModel-class.Rd
Classes ArmaModel, ArModel and MaModel in package sarima.
Objects from the Class
Classes "ArModel"
and "MaModel"
are subclasses of
"ArmaModel"
with the corresponding order always zero.
The recommended way to create objects from these classes is with the
functions ArmaModel
, ArModel
and
MaModel
. Objects can also be created by calls of the
form new("ArmaModel", ..., ar, ma, mean, check)
. See also
coerce-methods
for further ways to create objects from
these classes.
Slots
center
:Object of class
"numeric"
~~intercept
:Object of class
"numeric"
~~sigma2
:Object of class
"numeric"
~~ar
:Object of class
"BJFilter"
~~ma
:Object of class
"SPFilter"
~~
Extends
Class "ArmaSpec"
, directly.
Class "VirtualArmaModel"
, directly.
Class "ArmaFilter"
, by class "ArmaSpec", distance 2.
Class "VirtualFilterModel"
, by class "VirtualArmaModel", distance 2.
Class "VirtualStationaryModel"
, by class "VirtualArmaModel", distance 2.
Class "VirtualArmaFilter"
, by class "ArmaSpec", distance 3.
Class "VirtualAutocovarianceModel"
, by class "VirtualArmaModel", distance 3.
Class "VirtualMeanModel"
, by class "VirtualArmaModel", distance 3.
Class "VirtualMonicFilter"
, by class "ArmaSpec", distance 4.
Methods
- modelOrder
signature(object = "ArmaModel", convention = "ArFilter")
: ...- modelOrder
signature(object = "ArmaModel", convention = "MaFilter")
: ...- modelOrder
signature(object = "ArmaModel", convention = "missing")
: ...- modelOrder
signature(object = "SarimaModel", convention = "ArmaModel")
: ...- sigmaSq
signature(object = "ArmaModel")
: ...
Examples
arma1p1 <- new("ArmaModel", ar = 0.5, ma = 0.9, sigma2 = 1)
autocovariances(arma1p1, maxlag = 10)
#> An object of class "Autocovariances"
#> Lag_0 Lag_1 Lag_2 Lag_3 Lag_4 Lag_5
#> 3.613333333 2.706666667 1.353333333 0.676666667 0.338333333 0.169166667
#> Lag_6 Lag_7 Lag_8 Lag_9 Lag_10
#> 0.084583333 0.042291667 0.021145833 0.010572917 0.005286458
autocorrelations(arma1p1, maxlag = 10)
#> An object of class "Autocorrelations"
#> 0 1 2 3 4 5
#> 1.000000000 0.749077491 0.374538745 0.187269373 0.093634686 0.046817343
#> 6 7 8 9 10
#> 0.023408672 0.011704336 0.005852168 0.002926084 0.001463042
partialAutocorrelations(arma1p1, maxlag = 10)
#> An object of class "PartialAutocorrelations"
#> Lag_0 Lag_1 Lag_2 Lag_3 Lag_4 Lag_5
#> 1.00000000 0.74907749 -0.42512100 0.29448975 -0.22337052 0.17832394
#> Lag_6 Lag_7 Lag_8 Lag_9 Lag_10
#> -0.14703750 0.12391932 -0.10606466 0.09181545 -0.08015626
partialAutocovariances(arma1p1, maxlag = 10)
#> An object of class "PartialAutocovariances"
#> 0 1 2 3 4 5
#> 3.61333333 1.18790975 -0.55232849 0.34942744 -0.25181673 0.19464072
#> 6 7 8 9 10
#> -0.15702172 0.13030164 -0.11027274 0.09465347 -0.08210298
new("ArmaModel", ar = 0.5, ma = 0.9, intercept = 4)
#> An object of class "ArmaModel"
#> intercept: 4
#> sigmaSq: NA
#>
#> slot "ar":
#> An object of class "BJFilter"
#> order: 1
#> Coefficients:
#> [1] 0.5
#>
#> slot "ma":
#> An object of class "SPFilter"
#> order: 1
#> Coefficients:
#> [1] 0.9
new("ArmaModel", ar = 0.5, ma = 0.9, center = 1.23)
#> An object of class "ArmaModel"
#> mean: 1.23
#> sigmaSq: NA
#>
#> slot "ar":
#> An object of class "BJFilter"
#> order: 1
#> Coefficients:
#> [1] 0.5
#>
#> slot "ma":
#> An object of class "SPFilter"
#> order: 1
#> Coefficients:
#> [1] 0.9
new("ArModel", ar = 0.5, center = 1.23)
#> An object of class "ArModel"
#> mean: 1.23
#> sigmaSq: NA
#>
#> slot "ar":
#> An object of class "BJFilter"
#> order: 1
#> Coefficients:
#> [1] 0.5
#>
#> slot "ma":
#> An object of class "SPFilter"
#> order: 0
#> Coefficients:
#> numeric(0)
new("MaModel", ma = 0.9, center = 1.23)
#> An object of class "MaModel"
#> mean: 1.23
#> sigmaSq: NA
#>
#> slot "ar":
#> An object of class "BJFilter"
#> order: 0
#> Coefficients:
#> numeric(0)
#>
#> slot "ma":
#> An object of class "SPFilter"
#> order: 1
#> Coefficients:
#> [1] 0.9
# argument 'mean' is an alias for 'center':
new("ArmaModel", ar = 0.5, ma = 0.9, mean = 1.23)
#> An object of class "ArmaModel"
#> mean: 1.23
#> sigmaSq: NA
#>
#> slot "ar":
#> An object of class "BJFilter"
#> order: 1
#> Coefficients:
#> [1] 0.5
#>
#> slot "ma":
#> An object of class "SPFilter"
#> order: 1
#> Coefficients:
#> [1] 0.9
## both center and intercept may be given
## (the mean is not equal to the intercept in this case)
new("ArmaModel", ar = 0.5, ma = 0.9, center = 1.23, intercept = 2)
#> An object of class "ArmaModel"
#> mean: 2.563333
#> intercept: 2 (full intercept: 3.845 )
#> sigmaSq: NA
#>
#> slot "ar":
#> An object of class "BJFilter"
#> order: 1
#> Coefficients:
#> [1] 0.5
#>
#> slot "ma":
#> An object of class "SPFilter"
#> order: 1
#> Coefficients:
#> [1] 0.9
## Don't use 'mean' together with 'center' and/or 'intercept'.
## new("ArmaModel", ar = 0.5, ma = 0.9, center = 1.23, mean = 4)
## new("ArmaModel", ar = 0.5, ma = 0.9, intercept = 2, mean = 4)
## Both give error message:
## Use argument 'mean' only when 'center' and 'intercept' are missing or zero