I have the following code
f[a_, b_] =ProbabilityDistribution[a/b^2*(1 - (1 + x/b) E^(-(x/b)))^(a - 1)*x E^(-(x/b)), {x,
0, \[Infinity]}];
data = RandomVariate[f[13, 0.5], 25];
pars = FindDistributionParameters[data, f[a, b], {{a, 1}, {b, 1}}]
ll[a_, b_] = LogLikelihood[f[a, b] /. pars, data]
g[a_, b_] = NIntegrate[a/b^2*(1 - (1 + y/b) E^(-(y/b)))^(a - 1)*y E^(-(y/b)), {y, 0.01,
x}];
h = DistributionFitTest[data, f[13, 0.5], "HypothesisTestData"];
h["TestDataTable", All]
Plot[{g[a, b] /. pars, CDF[EmpiricalDistribution[data], x]}, {x, Min[data], Max[data]}, PlotStyle -> {Dashed, DotDashed}, PlotLegends -> {"Fitted", "Empirical"}, Exclusions -> None, AxesOrigin -> {Min[data], 0}]
Above code works fine, but I want to repeat above code fix number of times (say 100). Each time output will be different because of RandomVariate. I need such maximum likelihood parameters those maximize the LogLikelihood function (out of 100). FindMaximum may be used for this purpose. DistributionFitTest and following code should be applied only on maximum. I work on different ways but unsuccessful, please help me in this regard.