Re: [R] Integration with an Indicator Function in R

2011-02-19 Thread Uwe Ligges
On 17.02.2011 22:10, li li wrote: 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){ int

[R] Integration with an Indicator Function in R

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)