If I input:
data = RandomVariate[ProbabilityDistribution[x/8, {x, 0, 4}], 10];
{EstimatedDistribution[data, ProbabilityDistribution[x/8, {x, 0, θ}],
ParameterEstimator -> "MaximumLikelihood"], data}
Mathematica returns:
{ProbabilityDistribution[\[FormalX]/
8, {\[FormalX], 0, 4.99291}], {3.8921, 2.93817, 2.07761, 1.12473,
3.96292, 1.20091, 2.86696, 1.52381, 2.43073, 3.13515}}
I think the mle for a sample from this distribution is the maximum of the sample. What is Mathematica computing here? In other words, why is Mathematica returning 4.99291?
From a comment:
I just now restarted Mathematica and I am getting the same bad results. I am using version 9.
ProbabilityDistribution[\[FormalX]/8, {\[FormalX], 0, 3.96292}]
. $\endgroup$Options[EstimatedDistribution, ParameterEstimator]
evaluates to{ParameterEstimator -> "MaximumLikelihood"}
, If also the case for your version, it is unnecessary to specify that option. Also, for 200 trials,And @@ Table[ data = RandomVariate[ProbabilityDistribution[x/8, {x, 0, 4}], 10]; EstimatedDistribution[data, ProbabilityDistribution[x/8, {x, 0, \[Theta]}]][[-1, -1]] == Max@data, {200}]
evaluated toTrue
. Problem must be version specific. $\endgroup$Max[data]
. But I don't know if that's possible. Even if one doesn't know that the answer isMax[data]
, one does know thattheta >= Max[data]
so the following will work:FindMaximum[{LogLikelihood[dist, data], Theta >= Max[data]}, Theta]
. $\endgroup$