1
$\begingroup$

I have a ML I want to maximize in R's function optim. I am currently using the method BFGS. The optim procedure is quite slow however, and I was hoping to speed up the process by specifying the gradient function by the grad-option. Doing this, I suddenly became very confused.

I am optimizing the log-likelihood $l(x;\theta)$ for the parameters $\theta$. So is the gradient the derivative of x, $\frac{\partial l}{\partial x}$ or of the parameters $\theta$, $(\frac{\partial l}{\partial \theta_1},\dots,\frac{\partial l}{\partial \theta_k})$? The latter certainly makes more sense..

$\endgroup$

1 Answer 1

2
$\begingroup$

I assume ML really means likelihood or log-likelihood. For specifying the gradient you would want want the latter since you are maximizing over the parameter space.

To speed things up you also may want to find better initial conditions, such as with a method of moments estimator or whatever is easy to calculate for your set of parameters.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.