Skip to content

stuck with maximum likelihood problem

3 messages · Michael Larkin, Ben Bolker, Murray Jorgensen

#
Your question is pretty vague ...

  Suppose you define a function  objfun() that takes the parameter as
its first argument (for simplicity, let's say that it just uses the
values of the
data drawn from the global workspace) so that objfun(p) returns the value
you are trying to maximize.

  Then

  optim(startval,fn=objfun,control=list(fnscale=-1))

  should find the value of the parameter that maximizes the function
(by default optim() does minimization: the fnscale=-1 option makes
it do maximization instead
#
Have you considered doing the math needed to solve the score equation? 
You will need to solve a single nonlinear equation

        g(theta) = 0

If you cant do this analytically you should be able to transform it to 
the form

        theta = h(theta)

and then iterate on h or h-inverse from a suitable starting value to 
find a fixed point.

Murray Jorgensen
On 14/08/10 2:22 PM, Michael Larkin wrote: