TimeSeriesAnalysis
LogLikelihood
log likelihood of a time series coming from an exponential smoothing model
Calling Sequence
Parameters
Description
Examples
References
Compatibility
LogLikelihood(model, ts, extraparameters)
model
-
Exponential smoothing model
ts
Time series consisting of a single data set
extraparameters
(optional) table of parameter values
The LogLikelihood command determines the logarithm of the likelihood of obtaining a particular time series from a given exponential smoothing model.
For models with additive errors, the value returned is the actual log likelihood: the logarithm of the product of the normal PDF, evaluated at each error value. More precisely, the value is
log⁡∏t=1N⁡ⅇ−εt22⁢σ22⁢π⁢σ=−∑t=1N⁡εt22⁢σ2−N⁢log⁡2+log⁡π+2⁢log⁡σ2
where εt is the additive error at time t, for t=1..N. Typically (if σ is not specified when defining the model)σ is optimized to maximize this value; that is, it is set to ∑t=1N⁡εt2N. With this value substituted, the likelihood becomes
−N⁢log⁡2⁢π+1+log⁡∑t=1N⁡εt2−log⁡N2
For models with multiplicative error, given a time series consisting of numbers substantially larger than 1, the absolute magnitude of the errors will be much smaller than for a model with additive errors. Conversely, given a time series consisting of numbers substantially smaller than 1, the errors will be much larger than for a model with additive errors. This happens because multiplicative errors are scaled by multiplying them by the forecast in the representation of the model. Nonetheless, we would like to compare models with additive and multiplicative errors on an equal footing. This is accomplished by including an extra term that compensates for this effect: it scales the errors back to their original sizes, by multiplying them by the geometric mean of all forecasts. In particular, the final formula for the likelihood is in this case
−N⁢log⁡2⁢π+1+log⁡∑t=1N⁡εt2⁢∏t=1N⁡ft2N−log⁡N2=−N⁢log⁡2⁢π+1+log⁡∑t=1N⁡εt2+2⁢∑t=1N⁡log⁡ftN−log⁡N2
where ft is the forecast at time t, for t=1..N.
If any of the parameters used by the model are unset, the log likelihood cannot be computed. If this is the case, a table of parameter values (such as the one generated by Initialize) can be supplied as a third argument. If a parameter occurs both in the model and in the table, the table takes precedence.
with⁡TimeSeriesAnalysis:
Consider the following time series.
ts≔TimeSeries⁡2.7,1.8,3.4,2.5,2.6,2.4,2.9,2.9,period=2
ts≔Time seriesdata set8 rows of data:2016 - 2023
We fit a model to it.
model≔ExponentialSmoothingModel⁡ts
model≔< an ETS(A,N,N) model >
The log likelihood of the time series ts arising from the model model is computed below.
LogLikelihood⁡model,ts
−4.667483693
This model has only two parameters.
NumberOfParameters⁡model
2
GetParameter⁡model,α,l0
0.00113636255264286,2.63136099750421
Let us consider an alternative parameter settings.
LogLikelihood⁡model,ts,table⁡α=0.05,l0=2
−8.562972403
This setting is substantially less likely. Now let's consider the version that optimization is initialized with.
init≔Initialize⁡ExponentialSmoothingModel⁡A,N,N,ts
init≔table⁡l0=2.65000000000000,α=12
LogLikelihood⁡model,ts,init
−6.639012833
This setting is more likely than the previous one, but less likely than the optimized one.
Hyndman, R.J. and Athanasopoulos, G. (2013) Forecasting: principles and practice. http://otexts.org/fpp/. Accessed on 2013-10-09.
Hyndman, R.J., Koehler, A.B., Ord, J.K., and Snyder, R.D. (2008) Forecasting with Exponential Smoothing: The State Space Approach. Springer Series in Statistics. Springer-Verlag Berlin Heidelberg.
The TimeSeriesAnalysis[LogLikelihood] command was introduced in Maple 18.
For more information on Maple 18 changes, see Updates in Maple 18.
See Also
Initialize
Optimize
Specialize
Download Help Document