Closed yfnaji closed 1 week ago
Hi, is this still a work in progress?
Hi @avhz - yes this is still a work in progress, I will push something out before the end of this week. I have made some changes to the methodology and code which I will document in this PR.
Just checking, thanks for the update !
All modified and coverable lines are covered by tests :white_check_mark:
Project coverage is 57.62%. Comparing base (
f14fa18
) to head (b0471f2
). Report is 65 commits behind head on main.
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
This branch is still a work in progress
This PR is for addressing the issues raised by @avhz in this comment - the code in question was initially merged from this PR to address issue 98.
There were some errors in implementation, namely:
(1..self.time_steps)
instead of(0..self.time_steps)
when it should be
self.call_boundary(t + 1, T, delta_t)Although the above amendments have been made, there are still issues with convergence in some places. For brevity, I have limited the cases to European call options.
The cases below were run with the following configuration:
with a distinct value for
initial_price
in each case:At the money
initial_price: 10.0
Target: 2.179260421286683In the money
initial_price: 15.0
Target: 6.064426504411616Out the money
initial_price: 1.0
Target: 1.0140475395001201e-6There is some level of convergence for the at/in the money cases, although I think there is room for improvement for accuracy. Whilst experimenting with different time step sizes, it seems that there is an issue with consistency i.e. $\Delta t \rightarrow 0 \Rightarrow \text{Error}\rightarrow 0$ - this suggests there is still an issue with implementation - Note that there is convergence, but just not to the target value. The out the money case further confirms that there is something wrong.
Stability issues
It was noticed that
explicit()
was blowing up in some configurations. It is likely that this indicates an issue with stability, which can be resolved by having a larger time steps, which in turn provides smaller $\Delta t$. Hence, in the config above, I changed the time step from 1000 to 10000 (though 5000 suffices for stability).