# [R] Maximum likelihood with analytical Hessian and

Prof J C Nash (U30A) nashjc at uottawa.ca
Thu Dec 18 15:10:50 CET 2014

```Of the tools I know (and things change every day!), only package trust
uses the Hessian explicitly.

It would not be too difficult to include explicit Hessian by modifying
Rvmmin which is all in R -- I'm currently doing some cleanup on that, so
ask offline if you choose that route.

Given that some parameters are between 0 and 1, you could use the
hyperbolic transformation (section 11.2 of my book Nonlinear parameter
optimization using R tools) with trust, and I think I'd try that as a
first attempt. You probably need to adjust the Hessian for the
transformation carefully.

Generally the work in computing the Hessian ( # obs * (# parameters)^2
in size) is not worth the effort, but there are problems for which it
does make a lot of sense.

JN

On 14-12-18 06:00 AM, r-help-request at r-project.org wrote:
> Message: 12
> Date: Wed, 17 Dec 2014 21:46:16 +0100
> From: Xavier Robin <robin at lindinglab.org>
> To: r-help at r-project.org
> Subject: [R] Maximum likelihood with analytical Hessian and
> Message-ID: <5491EB98.6090606 at lindinglab.org>
> Content-Type: text/plain; charset=utf-8
>
> Dear list,
>
> I have an optimization problem that I would like to solve by Maximum
> Likelihood.
> I have analytical functions for the first and second derivatives of my
> parameters.
> In addition, some parameters are constrained between 0 and 1, while some
> others can vary freely between -Inf and +Inf.
>
> I am looking for an optimization function to solve this problem.
>
> I understand that the base optim function doesn't take a Hessian
> function, it only computes it numerically.
> I found the maxLik package that takes the function as a "hess" parameter
> but the maxNR method (the only one that uses the Hessian function) can't
> be bounded.
> Surprisingly I couldn't find a function doing both.
>
> Any suggestions for a function doing bounded optimization with an
> analytical Hessian function?
>
> Thanks,
> Xavier
>
>

```