1
$\begingroup$

I have a bit of a favor to ask and if anyone could help me out with this I'd really appreciate it. At the moment I'm trying to use the triangle wave formula as the payoff for the Black-Scholes PDE i.e. $\Phi(x) = \frac{2}{\pi}(\sin^{-1}(\sin(S\pi )))$ with the boundary condition $0$ as $S \rightarrow \infty$.

Now, in the numerical Black-Scholes PDE, you start from maturity time $T$ and work your way backwards until you reach the initial time $0$. In order to get a visualization of the plot and ensure everything was working correctly I decided to plot the option at maturity time $T$, and using the conditions as given above I obtained the plot:

enter image description here

This plot appears to be wrong since it does not look like a triangle wave - as taken from Wolfram Alpha, the triangle wave should look like this: Triangle Wave

Can someone tell me why the PDE plot doesn't look anything like this? I'd really appreciate it, thanks in advance.

$\endgroup$
  • 2
    $\begingroup$ Do you mean that this is the plot of $\Phi(x)$ ? If yes, you definitely did something wrong. Could you maybe post the code? That being said, it seems pretty weird to me to apply a Dirichlet type condition to a periodic function... What exactly are you trying to achieve? $\endgroup$ – Quantuple Jul 20 '16 at 7:58
  • $\begingroup$ Thanks for the reply, I was able to fix this somehow by increasing the number of points (I don't know why it worked but it did!). I've mostly been applying different conditions to test out codes I've written - 2 of the codes I had didn't work properly depending on what boundary/initial conditions I used, so I'm trying to make sure everything works regardless of what I use $\endgroup$ – ThePlowKing Jul 25 '16 at 9:09

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.