<?php
if (isset($nh)) 
  echo "<body text='#000000' bgcolor='#FFFFFF'>"; ?>
<?php
if (!isset($user_dir)) $user_dir='.';
if (!isset($nh)) {
  if ($pde =='0') {
    exit();
  } else {
    echo "<html>
    <head><meta name=robots content=noindex,nofollow>
    <title>2.05 European Option</title></head>
    <body text='#000000' bgcolor='#FFFFFF'>
<img SRC='../../images/previous_motif_gr.gif' border=0 align=bottom>
    <a href='".$user_dir."/../../../SRC/assign.php'     onMouseover=\"window.status=' # assignments'; return true\">
<img SRC='../../images/up_motif_gr.gif' border=0 align=bottom></a>
<img SRC='../../images/next_motif_gr.gif' border=0 align=bottom>
    <a href='".$user_dir."/../../../SYL/node1.php'      onMouseover=\"window.status=' # course'; return true\">
<img SRC='../../images/contents_motif.gif' border=0 align=bottom></a>
    <br><hr><br>";
  }
} echo "<h1>2.05 European Option</h1>" ?>
                 
 
<p>
                                                                             
It is really not possible here to give a complete introduction on the 
broad subject of option pricing. A number of simple explanations can 
be found on-line in a tutorial by the 
   <a href="http://www.cboe.com">Chicago Bord of Exchange</a>;
for a more thorough description, please consult the <em>syllabus</em>
from Lifelong-learners 
   <a href="http://www.lifelong-learners.com/opt">option pricing course</a>.

<p>
To complete this excercise, it is in fact sufficient to understand that 
a <em>European Vanilla put option</em> is a contract giving its owner the 
right to sell a certain asset (called the <em>underlying</em>) for a fixed 
price (E the <em>exercise</em> or <em>strike</em> price) at a prescribed 
time T in the future (the <em>expiry</em> date).

<p>
The parameters of the exercise have been chosen for the underlying
   <a href="http://quote.cboe.com/QuoteTable.asp?TICKER=QQQ&ALL=2">QQQ index</a>
(NASDAQ top 100) quoted on the evening of May 24, 2000 when QQQ was traded 
as high as S = 79.5 USD (alternatively, you can take the value from today 
and repeat the exercise with updated values).
Imagine you were the owner of a put option giving you the right to sell a 
QQQ share for E = 95.00 USD on September 1st, 2000: how much this right 
worth on May 24, 2000, i.e. T = 0.268 year before expiry (alt. take today).

<p>
At expiry on September 1st, 2000, it is clear that the value of the put 
depends only on the price S of the underlying share and is given simply by 
the payoff function P(S,t = 0) = max(E<font face="symbol">-</font
>S,0) apparent as initial condition in 
the  JBONE applet: the put option is worthless if QQQ is traded above 
S = 95 USD (an option is a right with no obligation, so that you can simply 
discard it) and you will earn the price difference if QQQ is traded below 
(you can buy QQQ shares for e.g. S = 75 USD on the market and sell them for 
the strike price of E = 95 USD with a net profit of 20 USD per share).

<p>
Two factors at least can change the price of this right from May to September:

<ol type="1"><p>
<li> if you would give your money to a bank, you could earn an interest 
      rate of r = 0.05 on your deposit; you should therefore discount this 
      systematic risk free return from the value of the option during the 
      entire period your money is invested.</li>
<p>
<li> The market (and in particular NASDAQ) is volatile. Prices change 
      constantly with what may be modeled as a random component in the 
      price of a share: even if chance are slim, you may still earn money 
      with a put option at 95 USD if QQQ is above 100 USD in August... 
      if the market crashes, making you rich!
      Clearly, options keep a finite value until they expire depending on 
      volatility. For QQQ, this was <font face="symbol">s</font
> = 0.7155 in May 2000 (alt. 
      follow the corresponding <a href="http://www.cboe.com">link</a> to obtain 
      a value for today).</li>
</ol>

<p>
The Black &amp; Scholes model takes these factors into account and integrates 
the payoff function backwards in time to model the price of an option some 
time before it expires.

<p>
Using an explicit 2 levels spatially centered finite difference scheme, 
the Black-Scholes equation can naively be written as

