Sunday, April 18, 2010

Mark Joshi’s C++ Design Patterns and Derivatives Pricing Is the book critical to your potential Quant interviews

Mark Joshi’s C++ Design Patterns and Derivatives Pricing Is the book critical to your potential Quant interviews

This book was the one that gelled everything for me. I must I was mightily impressed how simplistic the writing was in terms of merging the complex math algorithms needed to merged with knowledge of C++.
I have read some criticism of author Mark Joshi’s way of writing. This was mentioned in the Wilmott forum which kind of surprised me. I was astonished on some saying it was written in an old school way. I kind of disagree as Joshi present complex topics in a fairly easy to consume way. The style of type of the book alone is important as it is double spaced so you are not sleeping away while reading.
As for the content, it well developed as it starts each chapter with a basic lesson in each mathematical presentation of the C++ equivalent. Don’t worry, the book does not go in to detail like John Hull, but it is important to know that the brief introduction gives a deeper understanding as you tackle the C++ code.
Joshi starts with a very simple Monte Carlo simulator and starts to build on each section. He does not believe duplicating code (unless for optimization reasons), as code reuse is important. This includes using the standard object orientation and encapsulation, inheritance, and virtual functions.
As I started researching what kind of interview questions you will be expected to know, the chapters explaining virtual destructors is critical to understand the core of a potential interview questions. Joshi explains this flawlessly.
As for further progress of chapters, Joshi adds to the Monte Carlo simulator to use any kind of pricing engine for exotic options like Asian or the like.
The one that is so critical to understanding how Quant systems are developed are the solid understanding you will need for current enterprise level system design. These topics include which design patterns you need, decorating, random number generators, templates, using factories with wrappers, easy exception handling, and interfacing with Excel. These topics are very critical if you want to fly through your initial interviews. Remember many companies will put you from anywhere from two to eight rounds of interviews before you get a job offer.
I do believe Joshi’s book is a compulsory reading if you really want to get through a tough interview process at an investment bank or bulge bracket.

The great Visual C++ vs. C# with Microsoft’s Visual Studio 2010

The great Visual C++ vs. C# with Microsoft’s Visual Studio 2010

As I went to compare the added features in C# versus C++, I was amazed on the number of enhancements for each language. It was pretty evident that there must have been at least double for C++ as compared to C#. I would have thought Microsoft would have put more effort into developing C# as the newer language compared to the older C++. It could be because there are so many legacy systems and applications developed in it. Maybe it also helps Microsoft’s own applications are most likely developed in C++ including Windows and Office. Anyhow, here are some other general thoughts on the debate of the two languages regardless of the new IDE of Visual Studio 2010.
One person might have made a posting of:
>>The truth is that this new development in C++ seriously undermines the justification for C# as a language. C++ programmers yet to learn C# simply don’t need to know.<<
C++ developers really don’t need to learn C#. It does what it needs for them. Some of these guys might have been only developing in C++ for over ten or maybe even twenty years. Do they really have a need to switch? If you look at the number of enhancements in Visual Studio 2010 for Visual C++< it makes you think Microsoft has definitely not forgotten about them.
C# was initially designed as a language for weaknesses found in Delphi, C++, Java, etc. It was also designed for those that wanted to target the .NET platform instead of a multi platform which C++ has always been about.
Some say C# is not as feature rich or even slower than C++. Others argue you could not simply design a web form using C++ but you could with C#. Well, those languages are meant for different purposes. Each language is meant for different purposes.
What more can you say about this debate?

Visual C++ appears to be VERY alive and well in Microsoft’s Visual Studio 2010

