[R] Best Way to Compute/Approximate(?) Probabilty of a Point in a Given Distribution

2009-09-04 Thread Gundala Viswanath
AFAIK, R only has pnorm which computes the probability of getting a
value smaller or equal to x from
a normal distribution N[mean,stdev]. For example:

R pnorm(0, 4, 10)
[1] 0.3446

means there is  34.46% chance of getting a value equal to or smaller
than 0 from a N(4, 10) distribution.


What I intend to get is: given the observed value x, mean, and stdev
of normal distribution,
find the probabiltiy of x falls into that distribution.

Is there any reasonable way to obtain that?

- G.V.

__
R-help@r-project.org 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.


Re: [R] Best Way to Compute/Approximate(?) Probabilty of a Point in a Given Distribution

2009-09-04 Thread Ben Bolker



Gundala Viswanath wrote:
 
 AFAIK, R only has pnorm which computes the probability of getting a
 value smaller or equal to x from
 a normal distribution N[mean,stdev]. For example:
 
 R pnorm(0, 4, 10)
 [1] 0.3446
 
 means there is  34.46% chance of getting a value equal to or smaller
 than 0 from a N(4, 10) distribution.
 
 
 What I intend to get is: given the observed value x, mean, and stdev
 of normal distribution,
 find the probabiltiy of x falls into that distribution.
 
 Is there any reasonable way to obtain that?
 
 - G.V.
 

Your question isn't entirely clear.
We could interpret it as 

1. what is the probability (density) of x being drawn
from a normal distribution with a specified mean and sd? in which case the
answer is dnorm(x,mean,sd)

or

2. what is the probability that x is drawn from N(mean,sd)
[vs. some unspecified alternative distribution]? in which case the problem
is underspecified.  If you wanted the probability that x was drawn
from D1 as opposed to D2 (where D1 and D2 are two different specified
probability
of density functions) then the Bayesian answer (assuming an equal
prior probability on the two distributions) is D1/(D1+D2).


-- 
View this message in context: 
http://www.nabble.com/Best-Way-to-Compute-Approximate%28-%29-Probabilty-of-a-Point-in-a-Given-Distribution-tp25291456p25293157.html
Sent from the R help mailing list archive at Nabble.com.

__
R-help@r-project.org 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.