Object Reference : Object View and Procedure Reference : Logl
Likelihood object. Used for performing maximum likelihood estimation of user-specified likelihood functions.
Logl Declaration
logl likelihood object declaration.
To declare a logl object, use the logl keyword, followed by a name to be given to the object.
Logl Method
ml maximum likelihood estimation.
Logl Views
append add line to the specification.
cellipse confidence ellipses for coefficient restrictions.
checkderivs compare user supplied and numeric derivatives.
coefcov coefficient covariance matrix.
display display table, graph, or spool in object window.
grads examine the gradients of the log likelihood.
label label view of likelihood object.
output table of estimation results.
results estimation results.
spec likelihood specification.
wald Wald coefficient restriction test.
Logl Procs
clearhist clear the contents of the history attribute.
displayname set display name.
makegrads make group containing gradients of the log likelihood.
makemodel make model.
olepush push updates to OLE linked objects in open applications .
setattr set the value of an object attribute .
updatecoefs update coefficient vector(s) from likelihood.
Logl Statements
The following statements can be included in the specification of the likelihood object. These statements are optional, except for “@logl” which is required. See “The Log Likelihood (LogL) Object” for further discussion.
@byeqn evaluate specification by equation.
@byobs evaluate specification by observation (default).
@deriv specify an analytic derivative series.
@derivstep set parameters to control step size.
@logl specify the likelihood contribution series.
@param set starting values.
@temp remove temporary working series.
Logl Data Members
Scalar Values (system data)
@aic Akaike information criterion.
@coefcov(i,j) covariance of coefficients i and j.
@coefs(i) coefficient i.
@hq Hannan-Quinn information criterion.
@linecount scalar containing the number of lines in the Logl object.
@logl value of the log likelihood function.
@ncoefs number of estimated coefficients.
@regobs number of observations used in estimation.
@sc Schwarz information criterion.
@stderrs(i) standard error for coefficient i.
@tstats(i) t-statistic value for coefficient i.
coef_name(i) i-th element of default coefficient vector for likelihood.
Vectors and Matrices
@coefcov covariance matrix of estimated parameters.
@coefs coefficient vector.
@stderrs vector of standard errors for coefficients.
@tstats vector of z-statistic values for coefficients.
String values
@attr(“arg”) string containing the value of the arg attribute, where the argument is specified as a quoted string.
@description string containing the Logl object’s description (if available).
@detailedtype returns a string with the object type: “LOGL”.
@displayname returns the Logl’s display name. If the Logl has no display name set, the name is returned.
@line(i) returns a string containing the i-th line of the Logl object.
@name returns the Logl’s name.
@smpl sample used for Logl estimation.
@svector returns an Svector where each element is a line of the Logl object.
@svectornb same as @svector, with blank lines removed.
@type returns a string with the object type: “LOGL”.
@units string containing the Logl object’s units description (if available).
@updatetime returns a string representation of the time and date at which the Logl was last updated.
Logl Examples
To declare a likelihood named LL1:
logl ll1
To define a likelihood function for OLS (not a recommended way to do OLS!):
ll1.append @logl logl1
ll1.append res1 = y-c(1)-c(2)*x
ll1.append logl1 = log(@dnorm(res1/@sqrt(c(3))))-log(c(3))/2
To estimate LL1 by maximum likelihood (the “showstart” option displays the starting values):
To save the estimated covariance matrix of the parameters from LL1 as a named matrix COV1:
matrix cov1=ll1.@coefcov