From paradis at isem.univ-montp2.fr  Tue Feb 22 17:21:45 2005
From: paradis at isem.univ-montp2.fr (Emmanuel Paradis)
Date: Tue Feb 22 17:18:52 2005
Subject: [Rd] Re: calling optif0 in a C function
In-Reply-To: <4215F6AC.1090509@isem.univ-montp2.fr>
References: <4215F6AC.1090509@isem.univ-montp2.fr>
Message-ID: <421B5C19.8000404@isem.univ-montp2.fr>

I have solved (apparently) my problem: instead of optif0, calling optif9 
works fine. I use something like:

   optif9(*np, *np, l, (fcn_p) fcn_expo, (fcn_p) 0, (d2fcn_p) 0,
	 D, typsiz, 1, 1, 1, &msg, -1 /* = ndigit */, 1000,
	 0 /* = iagflg */, 0, -1.0, 1.e-6, 0.1, 1.e-6, xpls, fpls,
	 gpls, itrmcd, a, wrk, &itncnt);

inspired from what is in nlmefit.c from package nlme (also found in an 
older mail from Adrian Trapletti on R-devel).

It sounds that optif0 is not used anywhere in R.

EP

Emmanuel Paradis wrote:
> Dear All,
> 
> I am trying to use the function optif0 (in main/uncmin.c) from the
> latest R distribution. The reason is that I have a quite complicated
> likelihood function which is coded in C, and I would like to optimize it 
> directly.
> 
> To see how this works, I have tried with a very simple example: 
> optimizing the likelihood of a sample using an exponential distribution. 
> I have tried several solutions but none worked. I paste below the 
> functions that come the closest to what should work. The compilation is 
> fine and the call from R too. It seems that the call to optif0 does not 
> do anything whereas everything else works.


[Rd] Re: calling optif0 in a C function
Emmanuel Paradis