Re: [R] Problem with numerical integration and optimization with BFGS

2007-05-25 Thread Ravi Varadhan
Deepankar, If the problem seems to be in the evaluation of numerical quadrature part, you might want to try quadrature methods that are better suited to integrands with strong peaks. The traditional Gaussian quadrature methods, even their adaptive versions such as Gauss-Kronrod, are not best

Re: [R] Problem with numerical integration and optimization with BFGS

2007-05-25 Thread Deepankar Basu
Ravi, Thanks a lot for your detailed suggestions. I will certainly look at the links that you have sent and the package mnormt. For the moment, I have managed to analytically integrate the expression using pnorm along the lines suggested by Prof. Ripley yesterday. For instance, my first

[R] Problem with numerical integration and optimization with BFGS

2007-05-24 Thread Deepankar Basu
Hi R users, I have a couple of questions about some problems that I am facing with regard to numerical integration and optimization of likelihood functions. Let me provide a little background information: I am trying to do maximum likelihood estimation of an econometric model that I have

Re: [R] Problem with numerical integration and optimization with BFGS

2007-05-24 Thread Ben Bolker
Deepankar Basu basu.15 at osu.edu writes: For my model, the likelihood function for each observation is the sum of three integrals. The integrand in each of these integrals is of the following form: A*exp(B+C*x-D*x^2) (where D is positive) Being very lazy, I tried Mathematica's

Re: [R] Problem with numerical integration and optimization with BFGS

2007-05-24 Thread Prof Brian Ripley
You are trying to use a derivative-based optimization method without supplying derivatives. This will use numerical approoximations to the derivatives, and your objective function will not be suitable as it is internally using adaptive numerical quadrature and hence is probably not close

Re: [R] Problem with numerical integration and optimization with BFGS

2007-05-24 Thread Deepankar Basu
Prof. Ripley, The code that I provided with my question of course does not contain code for the derivatives; but I am supplying analytical derivatives in my full program. I did not include that code with my question because that would have added about 200 more lines of code without adding any new