# Fitting an exponential distribution to data and finding third quartile problem

I have a data-set with range of 0 to 1. I'm fitting a distribution to it in MATLAB using fitdist(Data_set, 'exponential'). I want find third quartile with log(4)/λ . When I calculate this, the result is 4.28738As i mentioned my data set range is between 0 and 1. why this value is bigger than maximum of my data range? How can i solve this problem? I think this is from tail o exponential distribution.

I have a data-set with range of 0 to 1.

The exponential distribution seems not to be the right model since this distribution has support on the positive real line. This is, you are fitting a model that assigns positive probability to sets of values that are unreasonable in your context.

The most popular distributions with support on $(0,1)$ are the Beta distribution and the Kumaraswamy distribution. If you fit one of these, then you will get a quartile in the right range.

http://en.wikipedia.org/wiki/Beta_distribution

http://en.wikipedia.org/wiki/Kumaraswamy_distribution

fitdist(Data_set, 'Beta')
betainv(P,A,B)

• Thank you for answer. I searched for quartiles of beta distribution but i didn't find something like exponential distribution. How can I calculate quartiles using a and b parameters of beta distribution? Aug 28, 2014 at 21:54
• @user2991243 For the beta distribution the quantile function is, unfortunately, not available in closed-form. However, you can approximate it numerically using MATLAB. Aug 28, 2014 at 21:57
• How can I run this code? I think this isn't for MATLAB ! thanks. Aug 28, 2014 at 21:59
• @user2991243 I think I just found it: it is betainv. Aug 28, 2014 at 22:06
• Can you prepare some sample code for using it in your main answer? thanks. Aug 28, 2014 at 22:07