Visual C++ appears to be VERY alive and well in Microsoft’s Visual Studio 2010
I was amazed when I learned the amount of enhancement for Visual C++ versus Visual C# 2010. It was at least double as compared to C#. Does this mean that C++ is not going anywhere soon? It seems not as many companies and industries are heavily reliant on the programming languages. This of course include financial (for quantified analysis), game development, digital signal processing, etc. Let’s take a look what has been added to this 2010 version of Microsoft’s Visual Studio 2010:
1. You can the Lambda function by itself, as a template function, or with the auto keyword to declare a variable where it is a lambda.
2. There is now rvalue reference declaratory (&&) declare a reference to rvalue. This allows to write forwarding to developer more efficient constructors, functions, and templates.
3. Static_assert now tests assertions at compile time instead at run time. If the compilation asserts fails, it will fail at compile time.
4. nullptr and _nullptr is a native keywords that allows you to test if an object handle, interior pointer or native pointer does not point an object. This option can be intermingled with the compiler’s /clr switch. Remember this is a Microsoft keywords so it cannot transported to other operating system platforms.
5. The new pragma directive detect_mismatch lets you tag in your vile that is compared to other tags that have the same name. If there are multiple values, the linker will issue an error.
The above are compiler and linker related. As for Visual C++ projects and the build system, Microsoft has replaced MSBuild with VCBuild. This enables to match the XML file format with other Visual Studio languages as opposed to Visual C++ being unique. Any other older project can be converted to this format as well. Also, _ITERATOR_DEBUG_LEVEL allows debugging support for iterators instead of using the older _SECURE_SCL and _HAS_ITERARTOR_DEBUGGING macros. There are so many more enhancements in the Visual C++ libraries including the Standard, Microsoft Foundation Class Library, the IDE, and further tools.
Check http://msdn.microsoft.com/en-us/library/dd465215.aspx for more info.

Is Visual Studio 2010 a real game changer thanks to Microsoft's F# programming language?

Is Visual Studio 2010 a real game changer thanks to Microsoft's F# programming language?

We are now upon next big version of Visual Studio 2010 coming up. This could be one of the most important upgrades for Microsoft. Their development as Software Company has come to a very critical crossroads as many open source technologies are eating their lunch. Java and the other dozens of dynamic scripting languages (i.e. Python or Ruby on Rails) are proving to be important choices for the profitable enterprise. If you are a software developer or consulting company, this is your sector you need to focus on if you want to make real money over the long term. Back to Microsoft, many enterprise level companies (including the bulge brackets or investment banks) rely on software vendors who can provide a certain SLA (Service Level Agreement) for their mission critical application like trading systems. Many of these types of companies do not like to support open source technologies as the application developers don’t tend stick around to long after in-house applications are built.