<p>
<a name="eBScholesFDa1">
</a>
<br clear="all" /><table border="0" width="100%"><tr><td>
<table align="center"><tr><td nowrap="nowrap" align="center">
V<sup>t+<font face="symbol">D</font
>t</sup> = V<sup>t</sup> +<font face="symbol">D</font
>t </td><td align="left" class="cl"><font face="symbol">
é<br />ê<br />
ë
</font></td><td nowrap="nowrap" align="center">
<font face="symbol">s</font
><sup>2</sup>(</td><td nowrap="nowrap" align="center">
1<hr noshade="noshade" />2<br /></td><td nowrap="nowrap" align="center">
j<font face="symbol">D</font
>S)<sup>2</sup></td><td nowrap="nowrap" align="center">
V<sub>j+1</sub><font face="symbol">-</font
>2V<sub>j</sub>+V<sub>j<font face="symbol">-</font
>1</sub><hr noshade="noshade" /><font face="symbol">D</font
>S<sup>2</sup><br /></td><td nowrap="nowrap" align="center">
+r (j<font face="symbol">D</font
>S)</td><td nowrap="nowrap" align="center">
V<sub>j+1</sub><font face="symbol">-</font
>V<sub>j<font face="symbol">-</font
>1</sub><hr noshade="noshade" />2<font face="symbol">D</font
>S<br /></td><td nowrap="nowrap" align="center">
<font face="symbol">-</font
>r V<sub>j</sub> </td><td align="left" class="cl"><font face="symbol">
ù<br />ú<br />
û
</font></td><td nowrap="nowrap" align="center">
 = 0</td></tr></table>
</td><td width="1%">(1)</td></tr></table>


and cast into

<p>
<a name="eBScholesFDa2">
</a>
<br clear="all" /><table border="0" width="100%"><tr><td>
<table align="center"><tr><td nowrap="nowrap" align="center">
V<sup>t+<font face="symbol">D</font
>t</sup> = </td><td nowrap="nowrap" align="center">
<font face="symbol">D</font
>t<hr noshade="noshade" />2<br /></td><td nowrap="nowrap" align="center">
(<font face="symbol">s</font
><sup>2</sup>j<sup>2</sup> +rj) V<sub>j+1</sub> +(1<font face="symbol">-</font
><font face="symbol">s</font
><sup>2</sup>j<sup>2</sup><font face="symbol">D</font
>t +r<font face="symbol">D</font
>t) V<sub>j</sub> +</td><td nowrap="nowrap" align="center">
<font face="symbol">D</font
>t<hr noshade="noshade" />2<br /></td><td nowrap="nowrap" align="center">
(<font face="symbol">s</font
><sup>2</sup>j<sup>2</sup> <font face="symbol">-</font
>rj) V<sub>j<font face="symbol">-</font
>1</sub></td></tr></table>
</td><td width="1%">(2)</td></tr></table>


which has been implemented in <font face="helvetica">JBONE</font> as:

<pre>
      double E      = runData.getInitialShapePosition(); //Exercise price
      double sigmaSq= diffusCo;                          //Volatility square
      double rate   = velocity;                          //Interest rate

      fp[0]=E*Math.exp(-rate*time);                      //Boundary condition
      for (int i=1; i&lt;n; i++) {
        fp[i]=f[i+1]* 0.5*timeStep*(sigmaSq*i*i +rate*i) //Explicit 2 levels
             +f[i  ]*(1.0-timeStep*(sigmaSq*i*i +rate  )) 
             +f[i-1]* 0.5*timeStep*(sigmaSq*i*i -rate*i);
      }
      fp[n]=fp[n-1]+dx[0]*(fp[n-1]-fp[n-2]);             //Boundary condition

</pre>

<p>
Press the <tt>Start/Stop</tt> button to start the (slow) integration backward 
in time. Try then to increase the time step by a factor 2: after only about 
40 steps, a numerical instability develops that can be traced down to a 
violation of the stability criterion <font face="symbol">s</font
><sup>2</sup><font face="symbol">D</font
>t/<font face="symbol">D</font
>x<sup>2</sup> &lt; 1/2.

<p>
The problem with this naive approach is that the random changes in the 
asset prices <font face="symbol">d</font
>S are in reality lognormally distributed, so that 
the natural mesh for the a random walk should in fact be equally spaced 
in logS rather than in S. The time step is therefore limited here 
by the largest asset price, where the relative mesh intervals <font face="symbol">D</font
>S 
is smallest.

