Mathematica 9 is now available
Services & Resources / Wolfram Forums
-----
 /
MathGroup Archive
2007
*January
*February
*March
*April
*May
*June
*July
*August
*September
*October
*Archive Index
*Ask about this page
*Print this page
*Give us feedback
*Sign up for the Wolfram Insider

MathGroup Archive 2007

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

Search the Archive

Re: fit a BinomialDistribution to exptl data?

  • To: mathgroup at smc.vnet.net
  • Subject: [mg80466] Re: fit a BinomialDistribution to exptl data?
  • From: dh <dh at metrohm.ch>
  • Date: Thu, 23 Aug 2007 01:04:58 -0400 (EDT)
  • References: <fagso0$8ad$1@smc.vnet.net>


Hi Gordon,

FindFit will fit functions that depend on continuous parameters. n is a 

discrete parameter. Mathematica choose to give a step function for non-integer 

n, however, FindFit will fail because small change in n will mostly not 

change the function value. Therefore, what you can do is to replace 

CDF[..] by a function that is not a step function in n, e.g.:

myFun[n_,p_,k_]:=CDF[BinomialDistribution[Floor[n],pp],k]+(CDF[BinomialDistribution[Ceiling[n],pp],k]-CDF[BinomialDistribution[Floor[n],pp],k])(n-Floor[n])

this is certainly not tuned for speed, but will make FindFit happy.

hope this helps, Daniel



Gordon Robertson wrote:

> Given a list of data values, or a list of x-y data points for  

> plotting the data as an empirical distribution function, how can I  

> fit a BinomialDistribution to the data? The help documentation for  

> FindFit shows examples in which the user indicates which function  

> should be fit (e.g. FindFit[data, a x Log[b + c x], {a, b, c}, x]),  

> and I've been unable to find an example in which a statistical  

> distribution is being fit to data. Mathematica complains when I try the  

> following with an xy list of data that specified an EDF: FindFit 

> [xyvals, CDF[BinomialDistribution[n, pp], k], {n, pp}, k].

> 

> G

> --

> Gordon Robertson

> Canada's Michael Smith Genome Sciences Centre

> Vancouver BC Canada

> 

> 




  • Prev by Date: Re: Newbie question on FindRoot and NIntergrate
  • Next by Date: Re: FWHM, InterpolationFunction & Solve
  • Previous by thread: Re: fit a BinomialDistribution to exptl data?
  • Next by thread: Re: fit a BinomialDistribution to exptl data?