And Mathematica says
In[2]:= 1/Sqrt[2 Pi] Integrate[Exp[-x^2/2] Sqrt[x],{x,0,Infinity}]
3
Gamma[-]
4
Out[2]= -------------
3/4
2 Sqrt[Pi]
(I suppose there's probably a change-of-variables trick to do this ...)
in R:
> gamma(3/4)/(2^(3/4)*sqrt(pi))
[1] 0.4110895
Ravi Varadhan wrote:
> Chuck showed how to do this:
>
> fn <- function(x) sqrt(x) * dnorm(x)
>
>> integrate(fn, 0, Inf)
> 0.4110895 with absolute error < 4.7e-05
>
> So the (almost) exact answer is 0.4110895 + 1i * 0.4110895
>
______________________________________________
[email protected] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.