Archive for November, 2011
Wednesday, November 16th, 2011
I wanted to plot the paths of my Monte Carlo simulation of Black Scholes in my previous post.
Using iPython started with the --pylab flag, it's pretty easy.
[sourcecode language=Python]
from math import exp
from random import gauss
St0=41.75
rate=.0535
vol=.34
trials=100
for trials in range(trials):
prices=[St0]
for day in range(time):
...
Posted in finance, programming | No Comments »
Wednesday, November 16th, 2011
The Black Scholes formula is a partial differential equation that can be used to price the present value of an option under certain assumptions. As with everything, you can read all about it in Wikipedia.
It turns that that figuring out the present value of an option is also a ...
Posted in finance, mathematics, programming | 1 Comment »
Sunday, November 13th, 2011
Monte Carlo is a simulation method that can be useful in solving problems that are difficult to solve analytically.
Here's an interesting application of the technique to estimate the value of pi.
Consider a circular dartboard placed against a square backing, with the sides of the square perfectly touching the circle tangentially ...
Posted in programming | 3 Comments »