maxBHHH {micEcon} | R Documentation |
This function is essentially maxNR
where the hessian is
approximated by the outer product of the gradient vectro. Only suitable
for likelihood maximisation.
maxBHHH(fn, grad = NULL, hess=NULL, start, print.level = 0, iterlim = 100, ...)
fn |
log-likelihood function to be maximised, must have the
parameter vector as
the first argument and must return vector
of
observation-specific likelihood values. Those are summed for a
single likelihood value. If the parameters are out of range, fn should
return NA . |
grad |
gradient of the log-likelihood function. Must have the parameter vector as
the first argument. If NULL , numeric
gradient is used. It must return a matrix, where
rows corresponds to the gradient vectors of individual
observations. This matrix is summed over
observations in order to get a single gradient vector. It's matrix
product is used for approximation of the Hessian. |
hess |
Hessian of the function. Not used by maxBHHH , for
compatibility with maxNR . |
start |
initial values for the parameters to be optimized over. |
print.level |
a larger number prints more working information. |
iterlim |
maximum number of iterations. |
... |
further arguments for maxNR , fn and grad . |
maxBHHH
uses information equality in order to approximate the
Hessian of the log-likelihood function. Hence we have to calculate
log-likelihood
and
gradient by individual observations. Hessian is approximated as sum
of outer products of the gradients of individual observations, or, in
the matrix form, -t(gradient)
%*% gradient
.
Object of class "maximisation":
type |
Character string: "BHHH maximisation" |
Plus the other components inherited from maxNR
.
As maxBHHH
uses likelihood-specific
information equation, it is only suitable for maximising log-likelihood!
Ott Toomet otoomet@ut.ee
## ML estimation of exponential duration model: t <- rexp(100, 2) loglik <- function(theta) log(theta) - theta*t gradlik <- function(theta) 1/theta - t ## Estimate with numeric gradient and hessian a <- maxBHHH(loglik, start=1, print.level=2) summary(a) ## Estimate with analytic gradient a <- maxBHHH(loglik, gradlik, start=1) summary(a)