Re: [R] using integrate with optimize nested in the integration

2005-07-28 Thread Huntsinger, Reid
singer, Reid; r-help@stat.math.ethz.ch Subject: RE: [R] using integrate with optimize nested in the integration Thanks for the prompt reply. Your right, that was a weak example. Consider this one though: f <- function(n,x) (x-2.5)^2*n g <- function(y) optimize(f,c(0,15), maximum=TRUE,x=

Re: [R] using integrate with optimize nested in the integration

2005-07-28 Thread Sundar Dorai-Raj
is the x-value at which the function f(x,t) (over x in (0,5)) > reaches its maximum for this fixed t. That could then be integrated. > > Reid Huntsinger > > -Original Message- > From: [EMAIL PROTECTED] > [mailto:[EMAIL PROTECTED] On Behalf Of Gregory Gentlemen > Sent: Thurs

Re: [R] using integrate with optimize nested in the integration

2005-07-28 Thread Gregory Gentlemen
h.ethz.ch Subject: [R] using integrate with optimize nested in the integration Hi guys im having a problem getting R to numerically integrate for some function, say f(bhat)*optimize(G(bhat)), over bhat. Where id like to integrate this over some finite range, so that here as we integrate over bhat opti

Re: [R] using integrate with optimize nested in the integration

2005-07-28 Thread Sundar Dorai-Raj
Gregory Gentlemen wrote: > Hi guys > im having a problem getting R to numerically integrate for some function, > say f(bhat)*optimize(G(bhat)), over bhat. Where id like to integrate this > over some finite range, so that here as we integrate over bhat optimize would > return a different optimu

Re: [R] using integrate with optimize nested in the integration

2005-07-28 Thread Huntsinger, Reid
ly 28, 2005 3:58 PM To: r-help@stat.math.ethz.ch Subject: [R] using integrate with optimize nested in the integration Hi guys im having a problem getting R to numerically integrate for some function, say f(bhat)*optimize(G(bhat)), over bhat. Where id like to integrate this over some finite ran

[R] using integrate with optimize nested in the integration

2005-07-28 Thread Gregory Gentlemen
Hi guys im having a problem getting R to numerically integrate for some function, say f(bhat)*optimize(G(bhat)), over bhat. Where id like to integrate this over some finite range, so that here as we integrate over bhat optimize would return a different optimum. For instance consider this simpl