Re: [R] Integrate with an indicator function

2011-02-17 Thread li li
Hi Dennis, Thank you for your kind reply. Yes, essentially, we take integration twice. However, I still have a few questions: First, if we consider doing a double integration at the end, since the first integration in within the indicator function, it seems to be difficult. Second, m1star is

Re: [R] Integrate with an indicator function

2011-02-17 Thread Dennis Murphy
Hi Hannah: You have a few things going on, but the bottom line is that numer and denom are both double integrals. On Thu, Feb 17, 2011 at 1:06 PM, li li wrote: > Hi all, > I have some some problem with regard to finding the integral of a > function containing an indicator function. > please s

[R] Integrate with an indicator function

2011-02-17 Thread li li
Hi all, I have some some problem with regard to finding the integral of a function containing an indicator function. please see the code below: func1 <- function(x, mu){ (mu^2)*dnorm(x, mean = mu, sd = 1)*dgamma(x, shape=2)} m1star <- function(x){ integrate(func1, lower = 0, upper = Inf,x