This is the mail archive of the
gsl-discuss@sources.redhat.com
mailing list for the GSL project.
Re: Simulated Annealing Print function ; RE: Numerical Hessian
- From: "Anatoliy Belaygorod" <belaygorod at wustl dot edu>
- To: <gsl-discuss at sources dot redhat dot com>
- Date: Wed, 6 Oct 2004 10:23:37 -0500
- Subject: Re: Simulated Annealing Print function ; RE: Numerical Hessian
1. Well, the simulated annealing issue had a VERY simple solution - I
just had to introduce GLOBAL variables, and it took care of the print
function problem that I had, and I also managed to speed up the Energy
function by a factor of 12, because I no longer had to load the data
inside the energy function, but I used a GLOBALLY defined pointer to my
data object instead.
2. Again,
If somebody has (especially GSL-adapted) C/C++ code for NUMERICAL
HESSIAN of a high-dimensional argument-valued function (like f(x,y) =
x*y), please, respond. My problems do not have analytic expressions for
the likelihood function (but I DO have C-code of my likelihood expressed
as gsl_function type), and I really need to evaluate the Hessian at MLE.
Thank you,
Anatoliy
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
Hello, again.
Unfortunately, nobody had any comments regarding my 2 questions I posted
10 days ago: one regarding Simulated annealing print function, another
one regarding Multivariate Hessian.
I really need to get answers to these questions.
1. My co-author sent me code for one-dimensional first derivative
function:
double my_dfridr(const gsl_function *f, double x, double h, double
*err). The code he sent me is presumably state-of-the-art for one-dim
argument (based on some cited Numerical Analysis books)
It has MUCH better numerical properties than gsl_diff_central both
theoretically and in practice (he tested it and compared to GSL
routines) and it is also using gsl_function type as an argument.
I attempted to generalize it to a high-dimensional argument by writing a
GENERAL function of type
void my_dfridr_MV(const gsl_function *f, gsl_vector x, gsl_vector
gradient, double h, double *err)
However, my humble programming skills are unfortunately, not that
advanced, so after 3 days of futile attempts I was forced to take a
shortcut and use problem-specific
structure of f.params, instead of void*.
My next target is doing the same thing with Hessian, i.e. going from a
function of a scalar (he also sent me code for one-dim Hessian) to a
function of a vector.
If anyone has any thoughts/opinions/suggestions, please speak up!
Because I feel like I am re-inventing the wheel here:)... This is a
standard stuff! Gradient, Hessian!
2. As far as simulated annealing, my question still stands:
I can run it, get the results, and print them using the print function,
but I can't come up with a way of actually keeping these values and
using them in the code following the simulated annealing steps.
Please, don't tell me that I have to re-write and recompile
"gsl_siman_solve" in order to achieve that. You must have thought of
some way - but it is not documented and just don't see it.
Please, reply to both questions, or at least one!
Thanks in advance,
Anatoliy