Implement least square fitting
@parrenin
Submitted by Frédéric Parrenin Link to original bug (#690045)
Description
When applying least squares technics, one tries to minimize a least squares cost function and gnumeric solver is able to do so. However, usually, one needs not only the optimal values of the parameters, but also for the confidence intervals, one needs the covariance matrix, which is the inverse of the Hessian matrix of the cost function.
This Hessian matrix is internally computed by gnumeric's solver when performing Newton iterations and a simple option to output it somewhere in the workbook would be very valuable.
I wrote a little patch (below) to output the Hessian on the command line at every Newton iteration. It is dirty but useful.
root@LGGE-PC144:/usr/local/gnumeric# diff plugins/nlsolve/gnm-nlsolve.c.orig plugins/nlsolve/gnm-nlsolve.c 318a319,321
/* Frédéric Parrenin - for Hessian outputing / int ifp,jfp; / Frédéric Parrenin - end of for Hessian outputing / 321a325,332 / Frédéric Parrenin - Hessian outputing / printf("\n"); for (ifp=0;ifp<n;ifp++) { for (jfp=0;jfp<n;jfp++) {printf("%g ",H[ifp][jfp]);} printf("\n"); } / Frédéric Parrenin - end of Hessian outputing */
Version: git master