MathGroup Archive 2008

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: distribution fitting

  • To: mathgroup at
  • Subject: [mg90469] Re: distribution fitting
  • From: Matt.Latourette at
  • Date: Thu, 10 Jul 2008 06:35:49 -0400 (EDT)
  • References: <g4q9qf$ebq$>

On Jul 6, 7:20 am, "Youness Eaidgah" <y.eaid... at> wrote:
> Dear friends,
> I have a set of data and I want to fit a distribution on this data.I know
> that some software like Bestfit do this and also incorporate several test=
> like goodness-of-fit tests, c2 test, Kolmogorov-Smirnov test, and
> Anderson-Darling test, and finally parameter estimation. is it possible i=
> Mathematica? can Mathematica find the most suitable distribution for a se=
> of data? can it estimate the distribution parameters also? I really
> appreciate if you instruct me about this in Mathematica.
> Best regards,
> Tomas

One approach to this that I have used successfully to do this with
Mathematica is to perform maximum likelihood estimation to obtain the
parameters of the distribution that best match the data.  For example,
to obtain the parameters of data with a Rice distribution, I
constructed a maximum likelihood estimator from the Rice pdf and then
fit to the data points to get the parameters of the distribution.  (LL
is the logarithm of the likelihood function in this example and initv
and initsigma were my initial estimates of the parameters of the

LL[v_, sigma_] :=
 Sum[Log[data[[n]]/sigma^2] - (data[[n]]^2 + v^2)/(2*sigma^2) +
   Log[BesselI[0, data[[n]]*v/sigma^2]], {n, 1, Length[data]}]

finalFitResult =
 FindMinimum[{-LL[v, sigma], v >= 0,
   sigma >= 0}, {{v, initv}, {sigma, initsigma}},
  MaxIterations -> 150, Method -> InteriorPoint, AccuracyGoal -> 4,
  PrecisionGoal -> 4, WorkingPrecision -> MachinePrecision]

finalv = v /. finalFitResult[[2]];
finalsigma = sigma /. finalFitResult[[2]];

Good luck,

  • Prev by Date: Re: Multiple Executions of .nb file
  • Next by Date: Multiple Executions of .nb file part2
  • Previous by thread: Re: Re: distribution fitting
  • Next by thread: Set::setraw error