<p>
To avoid instabilities and negative values appearing for large asset prices, 
it is possible to change from financial (S,t<font face="symbol">¢</font
>) to lognormal variables
(x,<font face="symbol">t</font
>) and evolve a standard diffusion equation.
An interpolation back to financial variable is in fact required only for 
diagnostic purposes. This has been implemented in <font face="helvetica">JBONE</font> as:

<pre>
      double E      = runData.getInitialShapePosition(); //Exercise price
      double sigmaSq= diffusCo;                          //Volatility square
      double rate   = velocity;                          //Interest rate
      double divid  = disperCo;                          //Dividend
      int    j;
      double x0, x1, f0, f1, xi;                         //Change variables
      double tau = 0.5*sigmaSq*time;                     //  f(x,t) -&#62;
      double dtau= 0.5*sigmaSq*timeStep;                 //  fm(xx,tau)
      double xx0 = Math.log(x[1]/E);
      double dxx =(Math.log(x[n]/E)-Math.log(x[1]/E))/(n-1);
      double k1 = 2*rate/sigmaSq; 
      double k2 = 2*(rate-divid)/sigmaSq; 
      double k2m1 = k2-1.;

      //Interpolate from financial (x,t) to lognormal variables (xx,tau)
      if (time &lt;=timeStep) {
        j=1; ; x0=xx0;
        f0=f[1]/E*Math.exp(0.5*k2m1*x0+(0.25*k2m1*k2m1+k1)*tau);
        x1=x0; f1=f0; xi=x0;
        for (int i=1; i&lt;n; i++) { //Loop over lognormal mesh index
          xi=xx0+(i-1)*dxx;
          while (xi&#62;=x1) { j++; x0=x1; f0=f1; x1=Math.log(x[j]/E); }
          f1=f[j]/E*Math.exp(0.5*k2m1*x1+(0.25*k2m1*k2m1+k1)*tau);
          fm[i]= f0 + (xi-x0)*(f1-f0)/(x1-x0);
        }
        fm[n]= fm[n-1] + dxx*(fm[n-1]-fm[n-2]);
      } else { //Retrieve fm[] from previous time step }    
      
 
      //Solve diffusion equation with an explicit 2 levels scheme
      double D = dtau/(dxx*dxx);
      for (int i=2; i&lt;n; i++) 
        f[i]= fm[i] + D*(fm[i+1]-2.*fm[i]+fm[i-1]);
      f[1]= Math.exp(0.5*k2m1*xx0+0.25*k2m1*k2m1*tau); //Boundary cond.
      f[n]= f[n-1] + dxx*(f[n-1]-f[n-2]);
      

      //Interpolate back from lognormal to financial mesh variables
      fp[0]=E*Math.exp(-rate*time);                    //Analytically
      j=1; x0=x[0]; x1=x0; f0=fp[0];
      xi=xx0; f1=f[1]*E/Math.exp(0.5*k2m1*xi+(0.25*k2m1*k2m1+k1)*tau);
      for (int i=1; i&lt;n; i++) { //Loop over financial mesh index
        while (x[i]&#62;=x1) 
          {j++;x0=x1;f0=f1;xi=xx0+(j-1)*dxx;x1=E*Math.exp(xi);}
        f1=f[j]*E/Math.exp(0.5*k2m1*xi+(0.25*k2m1*k2m1+k1)*tau);
        fp[i]= f0 + (x[i]-x0)/(x1-x0)*(f1-f0);
      }
      xi=Math.log(x[n]/E);
      fp[n]=f[n]*E/Math.exp(0.5*k2m1*xi+(0.25*k2m1*k2m1+k1)*tau);

</pre>
Using lognormal variables, the time step limit is then everywhere the same; 
the value can therefore be considerably larger and the problem with negative 
payoffs for large asset prices disappears.

<p>
Switch the selector from <tt>European naive</tt> to <tt>European vanilla</tt> 
and set <tt>TimeStep = 0.002</tt> to check this approach.
You can clearly see the numerical interpolation error induced by changing 
to lognormal variables after the first step; higher precision can of course
be achieved by refining the mesh, but keep in mind that you are still subject 
to the stability condition.

<p>
After these numerical considerations, you are now ready to calculate what was 
the price of your put option on May 24, 2000 (alt. today).

<ol type="1"><p>
<li> Edit the value of the
      
<ul><p>
<li> interest rate r<font face="symbol">®</font
> <tt>Velocity = 0.05</tt>,</li>
<p>
<li> volatility square <font face="symbol">s</font
><sup>2</sup> = 0.7155<sup>2</sup> = 0.512<font face="symbol">®</font
> 
            <tt>Diffusion = 0.512</tt>,</li>
<p>
<li> time to expiry of 98 days = 0.268 year <font face="symbol">®</font
> 
            <tt>Run time = 0.268</tt></li>
<p>
<li> strike price <font face="symbol">®</font
> <tt>Position = 95.</tt></li>
<p>
<li> largest asset price <font face="symbol">®</font
> <tt>Mesh length = 130.</tt></li>
</ul></li>
<p>
<li> Press <tt>Initialize</tt> and then <tt>Start/Stop</tt> for the calculation</li>
<p>
<li> Choose <tt>Data to java console</tt> in the applet top right selector,
      press <tt>Step 1</tt> and go back to <tt>Double click to edit below</tt></li>
<p>
<li> Open the java console (in  N<font size="-2">ETSCAPE</font>, 
      select <tt>Communicator-&#62;Tools-&#62;Java console</tt>)</li>
</ol>
With an underlying QQQ traded for S = 79.5 USD on the evening of May 24, 
2000, a nearest grid point approximation from <tt>x[79]=80.23</tt> shows 
that the price of the put option will be <tt>g[79]=14.77</tt> on September
1st, but was much higher <tt>f[79]=21.82</tt> because of the so-called 
<em>time value</em> associated with the market volatility.

<p>
This predicted value of 21.82 USD can finally be compared with the 
market value which was 20.875 on the evening of May 24, 2000
(alt. search for current market price for QQQ options under 
    <a href="http://quote.cboe.com/">this link</a>.
The agreement is certainly not a bad given the crude approximations 
made for the input parameters... and remember: the Black-Scholes is 
only a model of what the market really does!

<p>
      <br><p><applet codebase="<?php echo $user_dir ?>/applet/" code=jbone align=center width=780 height=400>
       <param name=Velocity            value=0.05>
       <param name=Diffusion           value=0.512>
       <param name=Dispersion          value=0.>
       <param name=TimeStep            value=0.0001>
       <param name=MeshPoints          value=128>
       <param name=Walkers             value=0>
       <param name=TimeImplicit        value=0.7>
       <param name=TuneIntegr          value=0.333>
       <param name=ICAmplitude         value=1.>
       <param name=ICPosition          value=95.>
       <param name=ICWidth             value=8.>
       <param name=ICWavelength        value=4.>
       <param name=RunTime             value=0.268>
       <param name=MeshLeft            value=0.>
       <param name=MeshLength          value=130.>
       <param name=PhysDataCase        value=1>
       <param name=PhysDataValue       value=1.>
       <param name=method              value="Finite differences">
       <param name=scheme              value="European naive">
       <param name=ic                  value="PutOption">
       <param name=pde                 value="Black-Scholes">
    </applet>
<br><p>
<br>Press <B>START/STOP</B> to first execute the <I>European naive</I> 
scheme using financial variables and a time step of <I>0.0001</I> (years) 
at the limit of numerical stability to integrate backward in time.
Switch to <I>European vanilla</I>, increasing the time step to <I>0.002</I>
years to calculate the solution in lognormal variables.
To evolve your own scheme instead of the demo, you can temporarily switch 
<I>Black-Scholes</I> to <I>Exercises</I> and 
<I>My scheme</I> to <I>Exercise 2.05</I>. 

<?php
echo "<br><hr><address>
<img SRC='../../images/previous_motif_gr.gif' border=0 align=bottom>
<a href='".$user_dir."/../../../SRC/assign.php'    onMouseover=\"window.status=' # assignments'; return true\">
<img SRC='../../images/up_motif_gr.gif' border=0 align=bottom></a>
<img SRC='../../images/next_motif_gr.gif' border=0 align=bottom>
<a href='".$user_dir."/../../../SYL/node1.php'    onMouseover=\"window.status=' # course'; return true\">
<img SRC='../../images/contents_motif.gif' border=0 align=bottom></a>
<i>&copy;&nbsp; 
Doc Andre Jaun &amp; <a href='http://pde.fusion.kth.se/'    onMouseover=\"window.status=' # home'; return true\">Lifelong-Learners/pde</a> at  22:24:08,  February 02nd, 2003</i></address>
</body>
</html>"; ?>
