Skip to content

Dcgnorm - #1

Merged
config-i1 merged 16 commits into
masterfrom
dcgnorm
Sep 26, 2026
Merged

config-i1 merged 16 commits into
masterfrom
dcgnorm

Conversation

@config-i1

Copy link
Copy Markdown
Collaborator
  • Generalised Normal distribution
  • carima()
  • auto.carima()
  • Hannan-Rissanen estimation and candidate sweep for carima/auto.carima

config-i1 and others added 16 commits September 25, 2026 09:26
…(dcgnorm)

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01V6iwpznpavEsZmK26Xf51m
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01V6iwpznpavEsZmK26Xf51m
logLik.clm now reports df = 2*nparam (both parts of the complex variable),
so AIC and BIC use the total number of real parameters. New AICc.clm and
BICc.clm use the Bedrick & Tsai (1994) correction with two series, as in
legion. nparam and df.residual remain per series. Adds testthat tests.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01V6iwpznpavEsZmK26Xf51m
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01V6iwpznpavEsZmK26Xf51m
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01V6iwpznpavEsZmK26Xf51m
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01V6iwpznpavEsZmK26Xf51m
…lm()

dcgnorm()/rcgnorm() in scale parameterisation. clm() gets a distribution
argument; for dcgnorm the shape is estimated (or fixed via shape=) and the
scale/pseudo-scale are concentrated out in closed form. nparam counts the
shape, AICc/BICc exclude it from the per-series regressors, summary prints it.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01V6iwpznpavEsZmK26Xf51m
…x ... docs

The @PARAM ... of sigma.clm (same Rd page) overrode clm's documentation of
the ellipsis (optimiser options, FI, shape). Removed it so that clm.Rd shows
the full list.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01V6iwpznpavEsZmK26Xf51m
…dels

- fitter() negated the MA parameters together with the ARI polynomial when
  there were no regressors (likelihood correct, reported coefficients wrong).
- predict.clm() used parameters[1:0] (first element) and a column of ones
  when there was no intercept.
- iModelDesign() used x[,-FALSE], selecting no columns.
- estimator() now handles models with nothing to estimate.
Adds regression tests.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01V6iwpznpavEsZmK26Xf51m
…nterface

Arguments y, orders (vector or list), constant (FALSE/TRUE/value), arma,
model, loss, distribution, h, holdout, silent and ... passed to clm().
forecast.carima(), print.carima(), vcov.carima() (suppresses the
no-intercept warning of the refit). Tests added.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01V6iwpznpavEsZmK26Xf51m
auto.carima(): AR/MA orders selected per d via neighbourhood search
(auto.ssarima principle of selecting ARMA within each d), constant tested
at the end for the best model of each d with the search continued from
there; search="full" for all combinations. ICs on the common sample without
the first ar+i+ma observations (models estimated on the full sample).
Warm starts from the closest estimated model.

clm(): loss returns 1E+100/min|root| if the complex AR or MA polynomial has
roots inside the unit circle. Information criteria formulas moved to
clmIC(). carima() forecasting/holdout moved to carimaFinalise().

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01V6iwpznpavEsZmK26Xf51m
…dexing)

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01V6iwpznpavEsZmK26Xf51m
The CLS loss is complex-valued and cannot be minimised numerically, which
the MA terms require; before, nloptr failed with an unclear error (also in
1.0.2). Fixes the test added in the previous commit.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01V6iwpznpavEsZmK26Xf51m
fast=TRUE (besides skipping the data checks) now starts the optimiser from
Hannan-Rissanen estimates (long AR for the errors, then complex least
squares on lags of the series and of the errors), shrunk to be admissible,
and for dcgnorm from the shape maximising the likelihood of their residuals.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01V6iwpznpavEsZmK26Xf51m
Every candidate is estimated from the Hannan-Rissanen estimates (clm
fast=TRUE) and from the closest estimated model. On wind data (log Z, 4
weeks) the selected cARIMA(1,1,1) with constant reached AICc -1040.93 vs
-1034.15 with the default starts, with 55 fits instead of 61.

fast=TRUE screens all models via Hannan-Rissanen and estimates via the
likelihood the best one for each d, constant and MA order before the
neighbourhood search: about three times faster, but approximate (on the
same data it selected a model worse by 16 in AICc). Imports
stats::optimize.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01V6iwpznpavEsZmK26Xf51m
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01V6iwpznpavEsZmK26Xf51m
@config-i1
config-i1 merged commit 6f1b1de into master Sep 26, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant