I am having a hard time to exactly name what I am looking for (I am quite sure it already exists out there...) so I'll start with a concrete example:

I have a population of discrete colours (red, green, blue, ...) of unknown distribution from which I draw a rather small sample [red, red, green, yellow] that is the basis for my simple empirical probability model.

In the end I am interested in the empirical probability p(x = red), but since my sample size is so small, I also want to know the distribution of p(x = red).

I tried bootstrapping on p(x) which is probably exactly what I want, but it is too computational expensive for my application. Given the sample size, and p(x = red) I guess there is a closed form solution to my problem...

Or maybe in other words: What is the distribution of p(x) in relation to the sample size and p(x) itself?

Background: I am building Markov Chains on sampled data. Since I can't make any assumptions about the underlying distribution, I use the empirical probability model based on the sample data. The model is built and evaluated in real time, that's why bootstrapping is no option.

update For a sample of [6x red, 6x green, 6x blue, 6x yellow] the bootstrapping of p(x = red) looks like this.

bootstrap plot


2 Answers 2


I'm not totally sure it's what you're looking forbut take a look at "Kernel density estimation".

If instead you're just looking to "name" the distribution of your data (Normal, Gamma, etc.) you could use the Distribution Fitting Tool in MatLab (since you're using it): the command for the GUI is dfittool.

  • $\begingroup$ Thanks for the hints Stefano. I assume that there is some 'real' solution to the problem, at least it seams to be a simple/common enough problem. I might end up fitting some well behaving distribution to it :D PS: It's python, I would need to reactivate Matlab... grrrmmm $\endgroup$ Apr 13, 2015 at 14:37

I found the answer in the Beta distribution. I found a little applet on the web that looked exactly like the solution for my problem. http://homepage.stat.uiowa.edu/~mbognar/applets/beta.html

The parameters alpha and beta are chosen to be a: the number of elements in the sample that I am looking for (i.e. red) and b: the number of other elements in the sample (i.e. all other colors).

a and b sum up to n, the number of elements in the sample.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.