Hannah Montanna
Hannah Montanna

Reputation: 121

Maximum likelihood in uniform distribution

I have the following code:

data=load ('Q2Even');
histogram(data.y)
phat = mle(data.y,'distribution','normal') 

data is continuous. And it follows a uniform distribution when I create the histogram. I have to find maximum likelihood of variance and mean parameters. When I use mle, it gives me a row vector stating:

phat =

   26.9900    7.3849

To my knowledge, these are parameters of uniform distribution i-e mean and variance.Correct me if I'm wrong. Is there a function in matlab which could give me maximum likelihood of mean and variance?

Upvotes: 0

Views: 295

Answers (1)

Brad Day
Brad Day

Reputation: 400

You are stating that your distribution is uniform and continuous, but you have passed normal as the distribution to the MLE function. The paramater estimates you will receive will therefore be mean and standard deviation as those are the MLE parameters for a normally distributed continuous distribution. If you rerun and enter phat = mle(data.y,'distribution','unif') you will get a vector for the parameters a and b which are the lower and upper endpoints (respectively) of the distribution. Check out the documentation on the mathworks site for MLE further clarification.

Upvotes: 1

Related Questions