Rainbow options

Many financial problems could be summarized as or associated with the maximum or minimum of several assets. Let's look at a simple one: options on the maximum or minimum of two assets. These type of options are called rainbow options. Since two assets are involved, we have to get familiar with a so-called bivariate normal distribution. The following codes show its graph. The original codes are at the website of http://scipython.com/blog/visualizing-the-bivariate-gaussian-distribution/:

import numpy as np from matplotlib import cm import matplotlib.pyplot as plt from mpl_toolkits.mplot3d import Axes3D # # input area n = 60 # number of intervals x = np.linspace(-3, 3, n) # x dimension y = np.linspace(-3, 4, n) # y dimension x,y = ...

Get Python for Finance - Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.