KNOWLEDGEBASE - ARTICLE #1212

How can I fit a cumulative Gaussian distribution? How about a two-component cumulative Gaussian.

Prism 5 single component

Look in the  Gaussian folder of equations. You'll find three versions of the cumulative Gaussian distribution -- one for data expressed as percents, one for fractions, and one for counts.

Prism 5, sum of two Gaussians

The needed equation is not built in, but it is easy to create. Enter this equation, as a user-defined equation, to fit or simulate a cumulative sum of two Gaussian curves. This equation maxes out at Y=100, which is the top of a cumulative distribution in percents. Change to 1.0 for fractions, or to the number of values if you want the curve to show the actual count. The parameter f is the fraction of all the values that belong to the population with mean1 and SD1. The remainder of the values belong to a population with mean2 and SD2. In the graph below, f was set to 0.3; the first population had a mean of 10 and SD of 1; and the second population had a mean of 15 and a SD of 1.0.

 

Top=100
z1=(X-Mean1)/SD1
z2=(X-Mean2)/SD2
Y= Top *(f*zdist(z1) + (1-f)*zdist(z2))
 
 
Prism 4

The zdist() distribution was new to Prism 5. You can get the same effect using the equation below.

If you fit your data with a cumulative frequency distribution, the Y values will range from 0 to 1.0 (if expressed as fraction) to 100% (if in percents) or to N (if expressed as actual counts, where N is the number of values). You may then want to fit this cumulative data distribution to a cumulative Gaussian distribution. This is not built-in to Prism, but is easily added. Enter this user-defined equation:

z=(X-Mean)/SD

Y=(Top/2)*(1 + erf(z/sqrt(2)))

The X value is the data value. The first line subtracts the mean (which you'll fit) and divides by the SD (which you'll also fit) to compute the normalized z ratio (how many SDs from the mean?). The second line computes the cumulative frequency (Y) as a function of z. The parameter TOP is the top of the cumulative frequency curve.

To fit this equation, you need to create rules for initial values.

  • Set the initial value of mean to 1*Xmid.
  • Set the initial value of SD to 0.5*(Xmax-Xmin).
  • Constrain the value of Top a constant value of 1, 100 or N (depending on whether your frequency distribution is expressed as fractions, percents, or actual counts).

Explore the Knowledgebase

Analyze, graph and present your scientific work easily with GraphPad Prism. No coding required.