MathGroup Archive 2008

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

Search the Archive

Re: distribution fitting

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

On Jul 6, 7:20 am, "Youness Eaidgah" <y.eaid... at gmail.com> 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=
s
> like goodness-of-fit tests, c2 test, Kolmogorov-Smirnov test, and
> Anderson-Darling test, and finally parameter estimation. is it possible i=
n
> Mathematica? can Mathematica find the most suitable distribution for a se=
t
> 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
distribution)

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,
-Matt


  • 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