ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Normal Distribution (https://www.excelbanter.com/excel-programming/293770-normal-distribution.html)

littlecharva

Normal Distribution
 
Hi

I need to convert a complicated Excel document that's been created by some Maths boffin into a program in C#. I've been doing really well (despite my Mathematical handicap) until I hit the Excel NORMDIST(x,mean,stdDev,cumulative) function. System.Math doesn't have any functions to help me out here, and I just can't seem to work out how to convert the formula into C# code. I need a function to work the same as the Excel Function with cumulative set to TRUE

Any takers

LittleC

Jerry W. Lewis

Normal Distribution
 
http://groups.google.com/groups?selm...0no_e-mail.com
http://lib.stat.cmu.edu/apstat/
Abramowitz and Stegun's "Handbook of Mathematical Functions"
or almost any book on statistical computing

Jerry

littlecharva wrote:

Hi,

I need to convert a complicated Excel document that's been created by some


Maths boffin into a program in C#. I've been doing really well (despite my


Mathematical handicap) until I hit the Excel NORMDIST(x,mean,stdDev,cumulative)


function. System.Math doesn't have any functions to help me out here, and I just


can't seem to work out how to convert the formula into C# code. I need a function


to work the same as the Excel Function with cumulative set to TRUE.



littlecharva

Normal Distribution
 
Hi

Thanks for that, but my knowledge of Maths isn't good enough for me to work that out. I was kinda hoping there would be an easy way to do it, or that maybe there was a class already out there somewhere that would do it for me

Cheers
LittleC

Jerry W. Lewis

Normal Distribution
 
http://www.library.cornell.edu/nr/bookcpdf/c6-2.pdf

gives erf and erfc in C.

NormSDist(x) = ErfC(-x/sqrt(2))/2 for x<=0
NormSDist(x) = 1 - NormsDist(-x) for x0

Jerry

littlecharva wrote:

Hi,

Thanks for that, but my knowledge of Maths isn't good enough for me


to work that out. I was kinda hoping there would be an easy way to


do it, or that maybe there was a class already out there somewhere


that would do it for me.

Cheers,
LittleC




All times are GMT +1. The time now is 05:09 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com