arfima-package: Simulates, fits, and predicts persistent and anti-persistent...

arfima-packageR Documentation

Simulates, fits, and predicts persistent and anti-persistent time series. arfima

Description

Simulates with arfima.sim, fits with arfima, and predicts with a method for the generic function. Plots predictions and the original time series. Has the capability to fit regressions with ARFIMA/ARIMA-FGN/ARIMA-PLA errors, as well as transfer functions/dynamic regression.

Details

Package: arfima
Type: Package
Version: 1.4-0
Date: 2017-06-20
License: MIT

A list of functions:

arfima.sim - Simulates an ARFIMA, ARIMA-FGN, or ARIMA-PLA (three classes of mixed ARIMA hyperbolic decay processes) process, with possible seasonal components.

arfima - Fits an ARIMA-HD (default single-start) model to a series, with options for regression with ARIMA-HD errors and dynamic regression (transfer functions). Allows for fixed parameters as well as choices for the optimizer to be used.

arfima0 - Simplified version of arfima

weed - Weeds out modes too close to each other in the same fit. The modes with the highest log-likelihoods are kept

print.arfima - Prints the relevant output of an arfima fitted object, such as parameter estimates, standard errors, etc.

summary.arfima - A much more detailed version of print.arfima

coef.arfima - Extracts the coefficients from a arfima object

vcov.arfima - Theoretical and observed covariance matrices of the coefficients

residuals.arfima - Extracts the residuals or regression residuals from a arfima object

fitted.arfima - Extracts the fitted values from a arfima object

tacvfARFIMA - Computes the theoretical autocovariance function of a supplied model. The model is checked for stationarity and invertibility.

iARFIMA - Computes the Fisher information matrix of all non-FGN components of the given model. Can be computed (almost) exactly or through a psi-weights approximation. The approximation takes more time.

IdentInvertQ - Checks whether the model is identifiable, stationary, and invertible. Identifiability is checked through the information matrix of all non-FGN components, as well as whether both types of fractional noise are present, both seasonally and non-seasonally.

lARFIMA and lARFIMAwTF - Computes the log-likelihood of a given model with a given series. The second admits transfer function data.

predict.arfima - Predicts from an arfima object. Capable of exact minimum mean squared error predictions even with integer d > 0 and/or integer dseas > 0. Does not include transfer function/leading indicators as of yet. Returns a predarfima object, which is composed of: predictions, and standard errors (exact and, if possible, limiting).

print.predarfima - Prints the relevant output from a predarfima object: the predictions and their standard deviations.

plot.predarfima - Plots a predarfima object. This includes the original time series, the forecasts and as default the standard 95% prediction intervals (exact and, if available, limiting).

logLik.arfima, AIC.arfima, BIC.arfima - Extracts the requested values from an arfima object

distance - Calculates the distances between the modes

removeMode - Removes a mode from a fit

tacvf - Calculates the theoretical autocovariance functions (tacvfs) from a fitted arfima object

plot.tacvf - Plots the tacvfs

print.tacvf - Prints the tacvfs

tacfplot - Plots the theoretical autocorrelation functions (tacfs) of different models on the same data

SeriesJ, tmpyr - Two datasets included with the package

Author(s)

JQ (Justin) Veenstra, A. I. McLeod

Maintainer: JQ (Justin) Veenstra <jqveenstra@gmail.com>

References

Veenstra, J.Q. Persistence and Antipersistence: Theory and Software (PhD Thesis)

Examples


set.seed(8564)
sim <- arfima.sim(1000, model = list(phi = c(0.2, 0.1), dfrac = 0.4, theta = 0.9))
fit <- arfima(sim, order = c(2, 0, 1), back=TRUE)

fit

data(tmpyr)

fit1 <- arfima(tmpyr, order = c(1, 0, 1), numeach = c(3, 3), dmean = FALSE)
fit1

plot(tacvf(fit1), maxlag = 30, tacf = TRUE)

fit2 <- arfima(tmpyr, order = c(1, 0, 0), numeach = c(3, 3), autoweed = FALSE,
dmean = FALSE)

fit2

fit2 <- weed(fit2)

fit2

tacfplot(fits = list(fit1, fit2))

fit3 <- removeMode(fit2, 2)

fit3

coef(fit2)
vcov(fit2)

fit1fgn <- arfima(tmpyr, order = c(1, 0, 1), numeach = c(3, 3),
dmean = FALSE, lmodel = "g")
fit1fgn

fit1hd <- arfima(tmpyr, order = c(1, 0, 1), numeach = c(3, 3),
dmean = FALSE, lmodel = "h")
fit1hd

data(SeriesJ)
attach(SeriesJ)

fitTF <- arfima(YJ, order= c(2, 0, 0), xreg = XJ, reglist =
list(regpar = c(1, 2, 3)), lmodel = "n", dmean = FALSE)
fitTF

detach(SeriesJ)

set.seed(4567)

sim <- arfima.sim(1000, model = list(phi = 0.3, dfrac = 0.4, dint = 1),
sigma2 = 9)

X <- matrix(rnorm(2000), ncol = 2)

simreg <- sim + crossprod(t(X), c(2, 3))

fitreg <- arfima(simreg, order = c(1, 1, 0), xreg = X)

fitreg

plot(sim)

lines(residuals(fitreg, reg = TRUE)[[1]], col = "blue")
##pretty much a perfect match.


JQVeenstra/arfima documentation built on Jan. 31, 2024, 12:11 p.m.