Re: [R] integration function

2011-06-26 Thread li li
Peter, Thank you very much! 2011/6/26 Peter Ehlers > On 2011-06-26 06:34, li li wrote: > >> Thank you all for the answering. >> Sorry I did not state the problem clearly. I want to take the >> integration with respect to mu, not x. >> For example, f1 should have been a function of x after integr

Re: [R] integration function

2011-06-26 Thread Peter Ehlers
On 2011-06-26 06:34, li li wrote: Thank you all for the answering. Sorry I did not state the problem clearly. I want to take the integration with respect to mu, not x. For example, f1 should have been a function of x after integrating mu out of f(x, mu) which is the following: f(x, mu)=dnorm(x, m

Re: [R] integration function

2011-06-26 Thread li li
Thank you all for the answering. Sorry I did not state the problem clearly. I want to take the integration with respect to mu, not x. For example, f1 should have been a function of x after integrating mu out of f(x, mu) which is the following: f(x, mu)=dnorm(x, mean=mu, sd=1)*dnorm(mu, mean=2, sd=1

Re: [R] integration function

2011-06-25 Thread Peter Ehlers
On 2011-06-25 08:48, li li wrote: Hi all, Can anyone please take a look at the following two functions. The answer does not seem to be right. Thank you very much! f1<- function(x) {integrand<- function (x, mu){ dnorm(x, mean=mu, sd=1)*dnorm(mu, mean=2, sd=1)

[R] integration function

2011-06-25 Thread li li
Hi all, Can anyone please take a look at the following two functions. The answer does not seem to be right. Thank you very much! f1 <- function(x) {integrand <- function (x, mu){ dnorm(x, mean=mu, sd=1)*dnorm(mu, mean=2, sd=1) } integrate(in

Re: [R] integration function

2010-03-01 Thread Uwe Ligges
On 01.03.2010 17:09, li li wrote: Hi all, I have some problem regarding the integration function. Can any one take a look at the following and give me some help? Thank you in advance! Hannah ## f0 is a function of r,x, and y f0<- function(r, x, y){ pnorm((x-sqrt(r

[R] integration function

2010-03-01 Thread li li
Hi all, I have some problem regarding the integration function. Can any one take a look at the following and give me some help? Thank you in advance! Hannah ## f0 is a function of r,x, and y f0 <- function(r, x, y){ pnorm((x-sqrt(r)*y)/sqrt(1-r), mean=0,sd=1, lower.tail=