Skip to main content

Exact maximum likelihood estimation of univariate time series (ARMAX with transfer functions)

Project description

fue — Exact Maximum Likelihood for Univariate Time Series

fue is a Python implementation of the FUE/FUF estimation engine originally written in C by Arthur B. Treadway and David E. Guerrero, based on the algorithms designed and coded by José Alberto Mauricio. It fits ARMAX models with linear transfer-function interventions by exact maximum likelihood using the Ansley (1979) innovations form and the Mauricio (1997, AS 311) / Mauricio (1995, JASA) algorithms.

Features

  • Exact ML estimation of ARIMA/SARIMA/ARMAX models (Box–Jenkins family)
  • Seasonal and non-seasonal AR/MA operators; regular and seasonal differencing
  • Linear transfer function interventions: impulse, step, ramp, Fourier harmonics, alternator, and arbitrary user-defined regressors
  • Fixed-frequency AR/MA factors (AR(2) with constrained spectral peak)
  • Box–Cox transformation with automatic back-transformation of forecasts
  • Multi-step forecasts with asymptotic prediction intervals
  • ASCII .out and .pre report output compatible with the C FUE binary
  • HTML forecast reports (requires jinja2)
  • CLI tools fue and fuf mirroring the C binaries

Installation

pip install fue                  # pure Python (numpy + scipy + matplotlib)
pip install "fue[report]"        # + HTML forecast reports (jinja2)
pip install "fue[pdf]"           # + PDF export (weasyprint)

Python 3.10+ required.

Quick start

import numpy as np
import fue

# Build a time series
data = np.array([...])   # monthly observations
ts = fue.TimeSeries(data, freq=12, start=(2002, 1), name="CPI")

# Specify an ARIMA(1,1,0)(1,0,0)_12 model with a log transform
m = fue.Model(ts,
              ar=[[0.3]],          # AR(1), initial value 0.3
              sar=[[0.2]],         # seasonal AR(1) at lag 12
              d=1,                 # one regular difference
              boxlam=0.0,          # log transform (Box–Cox λ=0)
              refactor=100.0)

result = m.fit()
print(result.sigma2, result.aic)
m.plot_residuals()

Load from a .inp file (fue format)

ts, m = fue.load("model.inp")
result = m.fit()
m.write_out("model.out")
m.write_pre("model.pre")

Forecast from a pre-estimated .inp file (fuf format)

ts, m = fue.load_fuf("forecast_model.inp")
fr = m.forecast_fuf(horizon=24)
print(fr.level)          # point forecasts in original units
print(fr.level_std)      # forecast standard deviations

Command-line interface

# Estimate a model and write .out / .pre
fue model_name [eml|aml] [chk|nochk] [-f horizon]

# Generate forecasts from a pre-estimated .inp file
fuf forecast_model

Numerical methods

Algorithm Reference Used for
Ansley (1979) innovations form Mauricio (1997) AS 311 Exact log-likelihood (elf_scalar)
Kalman filter (quick recursions) Mélard (1984) AS 197 Inner BFGS loop (flikam_scalar)
BFGS with Cholesky factor update Dennis & Schnabel (1983) ch. 9 Optimization (raxopt)
Scaled objective Π(x)/Π₀ Mauricio (1995) JASA §3 Numerical conditioning

Authors and licence

fue is developed by Arthur B. Treadway and David E. Guerrero, based on the algorithms designed and coded by José Alberto Mauricio.

Released under the GNU General Public Licence v2.0 or later (GPL-2.0-or-later). See COPYING for the full licence text.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

fue-0.1.4.tar.gz (153.0 kB view details)

Uploaded Source

File details

Details for the file fue-0.1.4.tar.gz.

File metadata

  • Download URL: fue-0.1.4.tar.gz
  • Upload date:
  • Size: 153.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.3

File hashes

Hashes for fue-0.1.4.tar.gz
Algorithm Hash digest
SHA256 27c9e8a92682ea120849fba642fcd372f2e6877d812c53b1fa329a6fa634ce30
MD5 3edf81579cafde15bcc56026efeebcd8
BLAKE2b-256 59b329029d03ca46ebc8fc4183d1688e3ee2eaf040728dc79683a3fbc6c4a467

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page