# How to calculate confidence interval for a CDF curve

## Main Question or Discussion Point

I got a question which has been confused me for a long time.

The question is to calculate the 95% confidence interval for a curve. I have already learnt how to calculate for a straight line.

For example, the cumulative distribution function (CDF) could be expressed as below:
Y = 1/2 * {1 + erf [(X-mean) / (sd * 2^0.5)]}
where ‘erf ’ is called error function, ‘mean’ and ‘sd’ are the mean value and standard deviation of X, respectively. Y is distributed normally from 0 to 1.

If ‘mean’ and ‘sd’ are known, by varying the value of X we could obtain a series values of Y. Then you could plot a typical CDF graph.

Then I need to calculate the 95% confidence intervals of this plotted curve. Could someone tell me how to do it?

I know it could be completed using MATLAB, Minitab, etc. But I want to know the algorithm.

Thank you.

Related Set Theory, Logic, Probability, Statistics News on Phys.org

The most general non-linear regression model is the polynomial. If you find a reasonable fit you can use an analysis of residuals to determine confidence bounds. Of course you can also simply do piecewise point by point CIs on the Y axis and simply connect the dots of upper and lower "curves" if your data allows it. This gives you some idea of the consistency of data quality.

http://www.mathworks.com/help/toolbox/curvefit/bq_5ka6-1_1.html [Broken]

If you are just curve fitting for CDFs or PDFs, most stat packages contain programs for this.

Last edited by a moderator:
The most general non-linear regression model is the polynomial. If you find a reasonable fit you can use an analysis of residuals to determine confidence bounds. Of course you can also simply do piecewise point by point CIs on the Y axis and simply connect the dots of upper and lower "curves" if your data allows it. This gives you some idea of the consistency of data quality.

http://www.mathworks.com/help/toolbox/curvefit/bq_5ka6-1_1.html [Broken]

If you are just curve fitting for CDFs or PDFs, most stat packages contain programs for this.
thank you.

I have read the information on mathworks but it seems I still can not figure out what algorithm they used. I think only use C=b+-t*sqrt(S) can not solve the problem. Or I might not fully understand this.

I know I can simplely use MATLAB or minitap, etc to analyze such statistics problem, but I need to understand how it works?

Could you give me a example of it, please?

Thank you!

Last edited by a moderator:
thank you.

I have read the information on mathworks but it seems I still can not figure out what algorithm they used. I think only use C=b+-t*sqrt(S) can not solve the problem. Or I might not fully understand this.

I know I can simplely use MATLAB or minitap, etc to analyze such statistics problem, but I need to understand how it works?

Could you give me a example of it, please?

Thank you!
I don't know the proprietary algorithms they use but for unspecified non-linear regressions, it's probably an iterative ML estimate.

$$CI= [\hat\theta-2SE, \hat\theta+2SE]$$

$$SE=\frac{1}{\sqrt{nI_{X_i}(\hat\theta)}}$$

$$I_X(\theta)={E(\theta)-\frac{\delta^2(lnp(X(\theta))}{\delta\theta^2}$$

http://learning.eng.cam.ac.uk/zoubin/SALD/week3b.pdf

Last edited:
I don't know the proprietary algorithms they use but for unspecified non-linear regressions, it's probably an iterative ML estimate.

$$CI= [\hat\theta-2SE, \hat\theta+2SE]$$

$$SE=\frac{1}{\sqrt{nI_{X_i}(\hat\theta)}}$$

$$I_X(\theta)={E(\theta)-\frac{\delta^2(lnp(X(\theta))}{\delta\theta^2}$$

http://learning.eng.cam.ac.uk/zoubin/SALD/week3b.pdf
Correction to the third equation above:

$$I_X(\theta)=E_\theta\frac{(-\delta^2(ln p(X|\theta))}{\delta\theta^2}$$

EnumaElish
$$I_X(\theta)=E_\theta\frac{(-\delta^2(ln p(X|\theta))}{\delta\theta^2}$$