MyNixOS website logo
Description

Transfer Function and ARIMA Models.

Build customized transfer function and ARIMA models with multiple operators and parameter restrictions. Provides tools for model identification, estimation using exact or conditional maximum likelihood, diagnostic checking, automatic outlier detection, calendar effects, forecasting, and seasonal adjustment. The new version also supports unobserved component ARIMA model specification and estimation for structural time series analysis.

tfarima

CRANstatus Downloads Downloads permonth

Overview

tfarima provides a comprehensive framework for building customized Transfer Function and ARIMA models with multiple operators and parameter restrictions. The package implements exact maximum likelihood estimation and offers a wide range of tools for time series analysis.

Key Features

  • Flexible model specification: Build ARIMA and transfer function models with multiple lag polynomials and parameter restrictions
  • Model identification: Tools for identifying appropriate model structures
  • Estimation methods: Exact or conditional maximum likelihood estimation
  • Diagnostic checking: Comprehensive model validation tools
  • Automatic outlier detection: Identify and handle outliers in time series
  • Calendar effects: Model trading day, Easter, and leap year effects
  • Forecasting: Generate predictions with confidence intervals
  • Seasonal adjustment: Decompose time series into trend, seasonal, and irregular components

Installation

Install the stable version from CRAN:

install.packages("tfarima")

Or install the development version from GitHub:

# install.packages("devtools")
devtools::install_github("gallegoj/tfarima")

Quick Start

library(tfarima)

# Load example data
data(rsales)

# Build a basic ARIMA model with seasonal components
model <- um(rsales, 
            i = list(1, c(1, 12)),        # Regular and seasonal differences
            ma = list(1, c(1, 12)),       # MA(1) and seasonal MA(1)
            bc = TRUE)                     # Box-Cox transformation

# Fit the model
fitted_model <- fit(model)

# Display results
summary(fitted_model)

# Generate forecasts
predictions <- predict(fitted_model, n.ahead = 12)
plot(predictions)

# Diagnostic checking
tsdiag(fitted_model)

Main Functions

Model Building

  • um(): Build univariate ARIMA models
  • tfm(): Build transfer function models
  • lagpol(): Create lag polynomials with parameter restrictions

Model Estimation and Selection

  • fit(): Estimate model parameters using exact or conditional ML
  • outliers(): Detect and model outliers automatically
  • calendar(): Add calendar effects (trading days, Easter, leap year)

Model Evaluation

  • tsdiag(): Diagnostic checking plots
  • residuals(): Extract model residuals
  • AIC(), logLik(): Information criteria and likelihood

Forecasting and Decomposition

  • predict(): Generate forecasts
  • seasadj(): Seasonal adjustment
  • ucomp(): Unobserved components decomposition

Example: Seasonal Adjustment

# Load retail sales data
data(rsales)

# Build and fit model with calendar effects
model <- um(rsales, 
            i = list(1, c(1, 12)), 
            ma = list(1, c(1, 12)), 
            bc = TRUE)

# Add calendar effects
model_cal <- calendar(model, easter = TRUE)
fitted <- fit(model_cal)

# Perform seasonal adjustment
sa <- seasadj(fitted)

# Plot results
plot(sa)

Example: Transfer Function Model

# Load gas furnace data
data(seriesJ)

# Build transfer function model
model <- tfm(seriesJ$output, 
             inputs = list(seriesJ$input),
             orders = list(c(3, 2, 0)))

# Fit the model
fitted <- fit(model)

# Summary and diagnostics
summary(fitted)
tsdiag(fitted)

Documentation

For more detailed information and examples, see:

References

The package implements methods from:

  • Box, G.E.P., Jenkins, G.M., Reinsel, G.C. and Ljung, G.M. (2015). Time Series Analysis: Forecasting and Control. John Wiley & Sons.

  • Box, G.E.P., Pierce, D.A. and Newbold, D.A. (1987). Estimating Trend and Growth Rates in Seasonal Time Series. Journal of the American Statistical Association, 82(397), 276-282.

  • Bell, W.R. and Hillmer, S.C. (1983). Modeling Time Series with Calendar Variation. Journal of the American Statistical Association, 78(383), 526-534.

  • Chen, C. and Liu, L.M. (1993). Joint Estimation of Model Parameters and Outlier Effects in Time Series. Journal of the American Statistical Association, 88(421), 284-297.

License

GPL (>= 2)

Author

José L. Gallego

Issues and Contributions

To report bugs or request features, please visit: https://github.com/gallegoj/tfarima/issues.

Metadata

Version

0.4.1

License

Unknown

Platforms (78)

    Darwin
    FreeBSD
    Genode
    GHCJS
    Linux
    MMIXware
    NetBSD
    none
    OpenBSD
    Redox
    Solaris
    uefi
    WASI
    Windows
Show all
  • aarch64-darwin
  • aarch64-freebsd
  • aarch64-genode
  • aarch64-linux
  • aarch64-netbsd
  • aarch64-none
  • aarch64-uefi
  • aarch64-windows
  • aarch64_be-none
  • arm-none
  • armv5tel-linux
  • armv6l-linux
  • armv6l-netbsd
  • armv6l-none
  • armv7a-linux
  • armv7a-netbsd
  • armv7l-linux
  • armv7l-netbsd
  • avr-none
  • i686-cygwin
  • i686-freebsd
  • i686-genode
  • i686-linux
  • i686-netbsd
  • i686-none
  • i686-openbsd
  • i686-windows
  • javascript-ghcjs
  • loongarch64-linux
  • m68k-linux
  • m68k-netbsd
  • m68k-none
  • microblaze-linux
  • microblaze-none
  • microblazeel-linux
  • microblazeel-none
  • mips-linux
  • mips-none
  • mips64-linux
  • mips64-none
  • mips64el-linux
  • mipsel-linux
  • mipsel-netbsd
  • mmix-mmixware
  • msp430-none
  • or1k-none
  • powerpc-linux
  • powerpc-netbsd
  • powerpc-none
  • powerpc64-linux
  • powerpc64le-linux
  • powerpcle-none
  • riscv32-linux
  • riscv32-netbsd
  • riscv32-none
  • riscv64-linux
  • riscv64-netbsd
  • riscv64-none
  • rx-none
  • s390-linux
  • s390-none
  • s390x-linux
  • s390x-none
  • vc4-none
  • wasm32-wasi
  • wasm64-wasi
  • x86_64-cygwin
  • x86_64-darwin
  • x86_64-freebsd
  • x86_64-genode
  • x86_64-linux
  • x86_64-netbsd
  • x86_64-none
  • x86_64-openbsd
  • x86_64-redox
  • x86_64-solaris
  • x86_64-uefi
  • x86_64-windows