• C++ Programming for Financial Engineering
    Highly recommended by thousands of MFE students. Covers essential C++ topics with applications to financial engineering. Learn more Join!
    Python for Finance with Intro to Data Science
    Gain practical understanding of Python to read, understand, and write professional Python code for your first day on the job. Learn more Join!
    An Intuition-Based Options Primer for FE
    Ideal for entry level positions interviews and graduate studies, specializing in options trading arbitrage and options valuation models. Learn more Join!

Simplex or Powell method in C#

Hi all,

Does anyone mind sharing the nelder-mead or powell method implemented in .Net?

I've tried using the Nelder-Mead algorithm from numerical recipes but it's still a bit buggy and I'm not positive I'll be able to use it with constraints.

Powell's method would be more ideal and I started off trying to code it up first (I had already coded up Brent's method to use with it) but got stuck.

Many thanks,
why .Net and C#? Try R. It's free and it has already built-in optimization routines in multiple packages.
Hey Alain, as far as I'm concerned R is the greatest thing to come along since sliced bread. The reason is I need it to be deploy-able.
I haven't done any research but you can probably call R from C#.

if you don't want to write the code, the other solution is to buy it. There are plenty of vendors that offer optimization libraries.
Nothing prevents me from coding Powell's routine I'm just a little lazy and I imagine I wouldn't enjoy the experience anyway. I actually already have it within the VNI library, but like I said I need it deployable and licensed library's unfortunately are not. So if someone has done this and they're not to stingy with sharing their method they'd be doing me a solid.
ok, after a little more caffeine I wrote-up the Simplex method from NR.

Now I'm just unsure on how to proceed with constraints. Do I go about it the same way as with upper/lower bounds?

If you are coding in C++, you can find Simplex algorithm in GSL library. I have used it and it works perfectly. Not sure if you can use it with constraint though...