[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Octave-bug-tracker] [bug #57113] fminunc return wrong Hessian matrix
From: |
Giuseppe |
Subject: |
[Octave-bug-tracker] [bug #57113] fminunc return wrong Hessian matrix |
Date: |
Fri, 25 Oct 2019 04:37:03 -0400 (EDT) |
User-agent: |
Mozilla/5.0 (iPhone; CPU iPhone OS 13_1_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/13.0.1 Mobile/15E148 Safari/604.1 |
Follow-up Comment #2, bug #57113 (project octave):
Hi! I don’t need symbolic solution. I was using the maximul likelihood
method in order to estimates parameters for the pdf of experimental data and
looking at the hessian, I noted there was incorrect results. So I tried with
the paraboloid and I saw that the function return the totally incorrect
result.
I think that there are some errors in the functions for the optimization of
multi variable functions, in fact I also noted that fminsearch often diverges
despite a good starting point.
Bye!
[comment #1 comment #1:]
> Thank you for your bug report. Please note, that Octave "primarily intended
for numerical computations". It it not a computer algebra system
https://en.wikipedia.org/wiki/Computer_algebra_system. Octave uses some
adapted BFGS (a quasi-Newton) method in "fminunc" (see "edit fminunc") and
only provides approximations of the Hessian matrix.
>
>
> >> [x, fval, info, output, grad, hess] = fminunc (@(x) sum (x.^2),
ones(2,1))
> x =
>
> -0.0000000058530
> -0.0000000058530
>
> fval = 6.8516e-17
> info = 2
> output =
>
> scalar structure containing the fields:
>
> iterations = 16
> successful = 7
> funcCount = 29
>
> grad =
>
> -0.000000026607
> -0.000000026607
>
> hess =
>
> 1.50000 0.50000
> 0.50000 1.50000
>
>
> If you want to get a symbolic solution, please use the symbolic toolbox of
Octave, which does a great job for this toy problem:
>
>
> >> pkg load symbolic
> >> syms x y
> >> f(x, y) = x^2 + y^2
> f(x, y) = (symfun)
>
> 2 2
> x + y
>
> >> grad(x, y) = [diff(f, x); diff(f, y)]
> grad(x, y) = (symfun)
>
> ⎡2⋅x⎤
> ⎢ ⎥
> ⎣2⋅y⎦
>
> >> hess(x, y) = [diff(f, x, 2), diff(diff (f, x), y); diff(diff (f, y), x),
diff(f, y, 2)]
> hess(x, y) = (symfun)
>
> ⎡2 0⎤
> ⎢ ⎥
> ⎣0 2⎦
>
_______________________________________________________
Reply to this item at:
<https://savannah.gnu.org/bugs/?57113>
_______________________________________________
Message sent via Savannah
https://savannah.gnu.org/
- [Octave-bug-tracker] [bug #57113] fminunc return wrong Hessian matrix, anonymous, 2019/10/24
- [Octave-bug-tracker] [bug #57113] fminunc return wrong Hessian matrix, Kai Torben Ohlhus, 2019/10/24
- [Octave-bug-tracker] [bug #57113] fminunc return wrong Hessian matrix,
Giuseppe <=
- [Octave-bug-tracker] [bug #57113] fminunc return wrong Hessian matrix, Markus Mützel, 2019/10/28
- [Octave-bug-tracker] [bug #57113] fminunc return wrong Hessian matrix, Nir Krakauer, 2019/10/28
- [Octave-bug-tracker] [bug #57113] fminunc return wrong Hessian matrix, Giuseppe, 2019/10/28
- [Octave-bug-tracker] [bug #57113] fminunc return wrong Hessian matrix, Giuseppe, 2019/10/28
- [Octave-bug-tracker] [bug #57113] fminunc return wrong Hessian matrix, Rik, 2019/10/29
- [Octave-bug-tracker] [bug #57113] fminunc return wrong Hessian matrix, Rik, 2019/10/29
- [Octave-bug-tracker] [bug #57113] fminunc return wrong Hessian matrix, Giuseppe, 2019/10/29
- [Octave-bug-tracker] [bug #57113] fminunc return wrong Hessian matrix, Rik, 2019/10/29