# determine the probability that a value came from a distribution

Some background:

I'm trying to build a Bayesian inference model for the probability that an event has occurred based on observed data. As of now I am assuming the data is normally distributed (will check later, it will likely be Poisson).

I'm struggling to calculate values for P(E | H). The hypothesis being tested (H) is that the event has occurred. Of the observations I am gathering, I have some known values of what to expect when the event hasn't occurred, but no values for when the event has occurred.

This question has four parts:

1) Is there a generic method of returning the probability that a single observation (or perhaps a few, but not many) came from a known distribution. If there isn't a general method, is there one for normal and Poisson distributions?

2) Given a Bayesian inference model, is some form of 1-p where p is the probability as described above a good estimate of P(E | H), i.e., the probability that the data is not from the "good" distribution is 1- the probability that the event has occurred.

3) Many of the observations won't be different from the "good" distribution, but some of them will be enormously different, unfortunately some of the enormously different ones will be spurious, and some will be because the event has occurred.

4) Am I just doing this wrong, e.g., does a Bayesian model not work for this type of data, is there a better way?

If possible, code examples in R would be appreciated.

• I don't entirely understand your setup, but re: question 1, it's easy to get $p(\text{data} \mid \text{distribution})$, where $p$ is a density – that's just the likelihood. It sounds, though, like you might be asking about $p(\text{distribution} \mid \text{data})$, which is probably going to require $p(\text{distribution})$ and $p(\text{data})$.... – Dougal Aug 17 '16 at 18:01
• @Dougal, If p were probability then the first one is exactly what I'm after (albeit 1-that). Essentially I have a large set of known values for the alternate hypothesis (the event hasn't occurred), but no data for the null hypothesis (the event has occurred). – Zack Newsham Aug 17 '16 at 18:04