As for the Microsoft technologies that will be the game changer is the upcoming F#. This is Microsoft’s open source equivalent to an open source dynamic scripting language being supported on operating system platforms including Linux. This is one major advantage of it. It is about supporting Lambda expressions, pattern matching, and other useful data types like tuples, etc.
As financials system get more complicated, parallel computing is becoming an increasingly important element in development. There are now apparently:
Parallel Extensions to the .NET Framework. With the F# Power Pack, you can also use Parallel LINQ (PLINQ) with F#.
Sounds interesting but even a Ruby on Rails developer seems to respect this technology.
This language can be both an interpreter (F# Interactive and F# Interpreter) and even compiler.
F# can also be great for prototyping code just like in any other statistical or scripting language. This of course includes R. As for financial development potential, F# offers operator overloading support, operators that work with generics, and a full set of mathematical operators,
Obviously, F# shows the potential for financial and quant developers in the future thanks to Microsoft’s new Visual Studio 2010.

Will the charge of Goldman Sachs by SEC change the future of our economy?

Will the charge of Goldman Sachs by SEC change the future of our economy?
Or is this just a lesson from the past. Will it happen again? I think it could as the younger generation learning about Quant does not really care about the past. They are just as greedy and high risk takers as in the past of the 2000s. Everyone will always try to cheat the system and regulators. With how the complexity of derivative and related product, it is quite easy to bury and repackage toxic asset products. As long as it goes up, people will always buy it without the rationale; you would think those would learn from the past of the 2007 financial crunch.
The other scary thought is will this charge by the Security Exchange commission to Goldman Sachs erode the confidence in the stock market’s exchange run over the last few months? If you at the dip of 125 on the New York Stock Exchange, 121 on NIKKEI, and 43 on the STOXX 50. Yikes! That is a bit of a hit since the run of the markets. Again, could this start the decline of a new correction or even crash on the markets?

Face it, the confidence has been slapped in the face. What do you think took down a number of banks in 2007 and 2008? I personally feel it was the bankruptcies of banks like Lehman Brothers, takeover of Bear Stearns and Merrill Lynch. As people did not trust the banks, the LIBOR dipped as banks did not trust other banks so the credit market froze. This in the end resulted in the credit market freezing which lead to a very scary situation that would have the results of 1930’s depression look like happy times. It is quite possible that this Goldman Sachs charge could have started something over again?

Thursday, April 1, 2010

Is QuantLib the world’s greatest library for C++ quant development and open source community?

Is QuantLib the world’s greatest library for C++ quant development and open source community?

Let’s face it. We hear about the job postings where investment banks want you to have an understanding of libraries for their C++ quant models and strategies. Wanting to learn but don’t have access to these expensive proprietary libraries us poor schmucks don’t have access to?

Here are my reasons why QuantLib is becoming a fantastic foundation for your learning in quant development.
1. It is developed in C++. Do we really need to talk about this? See my C ++ discussion about why this programming language would be my choice.
2. SWIG compatible that enables you make calls to the QuantLib library using any major languages including Perl, PHP, Python, Tcl and Ruby. The list of supported languages also includes non-scripting languages such as C#, Common Lisp (CLISP, Allegro CL, CFFI, UFFI), Java, Lua, Modula-3, OCAML, Octave and R. I do believe C# is added as well. The SWIG interpretation of QuantLib allows you to talk to many of these languages. Pretty cool huh?
3. QuantLib includes virtually all major models, engines, market conventions, yield curve models, solvers, PDEs, Monte Carlo (low-discrepancy included), exotic options, VAR, and so on.
4. Leaning this library could actually get you a real job in the market.
5. Researchers would have a framework at hand, which vastly reduces the amount of low-level work necessary to build models, so to be able to focus on more complex and interesting problems.
6. QuantLib is a BSD license meaning it is free and can be distributed into other systems you develop even if you charge for it.
7. Pretty decent community for questions that actually get answered on a timely basis.
8. It is constantly updated and maintained frequently.
9. Major companies use it including StatPro, Credit Suisse, and Axa in Europe.
10. QuantLibAddIn and QuantLibXL was created to enable Excel integration for front end development on your algorithms’.

Do I really need to say adding additional? So what if QuantLib is ‘over-engineered’? What people need to understand is that is has so much functionality to it that it makes so humongous?

Hull vs Wilmott to determine those tough quant algorithms, models, and other number crunching

Hull vs Wilmott to determine those tough quant algorithms, models, and other number crunching
Starting out in Quant? Which books are best to start with? Ok. There are only two to choose from. I mean, I have only dove into two. There are three highly recommended books to start with.

They include
Options, Futures, and Other Derivatives with Derivagem CD (7th Edition) by John Hull
Where do I start on this? This appears to be the easier of the books that I was introduced to. His latest includes updates on the recent financial crush. This includes how to work in emerging markets like China or India. The one thing I like about this book is its ability to keep things simple. Learning quant aint’ easy so don’t think you will pick it up in the first read. It will take at least two or maybe three. This is very heavy math. Unless you have a background in it like physics or engineering, this will be a very steep learning curve. The book alone is about 800 pages from what i remember so this is definitely not light reading.

Paul Wilmott on Quantitative Finance 3 Volume Set (2nd Edition)
Paul Wilmott has got something going on as compared to John Hul.. In my mind, both could be considered God fathers of quant by authoring these books. Althought Wilmot has about 1200 pages in this three volume set, you will find it very overwhelming as compared to Hull. As said, start with Hull’s book first as it is easier to lump. Wilmott introduces all the same as Hull but it is at much more overwhelming as less simplistic approach. I am not knocking Wilmott’s book, but understand it seems to be more of an advanced book in the last two sets. Just understand, serious quants will use this as their bible. Get this once you earn your chops later in the game.