Friday, January 25, 2013

F#: contributing a chapter to an upcoming book, "F# Deep Dives"

Thanks to Tomas Petricek's invitation, I am honored by being able to write a chapter for an upcoming book - F# Deep Dives. The chapter I am responsible for is Chapter 4: Numerical computing in financial domain. The first draft of the chapter is now available online via Manning's early access program.

Currently the chapter covers the following:
1 Introducing financial derivatives
2 Using probability functions of Math.NET
2.1 Configuring F# Interactive (profiling and floating point formatting)
2.2 Setting up Math.NET Numerics
2.3 Introducing Random Variables, Expectation and Variance
2.4 Generating Normally Distributed Samples
3 Geometric Brownian Motion and Monte Carlo Estimate
3.1 Modeling stock prices using geometric Brownian motion
3.2 Payoff Function, Discounted Payoff, and Monte Carlo estimate
3.3 Analyzing variance of Monte Carlo estimates
3.4 Pricing Path-dependent options (Asian options and barrier options)
3.5 Reducing Variance by antithetic variates


  1. just wondering if there needs to be a slight amendment to the parantheses and indentation on page 37 as per this gist:

  2. Hi Vijesh,

    Thanks for pointing out this. For some unknown reason, the indentation of the code snippet in question in the book version was different from that in the original version I submitted. Anyhow, I think your suggestion is correct. Moreover, when reading your code sample, I realized that there is a newer version of MathNet.Numerics available now. In next update of the chapter, I will fix the indentation error and use the new MathNet.Numerics. As I am pretty tied up with my current teaching job for now, the next update of the chapter perhaps won't happen before this August.