
NbbTools > Class library guide
The ILikelihood interface formalizes the likelihood function of an usual gaussian model, in its log form. More precisely, if we consider the multivariate normal distribution
,
its density equals
.
Given the vector of observations e, the log-likelihood function (depending on a set of parameters θ) is written:
The covariance matrix usually depends on a scaling factor that can be concentrated out of the likelihood. Considering
the likelihood is now:
![]()
![]()
If we factorize Σ=LDL', where L is a lower triangular matrix with 1 on its main diagonal and D is a diagonal matrix, the likelihood function can also be written:
![]()
![]()
![]()
The links between the ILikelihood interface and the Likelihood function is summarized below:
| ILikelihood Properties | Likelihood function |
| ObsCount | n |
| SsqErr |
|
| Sigma |
|
| Ser |
|
| Factor |
|
| Residuals | any vector u such that
|
It should be noted that the actual meaning of the "Residuals" property is not imposed, but it will depend on the subclasses and/or of the context. Without further information, the "SsqErr", "Sigma" and "Ser" properties must be used with caution; more precisely, they cannot always be interpreted in the usual sense (standard error of the regression, ...), because they depend on the form of the Σ matrix (partly captured by the "Factor" properties). The next versions of the library will extend the interface with a scaling factor that will provide the prediction error variance (formally, it will be the asymptotical value - if any - of the diagonal element in Σ=LDL').
The IConcentratedLikelihood interface extends the ILikelihood interface to deal with regression model. If we replace e by y-X β in the previous formulae and if we maximize the likelihood function with respect to the β parameters, we get the usual results:
![]()
![]()
These values are given by the "B" and "BVar" properties (where the scaling factor is replaced by its estimate).
The IDiffuseLikelihood interface is an extension of the ILikelihood interface designed to deal with diffuse state space models. it is documented in the Ssf framework.
The links between those interfaces and the classes that implement them are summarized by the next graph.
