| To: | s-news@lists.biostat.wustl.edu |
|---|---|
| Subject: | expected value of a normal variable with integrate() |
| From: | Agin.Patrick@hydro.qc.ca |
| Date: | Mon, 22 Dec 2003 16:10:11 -0500 |
|
Hi, Could anyone tell me why the two following expressions don't give the same result: integrate(function(x) x*dnorm(x),-Inf,0) equals -0.3989
I noticed that -0.3989 is the result of mean(pmin(0,tmp)), the mean of all the normal deviates with a cap of zero. If I'm interested in the expected value of all the negatives under the standard normal, the good result seems to be -0.79. Am I wrong? Why the integrate() _expression_ above doesn't give this number? Thank you,
P.S. I'm using S-Plus 4.5 on Windows XP. |
| <Prev in Thread] | Current Thread | [Next in Thread> |
|---|---|---|
| ||
| Previous by Date: | Re: symbols in graphs, christoffer . tornoe |
|---|---|
| Next by Date: | Re: expected value of a normal variable with integrate(), Sundar Dorai-Raj |
| Previous by Thread: | symbols in graphs, Christof W. Stahel |
| Next by Thread: | Re: expected value of a normal variable with integrate(), Sundar Dorai-Raj |
| Indexes: | [Date] [Thread] [Top] [All Lists] |