smooth.ES.sm
- ES.sm(**kwargs)
Fit a scale model for this fit (R:
sm.adam).A scale model is a second ADAM fitted to a transform of this model’s residuals, so the error’s scale varies over time instead of being a single number. It is scored by this model’s log-likelihood, with the scale model’s fitted values supplying the distribution’s scale at each observation – the state-space counterpart of a GARCH or GAMLSS scale equation.
The fitted scale model is returned, not attached. Assign it to
scale_modelto put it to work: that is R’simplant(), which Python does not need as a separate function.- Parameters:
model (str, optional) – Scale model specification,
"YYY"by default (select among multiplicative ETS), exactly as in R.lags – Passed to
ADAM.lagsdefaults to this model’s andconstanttoFalse.orders – Passed to
ADAM.lagsdefaults to this model’s andconstanttoFalse.constant – Passed to
ADAM.lagsdefaults to this model’s andconstanttoFalse.regressors – Passed to
ADAM.lagsdefaults to this model’s andconstanttoFalse.X – Passed to
ADAM.lagsdefaults to this model’s andconstanttoFalse.**kwargs – Any other
ADAMargument (initial,ic,bounds).
- Returns:
The fitted scale model, with
is_scale_set.- Return type:
- Raises:
ValueError – If this model was not estimated with
loss="likelihood", or if its distribution is onesm()cannot score.
Notes
Only arguments passed explicitly are forwarded, mirroring R, where the matched call means
sm()’s own defaults never reachadam()andadam()’s apply instead – so the scale model usesinitial="backcasting"unless told otherwise.Examples
>>> model = ADAM(model="MNN", lags=[1, 12], distribution="dnorm") >>> model.fit(y) >>> scale_model = model.sm() >>> model.scale_model = scale_model # R's implant() >>> forecast = model.predict(h=12, interval="prediction")
See also
scale_modelAttach a scale model to this fit.
extract_scaleThe fitted scale, per observation.
extract_sigmaThe standard deviation that scale implies.
Parent Class: ES