 Rabelais
Topic Author
Posts: 9
Joined: September 22nd, 2020, 6:33 pm

### What are the boundary conditions for the Forward contract PDE?

European call
When solving the PDE for the value $V$ of a European call option under the Black-Scholes model using a finite difference scheme, we have that
• Initial/terminal condition. $V(S_T,T) = \text{payoff}(S_T) = \max(S_T-K,0)$ (initial since the scheme is solved backward, terminal since it holds at the final time $T$)
• Left end boundary condition. If $S_0=0$ then $S_t=0$ for all $t$ and the option will surely be out of the money with payoff $\max(0-K,0)=0$ and $V(0,t)=0$ for all $t$
• Right end boundary condition. If $S_0$ is large enough (w.r.t. to $K$) then $S_t>K$ for all $t$ and the option will end up in the money with payoff $\max(S_t-K,0)=S_t-K$ and $V(S_t,t)=S_t-Ke^{-r(T-t)}$ for all $t$
Forward contract
How to deduce the boundary conditions in a similar manner when solving the PDE for the value of a forward contract whose underlying follows the Schwartz mean reverting model? What I understand until now about forwards is
• There is no money exchanged when signing a forward contract so, using the notation below, I think that the value of the forward at time 0 is $F(S_0,0)=0$
• The payoff (of the option equivalent to this forward contract) is $S_T-K$ since the holder is obliged to buy the underlying at expiry
.
The Schwartz model is $dS = \alpha(\mu-\log S)Sdt + \sigma S dW$ with $\alpha$ speed of mean reversion. From this eq it is possible to derive the PDE for the value of the forward
$\tag1 \frac{\partial F}{\partial t} + \alpha\Big(\mu-\lambda -\log S\Big)S\frac{\partial F}{\partial S}+\frac12\sigma^2S^2\frac{\partial^2F}{\partial S^2} = 0, \qquad \text{with }\lambda = \sigma\frac{\mu-r}\alpha$ whose solution is, letting $\tau=T-t$
$\tag2 F(S_t,\tau) = \mathbb E[S_t] = \exp\bigg(e^{-\alpha\tau}\log S_t +\Big(\mu-\frac{\sigma^2}{2\alpha}-\lambda\Big)(1-e^{-\alpha\tau})+\frac{\sigma^2}{4\alpha}(1-e^{-2\alpha\tau})\bigg)$
• Initial/terminal condition. Plugging $\tau=0$ (ie $t=T$) in $(2)$ we get $F(S_T,0) = \exp(\log S_T) = S_T$. This value appears also in the original paper by Schwartz (at page 5), so it is correct.
• Left end boundary condition. As in the European call case, if $S_0=0$ then $S_t=0$ for all $t$ and from $(1)$ we get $\dfrac{\partial F}{\partial t}=0$ ie $F$ does not change in time, and since as said before $F(S_0,0)=0$ (not sure though) it follows $F(0,t)=0$ for all $t$. But this means that the payoff of the option would be $0-K$ that is negative, since prices cannot be negative how to deal with this fact?
• Right end boundary condition. If $S_0$ is large enough (w.r.t. to $K$) then $S_t>K$ for all $t$ and the payoff of the option will be $F(S_t,t)-K$ and $V(S_t,t)=(F(S_t,t)-K)e^{-r(T-t)}$ for all $t$, but what can we say about the value of $F(S_t,t)$?
.
At the end of the finite difference scheme, to obtain the value of the option at time 0 we compute $V(S_0,0) = (F(S_0,0)-K)e^{-rT}$ which in general is not 0, in contrast with what I said above about $F$ being 0 at time 0. What is wrong in the reasoning?

