Last data update: 2014.03.03

R: Fit ARMA(p,q) model to mean zero time series.
GetFitARMAR Documentation

Fit ARMA(p,q) model to mean zero time series.

Description

The algorithm of McLeod and Zhang (2007) is used.

Usage

GetFitARMA(y, p, q, pApprox = 30, init = 0)

Arguments

y

time series

p

AR order

q

MA order

pApprox

AR approximation

init

initial parameter estimates

Details

See McLeod and Zhang (2006).

Value

loglikelihood

value of maximized loglikelihood

phiHat

estimated phi parameters

thetaHat

estimated theta parameters

convergence

result from optim

algorithm

indicates "L-BFGS-B" or "Nelder-Mead" according as which algorithm was used in optim

Author(s)

A.I. McLeod, aimcleod@uwo.ca

References

A.I. McLeod andY. Zhang (2008), Faster ARMA maximum likelihood estimation, Computational Statistics & Data Analysis, 52-4, 2166-2176. DOI link: http://dx.doi.org/10.1016/j.csda.2007.07.020

See Also

arima, FitARMA

Examples

data(SeriesA)
z<-SeriesA-mean(SeriesA)
GetFitARMA(z, 1, 1)
w<-diff(z, differences=1)
GetFitARMA(w, 0, 1)

Results


R version 3.3.1 (2016-06-21) -- "Bug in Your Hair"
Copyright (C) 2016 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu (64-bit)

R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.

R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.

Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.

> library(FitARMA)
Loading required package: FitAR
Loading required package: lattice
Loading required package: leaps
Loading required package: ltsa
Loading required package: bestglm
> png(filename="/home/ddbj/snapshot/RGM3/R_CC/result/FitARMA/GetFitARMA.Rd_%03d_medium.png", width=480, height=480)
> ### Name: GetFitARMA
> ### Title: Fit ARMA(p,q) model to mean zero time series.
> ### Aliases: GetFitARMA
> ### Keywords: ts
> 
> ### ** Examples
> 
> data(SeriesA)
> z<-SeriesA-mean(SeriesA)
> GetFitARMA(z, 1, 1)
$loglikelihood
[1] 228.7854

$phiHat
[1] 0.9086651

$thetaHat
[1] 0.5758

$convergence
[1] 0

$algorithm
[1] "L-BFGS-B"

> w<-diff(z, differences=1)
> GetFitARMA(w, 0, 1)
$loglikelihood
[1] 224.6033

$phiHat
numeric(0)

$thetaHat
[1] 0.6993876

$convergence
[1] 0

$algorithm
[1] "L-BFGS-B"

> 
> 
> 
> 
> 
> dev.off()
null device 
          1 
>