# [R] hessian in solnp

CAMARDA Carlo Giovanni c@r|o-g|ov@nn|@c@m@rd@ @end|ng |rom |ned@|r
Tue May 3 22:40:27 CEST 2022

```Thanks. Yes, there is a Lagrange multiplier (though really small for the example). However, AFAIK the hessian is the square matrix of second-order partial derivatives and, given the simple constraint in the example, the second (partial) derivatives of the lagrangian function should simplify to the second (partial) derivatives of the loss function. Or do I miss something? Moreover, I would expect smaller standard errors of the estimated parameters when additional constraints are included, and it is not the case in the given example.

De: "Ivan Krylov" <krylov.r00t using gmail.com>
À: "CAMARDA Carlo Giovanni via R-help" <r-help using r-project.org>
Cc: "Carlo Giovanni Camarda" <carlo-giovanni.camarda using ined.fr>
Envoyé: Jeudi 28 Avril 2022 06:30:00
Objet: Re: [R] hessian in solnp

В Thu, 28 Apr 2022 00:16:05 +0200 (CEST)
CAMARDA Carlo Giovanni via R-help <r-help using r-project.org> пишет:

> when a constraint is added, hessian matrix is obviously changing, but
> in a way I don't understand.

Isn't it the point of augmented Lagrange multiplier, to solve the
constrained optimisation problem by modifying the loss function and
optimising the result in an unconstrained manner? Apologies if I

Starting on
<https://github.com/cran/Rsolnp/blob/4b56bb5cd7c5d1096d1ba2f3946df7afa9af4201/R/subnp.R#L282>,
we can see how the functions are called: both the loss and the
constraint function are concatenated into the `obm` vector (if there's
no constraint, the function returns NULL, which is eaten by
concatenation), which form the vectors `g` (seems to be the gradient)
and `p`, which, in turn, form the matrix `hessv`.

My reading of the code could be wrong (and so could be my understanding
of augmented Lagrangian methods). Contacting maintainer('Rsolnp') could
be an option; maybe there's some documentation for the original MATLAB
version of the code at <https://web.stanford.edu/~yyye/Col.html>?

--
Best regards,
Ivan

[[alternative HTML version deleted]]

```