The ARMA functions
We provide functions for simulation and for estimation.
- acf(x,k,pt=T): computes autocovariances up to k for series x and plots
them if pt is not set to F
- pacf(cov,k,pt=T): partial autocorrelations computed to order k using
covariances in cov. These are plotted unless pt is set to F
- longpacf(x,k,pt=T): Computes partial autocorrelations to order k
using the input series. Plots unless pt is set to F
- ma(theta,n): Uses an MA(q) model to generate a series of length n, the
coefficients are in theta, viz theta<-c(0.5,0.2)
- ar(phi,n): ar simulator using ar(p) model to generate series of length
n. The ar coeffs are in phi, viz phi<-c(-0.5,0.2)
- arma(phi,theta,n):Generates a series of length n from an arma model coeffs in phi and theta
- tri(cov, i, j) :A utility function needed for corner point functions.
Needs covariances in cov
- corner(cov) : Produces a table for the corner point method. Needs at
least 36 covariances in cov.
- normcorner(cov): Produces a table for normalised corner point method.
- stepar(cov, nmax, nseries) : An ar model fitter using AIC and
innovations Computes AR model coefficients these for order nmax. Produces
innovation variance, AIC and coefficients.
- stepar2(cov, nmax, nseries): An ar model fitter using AIC computes
AIC and Innovation variances up to models of order nmax.
- kalmanf(data, n, d, phi, k) :Function which uses Kalman recursions to
generate likelihood .
- kalmanr(data, ndata, d, phi, k) :Function which uses Kalman recursions to
generate likelihood .
- kalmanq(data, n, a, bc, h, sigma, var) :Function which uses Kalman recursions to generate likelihood .
- setarma(vp): A untility function that sets up the Kalman matrices for
an ARMA model using the parameter vector vp.
- allarma (vp): A variant of setarma
- arpar(x,n,vp,iter): ARIMA(p,0,qq) estimation routine. Needs n the
length of series, vp the parameter vector containing initial values for
the parameters. P and qq must be defined previously as the AR and MA orders.
- diagnose(x,res1,st): Uses the output of arpar res1, the residuals to
produce diagnostics, st is the start of the residuals ( st-length(x)
-length(resid)+1)
- portmant(resid,a): Given residuals from time point a computes the
portmanteau statistic.
- arpar3(x, n, p, qq, vp, iter) :ARIMA(p,0,qq) estimation routine. Needs n the
length of series, vp the parameter vector containing initial values for
the parameters. P and qq must be defines previously as the AR and MA orders.
Rather more satistfactory than arpar
- arcoefff(s1,n,p,qq):users output from arpar3 to give standard
errors and t values for coeffs.Get s1 by s1<-arpar3(x, n, p, qq, vp, iter)
- twoplot(x,y1,y2):Utility fucntion which plots y1 and y2 against x
- exam(x): Examines a time series for model fitting, plots and gives
acf, pacf
- exam2(x, n, p, qq, iter): A function for fittin models and providing
diagnostics. Parameters as arpar3 .
For the code go here