This is the mail archive of the
gsl-discuss@sources.redhat.com
mailing list for the GSL project.
Re: Simulated Annealing Print function
- From: "Anatoliy Belaygorod" <belaygorod at wustl dot edu>
- To: <gsl-discuss at sources dot redhat dot com>
- Date: Thu, 30 Sep 2004 23:05:49 -0500
- Subject: Re: Simulated Annealing Print function
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
>Hello,
I am having a problem using the result of Simulated Annealing routine. The documentation, in my opinion, is not very adequate for this routine, so I am having some problems.
I gathered that the "gsl_siman_print_t" function is supposed to print out the results.
Instead of printing the ARGMIN on the screen, I want to store it in another variable for future usage in the program.
Unfortunately, just as the other 3 functions (Metric, Step, and Energy) used in "gsl_siman_solve", the print function must be written not to take any arguments (except void). So I can't think of a way to bring the ARGMIN values 'outside' the scope of the print function into the main function.
Also, because the function I am trying to maximize is a likelihood, the energy function must be a function of the data, however, for the same reason, because Energy function (just like the print function) doesn't take any arguments from outside, I have to re-load my data inside the energy function every time it evaluates it.
Please, help.
Regards,
Anatoliy