Notice that if you estimated a Gaussian the traditional way: by just computing mean and sample variance you do get wider tails caused by a higher variance estimate. Likewise the estimations for the Cauchy are definitely off using this technique (and precisely because of the Cauchy's infinite/undefined variance you shouldn't use the mean, like the author does, to estimate the center of the distribution).
Since the author uses mean for the estimate and sample sd in the other code I'm confused why this isn't used as the estimate for the variance in the guassian? If you want to demonstrate some sort of numerical optimization it would be better to use a correct, more standard technique like minimizing the negative log likelihood of the data given the parameters.
On top of all this there's very unnecessary amounts of superfluous R code in here. With rnorm and rcauchy there's no need to role your own sampling function
> The ad hoc method of parameter estimation used here needs some explaining
I tried to imitate a "least squares regression" actually. I confess I wasn't sure if this was the most appropriate approach. I will run the analysis again using the more standard technique you suggested and compare the results.
> Since the author uses mean for the estimate and sample sd in the other code I'm confused why this isn't used as the estimate for the variance in the guassian?
The mean value from the density estimate was used for fitting both the Gaussian and Cauchy models because they are symmetric functions, in an attempt to reduce this one-dimensional (single variable) fitting error.
Later on the mean is removed when estimating prices since I was assuming a driftless stochastic process for the underlying stock.
I haven't read much further, perhaps you make it explicit later on.
> exp(1) ^ dist[["x"]]
In this link you can find more information:
So I ran the analysis again using the standard MLE technique you suggested and got the following results:
- Gaussian Model: σ = 0.0473
- Cauchy Model: σ = 0.1443
Quite an improvement from the original least squares regression approach I used!
You can find the updated plots below:
- [Probability Distributions] https://imgur.com/da8dRzm
- [Option prices chart] https://imgur.com/5hey110
Left some notes at the end describing these changes, along with a reference to the original version.
His site has some wonderful material too(2). I especially like his ‘Exotic Option Fantasy Land’(3)
For non-financial engineers, there is a subtle difference between the two option flavors. Holders of an American option can exercise their right to buy/sell the underlying asset at any time while European option holders can only exercise at expiration date.
> Despite the fact that the Gaussian distribution is widely used in fianacial models, it has some well known pitfalls, namely its inability to encompass fat tails observed in historical market data. As a result it will fail accurately describe extreme volatilty events, which can lead to possibly underpriced options.
I just started a job implementing asset pricing algorithms for energy contracts similar to what you did, even though a bit more involved (using stochastic dynamic programming and quite complex models for coming up with price paths).
Being completely new to trading I naturally wondered what the catch is, i.e. why I couldn't employ the same techniques for making private profits. Shoot me a mail if you'd like to discuss ideas ;)
Thanks! That's the goal in the long term.
Besides being a spare-time endeavour, I believe I'm still in the learning phase, studying different statistical finance concepts and techniques, making experiments like this one, assessing the results.
Then the next step I think is to come up with some strategies, perform backtests with historical data and build a real-time automated trading infrastructure.
I have a few friends working in Investment Banks but they're more into traditional portfolio management than automated trading, so they don't help much.
I will organize my thoughts and shoot you a mail once a get the time!