Code
What follows is the Matlab code that computes the exact value of the option at time 0 (V_exact in the code) and the value approximated by the Euler explicit finite difference scheme (V_euler). The initial/terminal condition is applied at line 26 (F = ST), the next two lines are for the left end condition (F(1) = 0) and the right end condition (I don't know what to put here).

Moreover, I'm not sure that V_exact is computed correctly, should be $(F-K)\exp(-rT)$ or $F-K\exp(-rT)$?
Attachments boundary_cond.zip Cuchulainn
Posts: 64420
Joined: July 16th, 2004, 7:38 am
Location: Drosophila melanogaster
Contact:

### Re: What are the boundary conditions for the Forward contract PDE?

I see your predicament. It is based on heuristical reasoning.
What I do is to use domain transformation $y = S/(1+S)$ to get a PDE in $y$. Then use Fichera theory (and/or integration by parts) to get 'numerical BCs'.
There might  a Feller-style condition because of mean-reversion. You *might* get a 1st order hyperbolic PDE on y = 0 as is seen with CIR model.

// very generally: BCs can be modelled related to the payoff.
"Compatibility means deliberately repeating other people's mistakes."
David Wheeler

http://www.datasimfinancial.com
http://www.datasim.nl JohnLeM
Posts: 515
Joined: September 16th, 2008, 7:15 pm

### Re: What are the boundary conditions for the Forward contract PDE?

I am not getting your point: suppose that we enter today a contract where I will pay to you 1 euro in one year. This contract worth the zero-coupon today, hence is not null, even if we do not exchange money today..

Maybe you are confusing payoff and fair-value ? Rabelais
Topic Author
Posts: 9
Joined: September 22nd, 2020, 6:33 pm

### Re: What are the boundary conditions for the Forward contract PDE?

I see your predicament. It is based on heuristical reasoning.
What I do is to use domain transformation $y = S/(1+S)$ to get a PDE in $y$. Then use Fichera theory (and/or integration by parts) to get 'numerical BCs'.
There might  a Feller-style condition because of mean-reversion. You *might* get a 1st order hyperbolic PDE on y = 0 as is seen with CIR model.

// very generally: BCs can be modelled related to the payoff.
As you can see I already have the PDE for the price of the forward contract which is equation (1), moreover I have the analytical solution which is equation (2).
I just need to deduce the boundary conditions but I'm struggling with them. I think that the left end condition is correct, but don't know about the right end one Rabelais
Topic Author
Posts: 9
Joined: September 22nd, 2020, 6:33 pm

### Re: What are the boundary conditions for the Forward contract PDE?

I am not getting your point: suppose that we enter today a contract where I will pay to you 1 euro in one year. This contract worth the zero-coupon today, hence is not null, even if we do not exchange money today..

Maybe you are confusing payoff and fair-value ?
I don't fully understand your argument since I miss a lot of tools in finance, the forward contract is different from an option were you have the right to exercise it or not, with the forward you have the obligation to buy the underlying so there is no cost in entering a forward contract, or at least this is what I understood. Here is an example of how it works, following that example Bob doesn't pay anything to enter in the forward contract. Cuchulainn
Posts: 64420
Joined: July 16th, 2004, 7:38 am
Location: Drosophila melanogaster
Contact:

### Re: What are the boundary conditions for the Forward contract PDE?

Yes, left BC works like this,usually.

Using truncation, your BC explodes for calls (put easier). Anyways, a common technique BC is $F_{SS} = 0$. It's rough and ready but maybe OK.

With domain transformation, my hunch at y = 1, $F_{t} = 0$ would probably work.

See here https://onlinelibrary.wiley.com/doi/epd ... wilm.10366
Last edited by Cuchulainn on September 30th, 2020, 5:02 pm, edited 2 times in total.
"Compatibility means deliberately repeating other people's mistakes."
David Wheeler

http://www.datasimfinancial.com
http://www.datasim.nl Rabelais
Topic Author
Posts: 9
Joined: September 22nd, 2020, 6:33 pm

### Re: What are the boundary conditions for the Forward contract PDE?

This is the plot with spot prices at time T (vector ST in the code) on x-axis and option prices at time 0 ((F-K)*exp(-r*T) in the code) on y-axis. As you can see the there is a problem when the option price approaches the biggest value of the spot price, since the curve goes from linear to exponential, I guess this is due to the fact that the right end condition is missing  Cuchulainn
Posts: 64420
Joined: July 16th, 2004, 7:38 am
Location: Drosophila melanogaster
Contact:

### Re: What are the boundary conditions for the Forward contract PDE?

This is the plot with spot prices at time T (vector ST in the code) on x-axis and option prices at time 0 ((F-K)*exp(-r*T) in the code) on y-axis. As you can see the there is a problem when the option price approaches the biggest value of the spot price, since the curve goes from linear to exponential, I guess this is due to the fact that the right end condition is missing It is not surprising TBH; try my two previous pieces of advice.
What does a put give (0 at S =60)?
"Compatibility means deliberately repeating other people's mistakes."
David Wheeler

http://www.datasimfinancial.com
http://www.datasim.nl JohnLeM
Posts: 515
Joined: September 16th, 2008, 7:15 pm

### Re: What are the boundary conditions for the Forward contract PDE?

I am not getting your point: suppose that we enter today a contract where I will pay to you 1 euro in one year. This contract worth the zero-coupon today, hence is not null, even if we do not exchange money today..

Maybe you are confusing payoff and fair-value ?
I don't fully understand your argument since I miss a lot of tools in finance, the forward contract is different from an option were you have the right to exercise it or not, with the forward you have the obligation to buy the underlying so there is no cost in entering a forward contract, or at least this is what I understood. Here is an example of how it works, following that example Bob doesn't pay anything to enter in the forward contract.
I was trying to answer to your point above : "At the end of the finite difference scheme, to obtain the value of the option at time 0 we compute
[ltr]V(S0,0)=(F(S0,0)K)erTV(S0,0)=(F(S0,0)−K)e−rT  which in general is not 0, in contrast with what I said above about FF being 0 at time 0. What is wrong in the reasoning?"[/ltr]

[ltr]I was just saying that the value computed is the fair price of the forward contract, not its payoff. Thus there is no reason that this quantity nullifies.[/ltr] Cuchulainn
Posts: 64420
Joined: July 16th, 2004, 7:38 am
Location: Drosophila melanogaster
Contact:

### Re: What are the boundary conditions for the Forward contract PDE?

whose solution is, letting $\tau=T-t$
$\tag2 F(S_t,\tau) = \mathbb E[S_t] = \exp\bigg(e^{-\alpha\tau}\log S_t +\Big(\mu-\frac{\sigma^2}{2\alpha}-\lambda\Big)(1-e^{-\alpha\tau})+\frac{\sigma^2}{4\alpha}(1-e^{-2\alpha\tau})\bigg)$
I know it's cheating but can you use the exact solution at Smax as BC? just to see what happens?
"Compatibility means deliberately repeating other people's mistakes."
David Wheeler

http://www.datasimfinancial.com
http://www.datasim.nl JohnLeM
Posts: 515
Joined: September 16th, 2008, 7:15 pm

### Re: What are the boundary conditions for the Forward contract PDE?

This is the plot with spot prices at time T (vector ST in the code) on x-axis and option prices at time 0 ((F-K)*exp(-r*T) in the code) on y-axis. As you can see the there is a problem when the option price approaches the biggest value of the spot price, since the curve goes from linear to exponential, I guess this is due to the fact that the right end condition is missing A trick that I was using for this kind of problem: try using the boundary conditions $u^{N} = 2 u^{N-1} - u^{N-2}$,  $u^{0} = 2 u^{1} - u^{2}$ modelling $\partial_{xx}u=0$ (linear behavior at infinity). AFAIR, this saved me to compute complex, payoff dependent, Dirichlet or Neuman boundary conditions. Obviously it only works for linear at infinity type payoff. Cuchulainn
Posts: 64420
Joined: July 16th, 2004, 7:38 am
Location: Drosophila melanogaster
Contact:

### Re: What are the boundary conditions for the Forward contract PDE?

Yes, that was also one of my suggestions and is standard.
"Compatibility means deliberately repeating other people's mistakes."
David Wheeler

http://www.datasimfinancial.com
http://www.datasim.nl JohnLeM
Posts: 515
Joined: September 16th, 2008, 7:15 pm

### Re: What are the boundary conditions for the Forward contract PDE?

Yes, that was also one of my suggestions and is standard.
The only bad point is that the matrix A is no longer symmetric with these BCs, and I don't know what happens to monotonicity and conservation properties of the FD scheme. But the numerics seemed ok AFAIR. Cuchulainn
Posts: 64420
Joined: July 16th, 2004, 7:38 am
Location: Drosophila melanogaster
Contact:

### Re: What are the boundary conditions for the Forward contract PDE?

Yes, that was also one of my suggestions and is standard.
The only bad point is that the matrix A is no longer symmetric with these BCs, and I don't know what happens to monotonicity and conservation properties of the FD scheme. But the numerics seemed ok AFAIR.
yes, the matrix is no longer tridiagonal. All bets are off, back to square 1 as it were.
"Compatibility means deliberately repeating other people's mistakes."
David Wheeler

http://www.datasimfinancial.com
http://www.datasim.nl Rabelais
Topic Author
Posts: 9
Joined: September 22nd, 2020, 6:33 pm

### Re: What are the boundary conditions for the Forward contract PDE?

whose solution is, letting $\tau=T-t$
$\tag2 F(S_t,\tau) = \mathbb E[S_t] = \exp\bigg(e^{-\alpha\tau}\log S_t +\Big(\mu-\frac{\sigma^2}{2\alpha}-\lambda\Big)(1-e^{-\alpha\tau})+\frac{\sigma^2}{4\alpha}(1-e^{-2\alpha\tau})\bigg)$
I know it's cheating but can you use the exact solution at Smax as BC? just to see what happens?
I confirm you that when using the exact solution at Smax as BC then the plot is correct, ie it is a straight line.
Could you explain how to implement the BC $F_{SS} = 0$? I see that you are talking about the tridiagonal matrix, but since I'm using Euler explicit i did not use the matrix form but I just do
for N = 1:n
F(2:end-1) = a.*F(1:end-2) ...
+ b.*F(2:end-1) ...
+ c.*F(3:end);
end

is it possible to implement the BC $F_{SS}=0$ also in this case? Thank you very much for support