LogLikelihood - Maple Help
For the best experience, we recommend viewing online help using Google Chrome or Microsoft Edge.

Online Help

All Products    Maple    MapleSim


TimeSeriesAnalysis

  

LogLikelihood

  

log likelihood of a time series coming from an exponential smoothing model

 

Calling Sequence

Parameters

Description

Examples

References

Compatibility

Calling Sequence

LogLikelihood(model, ts, extraparameters)

Parameters

model

-

Exponential smoothing model

ts

-

Time series consisting of a single data set

extraparameters

-

(optional) table of parameter values

Description

• 

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

logt=1Nⅇεt22σ22πσ=t=1Nεt22σ2Nlog2+logπ+2logσ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

Nlog2π+1+logt=1Nεt2logN2

• 

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

Nlog2π+1+logt=1Nεt2t=1Nft2NlogN2=Nlog2π+1+logt=1Nεt2+2t=1NlogftNlogN2

  

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.

Examples

withTimeSeriesAnalysis:

Consider the following time series.

tsTimeSeries2.7,1.8,3.4,2.5,2.6,2.4,2.9,2.9,period=2

tsTime seriesdata set8 rows of data:2016 - 2023

(1)

We fit a model to it.

modelExponentialSmoothingModelts

model< an ETS(A,N,N) model >

(2)

The log likelihood of the time series ts arising from the model model is computed below.

LogLikelihoodmodel&comma;ts

−4.667483693

(3)

This model has only two parameters.

NumberOfParametersmodel

2

(4)

GetParametermodel&comma;α&comma;l0

0.00113636255264286&comma;2.63136099750421

(5)

Let us consider an alternative parameter settings.

LogLikelihoodmodel&comma;ts&comma;tableα=0.05&comma;l0=2

−8.562972403

(6)

This setting is substantially less likely. Now let's consider the version that optimization is initialized with.

initInitializeExponentialSmoothingModelA&comma;N&comma;N&comma;ts

inittablel0=2.65000000000000&comma;α=12

(7)

LogLikelihoodmodel&comma;ts&comma;init

−6.639012833

(8)

This setting is more likely than the previous one, but less likely than the optimized one.

References

  

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.

Compatibility

• 

The TimeSeriesAnalysis[LogLikelihood] command was introduced in Maple 18.

• 

For more information on Maple 18 changes, see Updates in Maple 18.

See Also

Exponential smoothing model

Initialize

Optimize

Specialize

TimeSeriesAnalysis