Dec 14 2008

Numerical Financial Recipes in Objective Caml

I wanted to work on a project using either Erlang or OCaml to get me back into the functional mindset.  I also wanted the project to be finance related, and preferably related to the strengths of the languages.  I tossed around the ideas of a order-matching system in Erlang, or a Monte-Carlo engine in OCaml, but ultimately time restraints have prevented me from tackling such (potentially) large scale projects.

Instead, I decided to translate Financial Numerical Recipes in C++ to Objective Caml.  My goal is to work through the examples in each chapter, and translate them to OCaml.  Hopefully, by the last chapter, I will have a better grasp of the ‘OCaml way.’

Without further adieu, here are the two chapters I have translated:

Value of Time: Discrete Cash Flows
Value of Time: Pricing Bonds with Discrete Cash Flows

Coding style comments are always welcome.

  • Share/Bookmark