arch.univariate.GeneralizedError.loglikelihood

GeneralizedError.loglikelihood(parameters: Sequence[float] | ndarray | Series, resids: ndarray | DataFrame | Series, sigma2: ndarray | DataFrame | Series, individual: bool = False) ndarray[source]

Computes the log-likelihood of assuming residuals are have a Generalized Error Distribution, conditional on the variance.

Parameters:
parameters: Sequence[float] | ndarray | Series

Shape parameter of the GED distribution

resids: ndarray | DataFrame | Series

The residuals to use in the log-likelihood calculation

sigma2: ndarray | DataFrame | Series

Conditional variances of resids

individual: bool = False

Flag indicating whether to return the vector of individual log likelihoods (True) or the sum (False)

Returns:

ll – The log-likelihood

Return type:

float

Notes

The log-likelihood of a single data point x is

\[\ln\nu-\ln c-\ln\Gamma(\frac{1}{\nu})-(1+\frac{1}{\nu})\ln2 -\frac{1}{2}\ln\sigma^{2} -\frac{1}{2}\left|\frac{x}{c\sigma}\right|^{\nu}\]

where \(\Gamma\) is the gamma function and \(\ln c\) is

\[\ln c=\frac{1}{2}\left(\frac{-2}{\nu}\ln2+\ln\Gamma(\frac{1}{\nu}) -\ln\Gamma(\frac{3}{\nu})\right).\]