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.1.tar.gz (151.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

fue-0.1.1-py3-none-any.whl (79.5 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: fue-0.1.1.tar.gz
  • Upload date:
  • Size: 151.4 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.1.tar.gz
Algorithm Hash digest
SHA256 1eac755735eb5dcc96b49fd265d43aa0cf0cbe0365f5d694c0ecbfefdb0be018
MD5 e0e1ee56f814f941c52f7c1712e3cb5a
BLAKE2b-256 5ec8f7fa5156f8101a32ca566b63bcf96cb71a42e38b4e2c837fecb3bf0924e4

See more details on using hashes here.

File details

Details for the file fue-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: fue-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 79.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.3

File hashes

Hashes for fue-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 ec933b32bcfcce4a5793719a0602d53aef8066899a4370d043ccb1a1878b2a66
MD5 70acd25b29974978a40d489c8723e27c
BLAKE2b-256 60a26ba6ccb239caa520a1f214119390c8b3a5a8461c34b343bbfaebf1a5137f

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