[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Res: [Help-gsl] Passing data to multidim minimization routines
From: |
Paulo Jabardo |
Subject: |
Res: [Help-gsl] Passing data to multidim minimization routines |
Date: |
Fri, 29 Dec 2006 11:03:33 -0800 (PST) |
If I understand you correctly, this is easy. I've never used the
multidimensional minimization routines but the same strategy is used throughout
gsl.
To specify a function to be minimized there is the type
gsl_multimin_function_fdf or
gsl_multimin_function
In these structs, the functions are specified in fields such as
double (*f) (const gsl_vector *X, void * PARAMS)
To specify the 'constant' parameters, you should use the PARAMS field.
See this template as a simple example:
typedef struct
{
double a;
double b;
...
} MyParams;
double
fun(const gsl_vector *X, void *PARAMS)
{
MyParams *param = (MyParams *) PARAMS;
...
}
Just create a data structure with the fields you need and then coerce the
PARAMS argument to the type where you store the parameters.
I hope this helps
Paulo
----- Mensagem original ----
De: Michael Braun <address@hidden>
Para: "address@hidden" <address@hidden>
Enviadas: Sexta-feira, 29 de Dezembro de 2006 14:53:03
Assunto: [Help-gsl] Passing data to multidim minimization routines
I'm hoping that someone on this discussion list can point me in the right
direction with an issue I am having using the multidimensional minimization
routines. My objective function is a function of both parameters for which I
need to find optimizing values, as well as "data" that does not change (similar
to maximum likelihood estimation for a dataset). The gsl documentation is
clear about how to write the objective and gradient functions when the only
parameters are those that are modified by the optimization algorithm, but I
cannot find a reference or example about how to pass additional parameters or
data to that function through the optimizer.
Thanks in advance for any help you can provide.
Best wishes,
Michael Braun
MIT Sloan School of Management
address@hidden
_______________________________________________
Help-gsl mailing list
address@hidden
http://lists.gnu.org/mailman/listinfo/help-gsl
__________________________________________________
Fale com seus amigos de graça com o novo Yahoo! Messenger
http://br.messenger.yahoo.com/
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- Res: [Help-gsl] Passing data to multidim minimization routines,
Paulo Jabardo <=