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.

Published Thursday, July 29, 2010 5:19 PM by Edgar Sánchez
Filed under: , ,

Comments

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

Friday, July 30, 2010 1:27 AM by robin jackman

I like your blog and such a useful information sharing. I appreciate your blog and thanks for that.

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

Tuesday, February 1, 2011 1:59 AM by joomla development

i appreciate your blog because of unique and informative content.

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

Monday, July 25, 2011 10:51 AM by rca ieftin

This implementation of the code seems to be faster and easier than the latest version of the code.

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

Thursday, July 12, 2012 12:15 PM by RKPUdmlNHkDt

Fff3bg Say, you got a nice post.Thanks Again. Much obliged.

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

Monday, November 5, 2012 12:05 AM by OdGgxEcYbkHr

GCdJID Wow, great article post.Much thanks again. Keep writing.

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

Friday, November 9, 2012 5:07 AM by meymEdRyFsbXhE

Im thankful for the blog article.Really looking forward to read more. Really Great.

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

Tuesday, November 13, 2012 6:13 PM by rGRuUCjtuc

Great, thanks for sharing this blog article. Fantastic.

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

Wednesday, November 21, 2012 4:56 AM by VEQUkhRainW

I appreciate you sharing this post.Thanks Again. Great.

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

Sunday, November 25, 2012 5:56 AM by dvgpkJuaLfuzutNj

Thanks a lot for the blog.Much thanks again. Fantastic.

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

Sunday, November 25, 2012 7:45 AM by wGSBmjHuWBoautbeKyS

I am so grateful for your blog post. Will read on...

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

Sunday, November 25, 2012 9:16 AM by aWxyueUQJHk

Muchos Gracias for your blog post.Really looking forward to read more. Want more.

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

Sunday, November 25, 2012 10:27 AM by adbwtdytaadheAEmr

Enjoyed every bit of your article post. Cool.