A quick and dirty implementation of Excel NORMINV function in C#

We are piloting the implementation of some financial risk models in F#, it so happens that the models are already implemented in Excel, so I was slowly digging out the formulas in the cells and translating them to F#. Everything was going fine until I found out that some formulas used the NORMINV function which doesn't exist in the .NET libraries. I started to look for F#, and then C#, implementations without luck (as we are just in the lets-see-if-this-have-any-chance-of-flying stage, we can’t afford any of the excellent but paid numerical libraries for .NET). The closest thing I found was a C++ implementation. The code looked really weird to me (my fault, not the coder's), so I decided to do the translation in two steps: first from C++ to C#, then on to F#. The C# translation seems to be working now, and you can download it from SkyDrive:

Please be aware that:

  1. I am not an expert in statistics by any stretch of imagination
  2. Ditto for numerical methods
  3. I have made only a handful of very basic tests

Having said that, the function *seems* to be working so I hope it will help somebody Sonrisa.


Comments have been disabled for this content.