npar.arma: Count the number of parameters in an ARIMA model...

View source: R/ARIMA-trellis.R

npar.armaR Documentation

Count the number of parameters in an ARIMA model specification.

Description

Count the number of parameters in an ARIMA model specification. When arima==FALSE, just the AR and MA parameters are counted. When arima==TRUE, then the number of difference parameters are also included.

Usage

npar.arma(x, arima=FALSE)
npar.sarma(model, arima=FALSE)
npar.rarma(arma, arima=FALSE)

Arguments

x

An "arima" object in S-Plus or a "Arima" object in R.

model

A model specification in the S-Plus style.

arma

A arma specification in the R style

arima

Logical. TRUE is number of differencings is to be counted.

Value

A scalar number giving the count.

Author(s)

Richard M. Heiberger (rmh@temple.edu)

Examples

co2.arima <-
  if.R(s=
       arima.mle(co2, list(list(order=c(0,1,1)),
                           list(order=c(0,1,1), period=12)))
       ,r=
       arima(co2, 
             order=c(0,1,1),
             seasonal=list(order=c(0,1,1), period=12))
       )

npar.arma(co2.arima)

npar.arma(co2.arima, arima=TRUE)

npar.sarma(list(list(order=c(0,1,1)),
                list(order=c(0,1,1), period=12)))

npar.sarma(list(list(order=c(0,1,1)),
                list(order=c(0,1,1), period=12)),
           arima=TRUE)

if.R(s={},
     r=npar.rarma(co2.arima$arma)
)
if.R(s={},
     r=npar.rarma(co2.arima$arma,
           arima=TRUE)
)


HH documentation built on May 29, 2024, 6:24 a.m.

Related to npar.arma in HH...