I have a custom distribution and data as follows
i={42, 180, 35, 392, 63, 230, 112, 281, 42, 28, 42, 120, 148, 16, 310, 28, 68, 336, 21.5, 50, 19, 30, 12, 120, 140, 170, 17, 115, 31, 21, 52, 164, 225, 225, 151, 60, 200, 46, 210, 14};
MO = ProbabilityDistribution[{"CDF", 1 - ((\[Alpha]*E^-x)/(1 - (1 - \[Alpha])*E^-x))}, {x, 0, \[Infinity]}, Assumptions -> {\[Alpha] > 0}]
i used maximum likelihood as follow
mlmo = FindDistributionParameters[i, MO, ParameterEstimator -> "MaximumLikelihood"]
and the output was as follows
{\[Alpha] -> 4.57761*10^7}
When I used loglikelihood as follow the results was as follows
LogLikelihood[MO, {42, 180, 35, 392, 63, 230, 112, 281, 42, 28, 42, 120, 148, 16, 310, 28, 68, 336, 21.5, 50, 19, 30, 12, 120, 140, 170, 17, 115, 31, 21, 52, 164, 225, 225, 151, 60, 200, 46, 210, 14}] /. {\[Alpha] -> 4.57761*10^7}
The output was -3885.87. I used this code and wrote log likelihood manual to get parameter
bbb = Total[logpdf = (Log[PDF[MOE, i]])]
Dbal = D[bbb, \[Alpha]]
b = FindRoot[Dbal, {\[Alpha], 1}]
This the output
This is the loglikelihood
LogLikelihood[MOE, {42, 180, 35, 392, 63, 230, 112, 281, 42, 28, 42, 120, 148, 16,310, 28, 68, 336, 21.5, 50, 19, 30, 12, 120, 140, 170, 17, 115, 31, 21, 52, 164, 225, 225, 151, 60, 200, 46, 210, 14}] /. {\[Alpha] -> 2.2402116078266955`*^21}
The output is better: -3283.72 Now, what does the output mean?
MOE
the same asMO
? I assume it is. Youri
contains one inexact number, namely21.5
. Please replace it by the exact number215/10
. I assume you do that. I think the warnings appear because you evaluateE^x
for largex
such asMax[i]==392
, which generates huge (!) numbers. It seems that you can avoid the warning using something likeBlock[{$MaxExtraPrecision=1000}, FindRoot[Dbal,{\[Alpha],1}, WorkingPrecision->1000, MaxIterations->1000]]//N
. But, more generally, please check if you are on the right track, I do not know the background of this calculation. $\endgroup$