arma_Q0gnb | R Documentation |
Compute the initial state covariance of ARMA model
arma_Q0gnb(phi, theta, tol = 2.220446e-16)
phi |
autoregression parameters. |
theta |
moving average parameters. |
tol |
tollerance. (TODO: explain) |
Experimental computation of the initial state covariance matrix of ARMA models.
The numerical results are comparable to
SSinit = "Rossignol2011"
method in arima
and
related functions.
The method seems about twice faster than "Rossignol2011" on the models
I tried but I haven't done systematic tests.
See section ‘examples’ below and, for more tests based on the
tests from stats, the tests in
test/testthat/test-arma-q0.R
.
a matrix
Georgi N. Boshnakov
gardner+harvey+phillips:1980sarima
R bug report PR#14682 (2011-2013) <URL: https://bugs.r-project.org/bugzilla3/show_bug.cgi?id=14682>.
makeARIMA
,
arima
Q0a <- arma_Q0gnb(c(0.2, 0.5), c(0.3))
Q0b <- makeARIMA(c(0.2, 0.5), c(0.3), Delta = numeric(0))$Pn
all.equal(Q0a, Q0b) ## TRUE
## see test/testthat/test-arma-q0.R for more;
## these functions cannot be defined in the package due to their use of
## \code{:::} on exported base R functions.
##
## "Gardner1980"
arma_Q0Gardner <- function(phi, theta, tol = .Machine$double.eps){
## tol is not used here
.Call(stats:::C_getQ0, phi, theta)
}
## "Rossignol2011"
arma_Q0bis <- function(phi, theta, tol = .Machine$double.eps){
.Call(stats:::C_getQ0bis, phi, theta, tol)
}
arma_Q0Gardner(c(0.2, 0.5), c(0.3))
arma_Q0bis(c(0.2, 0.5), c(0.3))
Q0a
Q0b
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.