Wire finite difference model into EquityAmericanOption - #168
Conversation
… difference notebook with changes to methods signatures and output. Update Equity vanilla american style option notebook to show finite difference model gives similar results to CRR tree. Add and update tests
|
Hi Iain |
|
PS Just to be super clear - the payoffs to implement are (i) European options - this can be compared with Black Scholes analytic prices and you should see convergence. (ii) American options as you have done which should agree closely with CRR in the limit of many time steps. I think you have done this but just want to be explicit. |
|
Hi @domokane Would you like the finite difference model in EquityVanillaOption? I didn't bother as the only model it currently uses is the analytic one (which makes sense), but happy to add this model if you want. As for timings, I've only done a little work on this when deciding where to use Numba. Most of the methods didn't play nicely with Numba, or Numba was slower. I'll look into timing and optimisation more once I'm confident the output is actually sensible :) |
…er minor bugs, and some refactoring as well
|
Great! Are the results closer to the CRR Tree now ? |
|
I fixed a bug in my implementation of dx, but they're still not very close, and I'm still confused by that loop in the C++ code. Adding the loop to my Python code, it now diverges much slower, but something is still wrong. I'll keep investigating. |
|
<!--
/* Font Definitions */
@font-face
{font-family:"Cambria Math";
panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
{font-family:Calibri;
panose-1:2 15 5 2 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0cm;
font-size:11.0pt;
font-family:"Calibri",sans-serif;}
a:link, span.MsoHyperlink
{mso-style-priority:99;
color:blue;
text-decoration:underline;}
.MsoChpDefault
{mso-style-type:export-only;}
@page WordSection1
{size:612.0pt 792.0pt;
margin:72.0pt 72.0pt 72.0pt 72.0pt;}
div.WordSection1
{page:WordSection1;}
-->OK. I may have time to investigate next week. Take a look at the slides by Jesper in the folder https://github.com/domokane/CompFin BestDFrom: Iain DorringtonSent: 16 March 2023 23:00To: domokane/FinancePyCc: domokane; State changeSubject: Re: [domokane/FinancePy] Wire finite difference model into EquityAmericanOption (PR #168) I fixed a bug in my implementation of dx, but they're still not very close, and I'm still confused by that loop in the C++ code. Adding the loop to my Python code, it now diverges much slower, but something is still wrong. I'll keep investigating.—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you modified the open/close state.Message ID: ***@***.***>
|
Following on from previous PR: #167
I've wired the finite difference model into the EquityAmericanOption. The finite difference model seems to have a lot more parameters than other models, so rather than add a lot more parameters to the BlackScholes model class, I just added a params dictionary and gave most of the parameters sensible default values.
Tests seem to give similar (i.e. to 1dp) values as the CRR tree model