meg_frequency
Test one seasonal frequency against a baseline model using chained MEG, returning the DCD_f likelihood ratio to classify the frequency as stochastic or deterministic.
Instructions
MEG for ONE given seasonal frequency, evaluated on the CHAINED baseline.
Unlike formal_tests (which sweeps all frequencies), this runs the MEG /
DCD_f contrast for exactly one frequency freq, ON TOP of the supplied
baseline model — its AR/AR_s, μ, interventions and the OTHER harmonics are
all kept. This is the correct chained MEG: from the baseline (e.g. harmonics
seasonal AR(1) + μ) it reformulates only f as stochastic (ifadf[freq]=1: the AR_f unit root 1−2cos(ω)B+B² for an interior f, or 1+B at the Nyquist; removes f's cos/sin harmonics; adds the free invertible MA_f testigo), then fits the free and the constrained (λ₂=−1) models and reports the DCD_f LR:
LR = 2·[logL(free) − logL(λ₂=−1)] LR > crit ⇒ witness invertible, seasonal unit root genuine ⇒ STOCHASTIC. LR ≤ crit ⇒ witness at −1, cancels the AR_f unit root ⇒ DETERMINISTIC.
The witness coef is reported as the INVERTIBLE estimate (the engine flips
|θ₂|>1 → 1/θ₂ inside the likelihood). If STOCHASTIC, adopt the form with
meg_reformulate(freq=…, base_pre_path=<this baseline>).
Parameters
inp_path : source .inp/.pre (series data; also the model if base_pre_path="") freq : the single seasonal frequency to test (1..s/2) base_pre_path : the baseline .pre (AR_s+μ+harmonics); if empty, uses inp_path
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| freq | Yes | ||
| inp_path | Yes | ||
| base_pre_path | No |