(*********************************************************************** Mathematica-Compatible Notebook This notebook can be used on any computer system with Mathematica 3.0, MathReader 3.0, or any compatible application. The data for the notebook starts with the line of stars above. To get the notebook into a Mathematica-compatible application, do one of the following: * Save the data starting with the line of stars above into a file with a name ending in .nb, then open the file inside the application; * Copy the data starting with the line of stars above to the clipboard, then use the Paste menu command inside the application. Data for notebooks contains only printable 7-bit ASCII and can be sent directly in email or through ftp in text mode. Newlines can be CR, LF or CRLF (Unix, Macintosh or MS-DOS style). NOTE: If you modify the data for this notebook not in a Mathematica- compatible application, you must delete the line below containing the word CacheID, otherwise Mathematica-compatible applications may try to use invalid cache data. For more information on notebooks and Mathematica-compatible applications, contact Wolfram Research: web: http://www.wolfram.com email: info@wolfram.com phone: +1-217-398-0700 (U.S.) Notebook reader applications are available free of charge from Wolfram Research. ***********************************************************************) (*CacheID: 232*) (*NotebookFileLineBreakTest NotebookFileLineBreakTest*) (*NotebookOptionsPosition[ 32471, 1036]*) (*NotebookOutlinePosition[ 33333, 1066]*) (* CellTagsIndexPosition[ 33289, 1062]*) (*WindowFrame->Normal*) Notebook[{ Cell[TextData["BlackScholes.nb"], "Title", Evaluatable->False, CellHorizontalScrolling->False, TextAlignment->Center], Cell["Wilfrid S. Kendall", "Subtitle", Evaluatable->False, CellHorizontalScrolling->False, TextAlignment->Center], Cell[TextData[ "Statistics, University of Warwick, \nCoventry CV4 7AL, UK."], "Subsubtitle", Evaluatable->False, CellHorizontalScrolling->False, TextAlignment->Center], Cell[CellGroupData[{ Cell[TextData["Contact information:"], "SmallText", Editable->False, Evaluatable->False, FontFamily->"Times New Roman", FontSize->10, FontWeight->"Plain", FontSlant->"Plain", FontTracking->"Plain", FontColor->RGBColor[0.501961, 0, 0], Background->GrayLevel[1], FontVariations->{"Underline"->False, "Outline"->False, "Shadow"->False}], Cell[TextData["Email: w.s.kendall@warwick.ac.uk"], "Name", Editable->False, Evaluatable->False, CellHorizontalScrolling->False, FontFamily->"Times New Roman", FontSize->10, FontSlant->"Italic", FontColor->RGBColor[0, 0, 1], Background->GrayLevel[1]], Cell[TextData["URL: http://www.warwick.ac.uk/statsdept/Staff/WSK"], "Name", Editable->False, Evaluatable->False, CellHorizontalScrolling->False, FontFamily->"Times New Roman", FontSize->10, FontSlant->"Italic", FontColor->RGBColor[0, 0, 1], Background->GrayLevel[1]] }, Closed]], Cell[CellGroupData[{ Cell[TextData["Acknowledgements:"], "SmallText", Editable->False, Evaluatable->False, FontFamily->"Times New Roman", FontSize->10, FontWeight->"Plain", FontSlant->"Plain", FontTracking->"Plain", FontColor->RGBColor[0.501961, 0, 0], Background->GrayLevel[1], FontVariations->{"Underline"->False, "Outline"->False, "Shadow"->False}], Cell[TextData[ "The research reported here was supported by EPSRC grants GR/71677 \ (Stochastic calculus in AXIOM using modules of stochastic differentials) and \ GR/L56831 (Perfect simulation in stochastic geometry), and a joint \ EPSRC/BBSRC research grant (Multi-strain species modelling and control via \ differential algebra reductions). This Mathematica notebook was constructed \ on a visit to MSRI Berkeley CA during its 1997-1998 program Stochastic \ Analysis. Finally, it is a pleasure to expres my gratitude to my friends \ Suzanne Scotchmer and Joseph Farrell for the generous hospitality they showed \ to me during my visit to MSRI."], "SmallText", Editable->False, Evaluatable->False, FontFamily->"Times New Roman", FontSize->10, FontWeight->"Plain", FontSlant->"Plain", FontTracking->"Plain", FontColor->GrayLevel[0], Background->GrayLevel[1], FontVariations->{"Underline"->False, "Outline"->False, "Shadow"->False}] }, Closed]], Cell[TextData[ "Purpose: this is a Mathematica package (working under Mathematica3.0) which \ demonstrates a derivation of the Black-Scholes formula using Itovsn3."], "SmallText", Evaluatable->False, FontFamily->"Times New Roman", FontSize->10, FontSlant->"Italic", FontColor->GrayLevel[0], Background->GrayLevel[1]], Cell[CellGroupData[{ Cell[TextData["References:"], "SmallText", Evaluatable->False, FontFamily->"Times New Roman", FontSize->10, FontWeight->"Plain", FontSlant->"Plain", FontTracking->"Plain", FontColor->GrayLevel[0], Background->GrayLevel[1], FontVariations->{"Underline"->False, "Outline"->False, "Shadow"->False}], Cell[TextData[ "Discussion of applications of symbolic Ito calculus and related software to \ problems in Mathematical Finance:"], "SmallText", Evaluatable->False, FontFamily->"Times New Roman", FontSize->10, FontWeight->"Plain", FontSlant->"Plain", FontTracking->"Plain", FontColor->GrayLevel[0], Background->GrayLevel[1], FontVariations->{"Underline"->False, "Outline"->False, "Shadow"->False}], Cell[CellGroupData[{ Cell[TextData[ "Derivation of Black-Scholes formula using an implementation of diffusion \ theory in Mathematica:"], "SmallText", Evaluatable->False, FontFamily->"Times New Roman", FontSize->10, FontWeight->"Plain", FontSlant->"Plain", FontTracking->"Plain", FontColor->GrayLevel[0], Background->GrayLevel[1], FontVariations->{"Underline"->False, "Outline"->False, "Shadow"->False}], Cell[TextData[ "J.M. Steele and R.A. Stine: \"Mathematica and Diffusions\", in Economic and \ Financial Modeling with Mathematica, edited by H. Varian, Springer-Verlag, \ New York, pp 192-213 (1993)."], "SmallText", Evaluatable->False, FontFamily->"Times New Roman", FontSize->10, FontSlant->"Italic", FontColor->GrayLevel[0], Background->GrayLevel[1]] }, Closed]], Cell[CellGroupData[{ Cell[TextData[ "Derivation of Duffie-Richardson quadratic hedging formula using Itovsn3:"], "SmallText", Evaluatable->False, FontFamily->"Times New Roman", FontSize->10, FontWeight->"Plain", FontSlant->"Plain", FontTracking->"Plain", FontColor->GrayLevel[0], Background->GrayLevel[1], FontVariations->{"Underline"->False, "Outline"->False, "Shadow"->False}], Cell[TextData[ "WSK: \"Doing stochastic calculus with Mathematica\", in Economic and \ Financial Modeling with Mathematica, edited by H. Varian, Springer-Verlag, \ New York, pp 214-238 (1993)."], "SmallText", Evaluatable->False, FontFamily->"Times New Roman", FontSize->10, FontSlant->"Italic", FontColor->GrayLevel[0], Background->GrayLevel[1]] }, Closed]] }, Closed]], Cell[CellGroupData[{ Cell[TextData[ "This notebook assumes no previous definitions in the Mathematica workspace. \ If this is not the case, then quit Mathematica and restart.\n\nFirst we \ ensure that the Itovsn3 package is loaded. "], "Text", Evaluatable->False], Cell[BoxData[ \(\(Needs["\"]; \)\)], "Input", PageWidth->Infinity, FontFamily->"Courier New", FontSize->12, FontWeight->"Bold", FontColor->GrayLevel[0], Background->GrayLevel[1]] }, Open ]], Cell[CellGroupData[{ Cell[TextData[ "Initialize Itovsn3 and set up basic semimartingales"], "Section", Evaluatable->False], Cell[TextData[ "Initialize Itovsn3 and set up a real Brownian motion W to serve as the \ innovation process for the share price:"], "Text", Evaluatable->False], Cell[CellGroupData[{ Cell[BoxData[{ \(ItoReset[t, dt]\), \(\(BrownSingle[W, 0]; \)\)}], "Input", PageWidth->Infinity, FontFamily->"Courier New", FontSize->12, FontWeight->"Bold", FontColor->GrayLevel[0], Background->GrayLevel[1]], Cell[BoxData[ InterpretationBox[GridBox[{ {"\<\"Itovsn3 resetting ...\"\>"}, {"\<\"Itovsn3 initialized\"\>"}, { InterpretationBox[ \("with time semimartingale "\[InvisibleSpace]t\), SequenceForm[ "with time semimartingale ", t], Editable->False]}, { InterpretationBox[ \("and time differential "\[InvisibleSpace]dt\), SequenceForm[ "and time differential ", dt], Editable->False]} }, RowSpacings->1, ColumnSpacings->3, RowAlignments->Baseline, ColumnAlignments->{Left}], TableForm[ {"Itovsn3 resetting ...", "Itovsn3 initialized", SequenceForm[ "with time semimartingale ", t], SequenceForm[ "and time differential ", dt]}]]], "Output"] }, Open ]], Cell[TextData[ "Now we can use this to set up a geometric Brownian motion S to model the \ share price, together with a bond B which evolves in an entirely \ deterministic manner. "], "Text", Evaluatable->False, FontFamily->"Times New Roman", FontSize->12, FontWeight->"Plain", FontSlant->"Plain", FontTracking->"Plain", FontColor->GrayLevel[0], Background->GrayLevel[1], FontVariations->{"Underline"->False, "Outline"->False, "Shadow"->False}], Cell[CellGroupData[{ Cell[BoxData[{ \(alfa\ = \ \[Alpha]; \nmu\ = \ \[Mu]; \nsigma\ = \ \[Sigma]; \n SetAttributes[\[Sigma], Constant]\), \(SetAttributes[\[Mu], Constant]\), \(SetAttributes[\[Alpha], Constant]\), \(Itosde[S, dS == sigma\ S\ dW + mu\ S\ dt, 1]\), \(\(AddFixed[0, S, S0]; \)\), \(Itosde[B, dB == alfa\ B\ dt, 1]\), \(\(AddFixed[0, B, B0]; \)\), \(\(ItoStatus[]; \)\)}], "Input", PageWidth->Infinity], Cell[BoxData[ \("---------------"\)], "Print"], Cell[BoxData[ \("Summary of current structure of stochastic differentials"\)], "Print"], Cell[BoxData[ \("- - - - - - - -"\)], "Print"], Cell[BoxData[ \("Current second-order structure of semimartingale differentials:"\)], "Print"], Cell[BoxData[ TagBox[GridBox[{ {"\<\"\"\>", "dB", "dS", "dW", "dt"}, {"dB", "0", "0", "0", "0"}, {"dS", "0", \(dt\ S\^2\ \[Sigma]\^2\), \(dt\ S\ \[Sigma]\), "0"}, {"dW", "0", \(dt\ S\ \[Sigma]\), "dt", "0"}, {"dt", "0", "0", "0", "0"} }, RowSpacings->1, ColumnSpacings->3, RowAlignments->Baseline, ColumnAlignments->{Left}], (TableForm[ #, TableHeadings -> {{dB, dS, dW, dt}, {dB, dS, dW, dt}}]&)]], "Print"], Cell[BoxData[ \("- - - - - - - -"\)], "Print"], Cell[BoxData[ \("Current first-order structure of semimartingale differentials:"\)], "Print"], Cell[BoxData[ InterpretationBox[GridBox[{ {"dB", "dS", "dW", "dt"}, {\(B\ dt\ \[Alpha]\), \(dt\ S\ \[Mu]\), "0", "dt"} }, RowSpacings->3, ColumnSpacings->1, RowAlignments->Baseline, ColumnAlignments->{Left}], TableForm[ { Times[ B, dt, \[Alpha]], Times[ dt, S, \[Mu]], 0, dt}, TableDirections -> Row, TableHeadings -> {{dB, dS, dW, dt}, {"Drifts:"}}]]], "Print"], Cell[BoxData[ \("- - - - - - - -"\)], "Print"], Cell[BoxData[ \("Current initial values:"\)], "Print"], Cell[BoxData[ InterpretationBox[GridBox[{ {"B", "S", "W", "t"}, {"B0", "S0", "0", "0"} }, RowSpacings->3, ColumnSpacings->1, RowAlignments->Baseline, ColumnAlignments->{Left}], TableForm[ {B0, S0, 0, 0}, TableDirections -> Row, TableHeadings -> {{ B, S, W, t}, {"Initially:"}}]]], "Print"], Cell[BoxData[ \("---------------"\)], "Print"] }, Open ]] }, Open ]], Cell[CellGroupData[{ Cell[TextData["Construct self-financing trading strategy"], "Section", Evaluatable->False], Cell[TextData[ "We now consider a trading strategy, holding s[t] units of the share S \ and b[t] units of the bond B, where s and b are allowed to vary \ smoothly with time but we require the strategy to be exactly self-financing. \ We establish a substitution rule to replace V[S,t] by this self-financing \ trading strategy."], "Text", Evaluatable->False], Cell[CellGroupData[{ Cell[BoxData[{ \(\(Strategy = s[t]\ S + b[t]\ B; \)\), \(ValueDefinition = First[Solve[V[S, t] - Strategy == 0, b[t]]]\), \(SelfFinancing = First[Solve[\[PartialD]\_t s[t]\ S + \[PartialD]\_t b[t]\ B == 0, \[PartialD]\_t b[t]]]\)}], "Input", PageWidth->Infinity], Cell[BoxData[ \({b[t] \[Rule] \(\(-S\)\ s[t] + V[S, t]\)\/B}\)], "Output"], Cell[BoxData[ RowBox[{"{", RowBox[{ RowBox[{ SuperscriptBox["b", "\[Prime]", MultilineFunction->None], "[", "t", "]"}], "\[Rule]", RowBox[{"-", FractionBox[ RowBox[{"S", " ", RowBox[{ SuperscriptBox["s", "\[Prime]", MultilineFunction->None], "[", "t", "]"}]}], "B"]}]}], "}"}]], "Output"] }, Open ]] }, Open ]], Cell[CellGroupData[{ Cell[TextData["Stochastic analysis of trading strategy"], "Section", Evaluatable->False], Cell[TextData[ "Consider then the evolution of the value V[S,t] of the trading strategy \ over time: we know the following stochastic differential should be zero! \ Notice the self-financing condition means we know how to derive b[t] once \ a[t] is given."], "Text", Evaluatable->False], Cell[CellGroupData[{ Cell[BoxData[{ \(\(sd = ItoD[V[S, t] - Strategy]; \)\), \(SecondOrder = First[Solve[\((ItoExpand[sd\ dW] /. SelfFinancing)\) == 0, s[t]]]\), \(pde = Expand[\(\(\(Drift[sd] /. SelfFinancing\) /. ValueDefinition\) /. SecondOrder\)\/dt] == 0\)}], "Input", PageWidth->Infinity], Cell[BoxData[ RowBox[{"{", RowBox[{\(s[t]\), "\[Rule]", RowBox[{ SuperscriptBox["V", TagBox[\((1, 0)\), Derivative], MultilineFunction->None], "[", \(S, t\), "]"}]}], "}"}]], "Output"], Cell[BoxData[ RowBox[{ RowBox[{\(\(-\[Alpha]\)\ V[S, t]\), "+", RowBox[{ SuperscriptBox["V", TagBox[\((0, 1)\), Derivative], MultilineFunction->None], "[", \(S, t\), "]"}], "+", RowBox[{"S", " ", "\[Alpha]", " ", RowBox[{ SuperscriptBox["V", TagBox[\((1, 0)\), Derivative], MultilineFunction->None], "[", \(S, t\), "]"}]}], "+", RowBox[{\(1\/2\), " ", \(S\^2\), " ", \(\[Sigma]\^2\), " ", RowBox[{ SuperscriptBox["V", TagBox[\((2, 0)\), Derivative], MultilineFunction->None], "[", \(S, t\), "]"}]}]}], "==", "0"}]], "Output"] }, Open ]] }, Open ]], Cell[CellGroupData[{ Cell[TextData[ "Recasting problem in terms of innovation Brownian motion"], "Section", Evaluatable->False], Cell[TextData[ "We now have a linear second-order partial differential equation in V which \ we must solve. In principle one could write a solver for a class of equations \ including this example. However it seems more illuminating to proceed by a \ trial-and-error method.\n\nFirst observe that the argument S is constrained \ to be positive. This suggests we should re-cast the argument using the known \ solution of S in terms of its innovation W. First we check the solution \ (again, we could have built a solver!): "], "Text", Evaluatable->False], Cell[CellGroupData[{ Cell[BoxData[{ \(\(SS = Exp[sigma\ W + mu\ t - \(sigma\^2\ t\)\/2]; \)\), \(\(sd = ItoD[S - SS] /. S \[Rule] SS; \)\), \(Together[Drift[sd] /. S \[Rule] SS] == 0\), \(\((ItoExpand[sd\^2] /. S \[Rule] SS)\) == 0\)}], "Input", PageWidth->Infinity, FontFamily->"Courier New", FontSize->12, FontWeight->"Bold", FontColor->GrayLevel[0], Background->GrayLevel[1]], Cell[BoxData[ \(True\)], "Output"], Cell[BoxData[ \(True\)], "Output"] }, Open ]], Cell[TextData[ "Now we work through the derivation of the pde, but this time using SS not \ S, and viewing the value as V1[W,t] instead of V[S,t], in other words \ viewed as a function of W not of S: "], "Text", Evaluatable->False], Cell[CellGroupData[{ Cell[BoxData[{ \(\(Strategy = s[t]\ SS + b[t]\ B; \)\), \(\(ValueDefinition = First[Solve[V1[W, t] - Strategy == 0, b[t]]]; \)\), \(\(SelfFinancing = First[Solve[\[PartialD]\_t s[t]\ SS + \[PartialD]\_t b[t]\ B == 0, \[PartialD]\_t b[t]]]; \)\), \(\(sd = ItoD[V1[W, t] - Strategy]; \)\), \(\(SecondOrder = First[Solve[\((ItoExpand[sd\ dW] /. SelfFinancing)\) == 0, s[t]]]; \)\), \(pde = Expand[\(\(\(Drift[sd] /. SelfFinancing\) /. ValueDefinition\) /. SecondOrder\)\/dt] == 0\)}], "Input", PageWidth->Infinity, FontFamily->"Courier New", FontSize->12, FontWeight->"Bold", FontColor->GrayLevel[0], Background->GrayLevel[1]], Cell[BoxData[ RowBox[{ RowBox[{\(\(-\[Alpha]\)\ V1[W, t]\), "+", RowBox[{ SuperscriptBox["V1", TagBox[\((0, 1)\), Derivative], MultilineFunction->None], "[", \(W, t\), "]"}], "+", FractionBox[ RowBox[{"\[Alpha]", " ", RowBox[{ SuperscriptBox["V1", TagBox[\((1, 0)\), Derivative], MultilineFunction->None], "[", \(W, t\), "]"}]}], "\[Sigma]"], "-", FractionBox[ RowBox[{"\[Mu]", " ", RowBox[{ SuperscriptBox["V1", TagBox[\((1, 0)\), Derivative], MultilineFunction->None], "[", \(W, t\), "]"}]}], "\[Sigma]"], "+", RowBox[{\(1\/2\), " ", RowBox[{ SuperscriptBox["V1", TagBox[\((2, 0)\), Derivative], MultilineFunction->None], "[", \(W, t\), "]"}]}]}], "==", "0"}]], "Output"] }, Open ]] }, Open ]], Cell[CellGroupData[{ Cell[TextData["Further simplification using drift term"], "Section", Evaluatable->False], Cell[TextData[ "This is a considerable improvement, as we can now recognize an orthodox heat \ equation hiding in there. It looks like we can improve matters still further \ by adding in a drift term! We work with V2[WW,t] where WW = W - \ ((alfa-mu)/sigma)*t, instead of V1[W,t]:"], "Text", Evaluatable->False], Cell[CellGroupData[{ Cell[BoxData[{ \(WW = W - \(\((alfa - mu)\)\ t\)\/sigma\), \(\(Strategy = s[t]\ SS + b[t]\ B; \)\), \(\(ValueDefinition = First[Solve[V2[WW, t] - Strategy == 0, b[t]]]; \)\), \(\(SelfFinancing = First[Solve[\[PartialD]\_t s[t]\ SS + \[PartialD]\_t b[t]\ B == 0, \[PartialD]\_t b[t]]]; \)\), \(\(sd = ItoD[V2[WW, t] - Strategy]; \)\), \(\(SecondOrder = First[Solve[\((ItoExpand[sd\ dW] /. SelfFinancing)\) == 0, s[t]]]; \)\), \(pde = Expand[\(\(\(Drift[sd] /. SelfFinancing\) /. ValueDefinition\) /. SecondOrder\)\/dt] == 0\)}], "Input", PageWidth->Infinity, FontFamily->"Courier New", FontSize->12, FontWeight->"Bold", FontColor->GrayLevel[0], Background->GrayLevel[1]], Cell[BoxData[ \(W - \(t\ \((\[Alpha] - \[Mu])\)\)\/\[Sigma]\)], "Output"], Cell[BoxData[ RowBox[{ RowBox[{ \(\(-\[Alpha]\)\ V2[W - \(t\ \((\[Alpha] - \[Mu])\)\)\/\[Sigma], t]\), "+", RowBox[{ SuperscriptBox["V2", TagBox[\((0, 1)\), Derivative], MultilineFunction->None], "[", \(W - \(t\ \((\[Alpha] - \[Mu])\)\)\/\[Sigma], t\), "]"}], "+", RowBox[{\(1\/2\), " ", RowBox[{ SuperscriptBox["V2", TagBox[\((2, 0)\), Derivative], MultilineFunction->None], "[", \(W - \(t\ \((\[Alpha] - \[Mu])\)\)\/\[Sigma], t\), "]"}]}]}], "==", "0"}]], "Output"] }, Open ]] }, Open ]], Cell[CellGroupData[{ Cell[TextData["Further simplification using Feynman-Kac formalism"], "Section", Evaluatable->False], Cell[TextData[ "It looks as if we could get an even neater answer by adding in a multiplier \ to take out the -alfa V2 term (this is equivalent to using the Feynman-Kac \ trick). Thus we now work with VV = Exp[alfa*(t-t1)]*V3[WW,t] instead of \ V1[W,t] (so we are discounting relative to the value of the bond at time \ t1):"], "Text", Evaluatable->False], Cell[CellGroupData[{ Cell[BoxData[{ \(SetAttributes[t1, Constant]\), \(VV = Exp[alfa\ \((t - t1)\)]\ V3[WW, t]\), \(\(Strategy = s[t]\ SS + b[t]\ B; \)\), \(\(ValueDefinition = First[Solve[VV - Strategy == 0, b[t]]]; \)\), \(\(SelfFinancing = First[Solve[\[PartialD]\_t s[t]\ SS + \[PartialD]\_t b[t]\ B == 0, \[PartialD]\_t b[t]]]; \)\), \(\(sd = ItoD[VV - Strategy]; \)\), \(\(SecondOrder = First[Solve[\((ItoExpand[sd\ dW] /. SelfFinancing)\) == 0, s[t]]]; \)\), \(pde = Expand[\(\(\(Drift[sd] /. SelfFinancing\) /. ValueDefinition\) /. SecondOrder\)\/dt] == 0\)}], "Input", PageWidth->Infinity, FontFamily->"Courier New", FontSize->12, FontWeight->"Bold", FontColor->GrayLevel[0], Background->GrayLevel[1]], Cell[BoxData[ \(E\^\(\((t - t1)\)\ \[Alpha]\)\ V3[W - \(t\ \((\[Alpha] - \[Mu])\)\)\/\[Sigma], t]\)], "Output"], Cell[BoxData[ RowBox[{ RowBox[{ RowBox[{\(E\^\(\((t - t1)\)\ \[Alpha]\)\), " ", RowBox[{ SuperscriptBox["V3", TagBox[\((0, 1)\), Derivative], MultilineFunction->None], "[", \(W - \(t\ \((\[Alpha] - \[Mu])\)\)\/\[Sigma], t\), "]"}]}], "+", RowBox[{\(1\/2\), " ", \(E\^\(\((t - t1)\)\ \[Alpha]\)\), " ", RowBox[{ SuperscriptBox["V3", TagBox[\((2, 0)\), Derivative], MultilineFunction->None], "[", \(W - \(t\ \((\[Alpha] - \[Mu])\)\)\/\[Sigma], t\), "]"}]}]}], "==", "0"}]], "Output"] }, Open ]] }, Open ]], Cell[CellGroupData[{ Cell[TextData[ "Recognition of Brownian kernel and explicit solution"], "Section", Evaluatable->False], Cell[TextData[ "We can now recognize V3 as solving the Kolmogorov backwards differential \ equation solved by the well-known Brownian heat kernel. Consequently we know \ the general form for V3: integrals with respect to S1 and t1 of the \ following (and notice the option we establish so that this can be eventually \ rephrased in terms of the terminal share price S1 rather than the terminal \ innovation W1!):"], "Text", Evaluatable->False], Cell[CellGroupData[{ Cell[BoxData[{ \(TerminalShare = W1 \[Rule] \(Log[S1] - \((mu\ t - \(sigma\^2\ t\)\/2)\)\)\/sigma\), \(V3 = Exp[\(-\(\((#1 - \((W1 - \(\((alfa - mu)\)\ t1\)\/sigma)\))\)\^2\/\(2\ \((t1 - #2)\)\)\)\)]\/\@\(2\ \[Pi]\ \((t1 - #2)\)\)&\)}], "Input", PageWidth->Infinity], Cell[BoxData[ \(W1 \[Rule] \(\(-t\)\ \[Mu] + \(t\ \[Sigma]\^2\)\/2 + Log[S1]\)\/\[Sigma]\)], "Output"], Cell[BoxData[ \(Exp[ \(-\(\((#1 - \((W1 - \(\((alfa - mu)\)\ t1\)\/sigma)\))\)\^2\/\(2\ \((t1 - #2)\)\)\)\)]\/\@\(2\ \[Pi]\ \((t1 - #2)\)\)&\)], "Output"] }, Open ]] }, Open ]], Cell[CellGroupData[{ Cell[TextData["Verification of answer"], "Section", Evaluatable->False], Cell[TextData["Substituting back shows we have got the answer:"], "Text", Evaluatable->False], Cell[CellGroupData[{ Cell[BoxData[ \(Together[First[pde]] == 0\)], "Input", PageWidth->Infinity], Cell[BoxData[ \(True\)], "Output"] }, Open ]] }, Open ]], Cell[CellGroupData[{ Cell[TextData["Rewriting of solution in terms of share price S"], "Section", Evaluatable->False], Cell["\<\ So now we know the kernel which should be integrated (as a function of W1) \ to yield solutions to Black-Scholes-type problems. Notice that subject to \ regularity conditions such an integration yields solutions whatever function \ of W1 is integrated against the kernel. This allows us to derive \ self-financing strategies delivering arbitrary functions of W1 at time t1. Rewritten in terms of the current share price S the kernel is as follows \ (but note here that in Solve Mathematica 3.0 warns about multiple \ solutions!):\ \>", "Text", Evaluatable->False], Cell[CellGroupData[{ Cell[BoxData[ \(VV = \(VV /. First[Solve[SS == S, W]]\) /. Log[s_\^2] \[Rule] 2\ Log[s]\)], "Input", PageWidth->Infinity], Cell[BoxData[ \(Solve::"ifun" \( : \ \) "Inverse functions are being used by \!\(Solve\), so some solutions may \ not be found."\)], "Message"], Cell[BoxData[ \(E\^\(\((t - t1)\)\ \[Alpha] - \((\(-W1\) - \(t\ \((\[Alpha] - \[Mu])\)\)\/\[Sigma] + \(t1\ \((\[Alpha] - \[Mu])\)\)\/\[Sigma] - \(2\ t\ \[Mu] - t\ \[Sigma]\^2 - 2\ Log[S]\)\/\(2\ \[Sigma]\))\)\^2\/\(2\ \((\(-t\) + t1)\)\)\)\/\(\@\(2\ \[Pi]\)\ \@\(\(-t\) + t1\)\)\)], "Output"] }, Open ]] }, Open ]], Cell[CellGroupData[{ Cell[TextData["Analysis of value of option at time zero"], "Section", Evaluatable->False], Cell[TextData[ "We are principally interested in the value of this at time zero:"], "Text", Evaluatable->False], Cell[CellGroupData[{ Cell[BoxData[ \(InitialKernel = Simplify[InitialValue[0, VV]]\)], "Input", PageWidth->Infinity], Cell[BoxData[ \(E\^\(\(-t1\)\ \[Alpha] - \((t1\ \((\[Alpha] - \[Mu])\) - W1\ \[Sigma] + Log[S0])\)\^2\/\(2\ t1\ \[Sigma]\^2\)\)\/\(\@\(2\ \[Pi]\)\ \@t1\)\)], "Output"] }, Open ]], Cell[TextData[ "Using integration against W1, this tells us the value of the strategy we \ must start with at time 0 in order to achieve value f[S1] at time t1, \ since integration of the kernel multiplied by a function of S1 \ (equivalently, W1) against W1 still yields a solution of the partial \ differential equation, and therefore still yields a value process achievable \ by a self-financing strategy. We first compute the value of W1 required to \ obtain S1:"], "Text", Evaluatable->False], Cell[CellGroupData[{ Cell[BoxData[ \(S1 = \(SS /. W \[Rule] W1\) /. t \[Rule] t1\)], "Input", PageWidth->Infinity, FontFamily->"Courier New", FontSize->12, FontWeight->"Bold", FontColor->GrayLevel[0], Background->GrayLevel[1]], Cell[BoxData[ \(E\^\(t1\ \[Mu] + W1\ \[Sigma] - \(t1\ \[Sigma]\^2\)\/2\)\)], "Output"] }, Open ]], Cell[TextData[ "Thus the value required at time 0 to achieve f[S1] at time t1 is given \ by"], "Text", Evaluatable->False], Cell[CellGroupData[{ Cell[BoxData[ \(\[Integral]\_\(-\[Infinity]\)\%\[Infinity]\( f[S1]\ InitialKernel\) \[DifferentialD]W1\)], "Input", PageWidth->Infinity, FontFamily->"Courier New", FontSize->12, FontWeight->"Bold", FontColor->GrayLevel[0], Background->GrayLevel[1]], Cell[BoxData[ FractionBox[ RowBox[{ SubsuperscriptBox["\[Integral]", InterpretationBox[\(-\[Infinity]\), DirectedInfinity[ -1]], InterpretationBox["\[Infinity]", DirectedInfinity[ 1]]], \(\(E\^\(\(-t1\)\ \[Alpha] - \((t1\ \((\[Alpha] - \[Mu])\) - W1\ \[Sigma] + Log[S0])\)\^2 \/\(2\ t1\ \[Sigma]\^2\)\)\ f[E\^\(t1\ \[Mu] + W1\ \[Sigma] - \(t1\ \[Sigma]\^2\)\/2\)]\) \[DifferentialD]W1\)}], \(\@\(2\ \[Pi]\)\ \@t1\)]], "Output"] }, Open ]], Cell[TextData[ "This values the option f[S1] at time t1. Here is how it works if instead \ we value an option on buying the share at price Soption at time t1. \ Firstly we calculate the value Woption of W1 for a given option level \ Soption:"], "Text", Evaluatable->False], Cell[CellGroupData[{ Cell[BoxData[ \(OptionLevel = First[\(Solve[SS == Soption, W] /. W \[Rule] Woption\) /. t \[Rule] t1] /. Log[s_\^2] \[Rule] 2\ Log[s]\)], "Input", PageWidth->Infinity, FontFamily->"Courier New", FontSize->12, FontWeight->"Bold", FontColor->GrayLevel[0], Background->GrayLevel[1]], Cell[BoxData[ \(General::"spell1" \( : \ \) "Possible spelling error: new symbol name \"\!\(Woption\)\" is similar \ to existing symbol \"\!\(Soption\)\"."\)], "Message"], Cell[BoxData[ \(Solve::"ifun" \( : \ \) "Inverse functions are being used by \!\(Solve\), so some solutions may \ not be found."\)], "Message"], Cell[BoxData[ \({Woption \[Rule] \(-\(\(2\ t1\ \[Mu] - t1\ \[Sigma]\^2 - 2\ Log[Soption]\)\/\(2\ \[Sigma]\)\)\)}\)], "Output"] }, Open ]], Cell["\<\ Some coaching is required in the integration procedure, since Mathematica has \ no way of telling what is the sign of t1 and therefore fails to integrate \ to the limit at plus or minus Infinity! Note also that version 3.0 of \ Mathematica warns again about multiple solutions.\ \>", "Text", Evaluatable->False], Cell[CellGroupData[{ Cell[BoxData[ \(TotalInitial = \[Integral]\_Woption\%bbb\( Soption\ InitialKernel\) \[DifferentialD]W1 + \[Integral]\_\(-aaa\)\%Woption\( S1\ InitialKernel\) \[DifferentialD]W1 /. OptionLevel\)], "Input", PageWidth->Infinity, FontFamily->"Courier New", FontSize->12, FontWeight->"Bold", FontColor->GrayLevel[0], Background->GrayLevel[1]], Cell[BoxData[ \(\(-\(1\/2\)\)\ E\^\(\(-t1\)\ \[Alpha]\)\ Soption\ Erf[\(t1\ \((\[Alpha] - \[Mu])\) - bbb\ \[Sigma] + Log[S0]\)\/\(\@2\ \@t1\ \[Sigma]\)] + 1\/2\ S0\ Erf[ \(aaa\ \[Sigma] + t1\ \((\[Alpha] - \[Mu] + \[Sigma]\^2)\) + Log[S0]\)\/\(\@2\ \@t1\ \[Sigma]\)] + 1\/2\ E\^\(\(-t1\)\ \[Alpha]\)\ Soption\ Erf[\(t1\ \((\[Alpha] - \[Mu])\) + Log[S0] + 1\/2\ \((2\ t1\ \[Mu] - t1\ \[Sigma]\^2 - 2\ Log[Soption]) \)\)\/\(\@2\ \@t1\ \[Sigma]\)] - 1\/2\ S0\ Erf[ \(t1\ \((\[Alpha] - \[Mu] + \[Sigma]\^2)\) + Log[S0] + 1\/2\ \((2\ t1\ \[Mu] - t1\ \[Sigma]\^2 - 2\ Log[Soption]) \)\)\/\(\@2\ \@t1\ \[Sigma]\)]\)], "Output"] }, Open ]], Cell[TextData[ "We now have to make a careful set of simplifications so as to ensure \ Mathematica spots the special values of two of the Erf arguments (we also \ add some simplifications for tidying up the answer!)."], "Text", Evaluatable->False], Cell[CellGroupData[{ Cell[BoxData[ \(\(Simplify[ \(\(\(TotalInitial /. aaa \[Rule] xxx\ \@\(2\ t1\) - \(Log[S0] + \((alfa - mu)\)\ t1 + sigma\^2\ t1\)\/sigma \) /. bbb \[Rule] xxx\ \@\(2\ t1\) + \(Log[S0] + \((alfa - mu)\)\ t1\)\/sigma\) /. \@\(\[Pi]\ t1\) \[Rule] \(\@\[Pi]\ \@\(2\ t1\)\)\/\@2\) /. xxx \[Rule] \[Infinity]] /. Log[s_] - Log[t_] \[Rule] Log[s\/t]\) /. \@t1 \[Rule] \@\(2\ t1\)\/\@2\)], "Input", PageWidth->Infinity], Cell[BoxData[ \(\(-\(1\/2\)\)\ E\^\(\(-t1\)\ \[Alpha]\)\ \((\(-E\^\(t1\ \[Alpha]\)\)\ S0 - Soption + E\^\(t1\ \[Alpha]\)\ S0\ Erf[\(t1\ \((2\ \[Alpha] + \[Sigma]\^2)\) + 2\ Log[S0] - 2\ Log[Soption]\)\/\(2\ \@2\ \@t1\ \[Sigma]\)] + Soption\ Erf[ \(t1\ \((\(-2\)\ \[Alpha] + \[Sigma]\^2)\) - 2\ Log[S0] + 2\ Log[Soption]\)\/\(2\ \@2\ \@t1\ \[Sigma]\)])\)\)], "Output"] }, Open ]] }, Open ]], Cell[CellGroupData[{ Cell[TextData["Further Exercise"], "Subsubsection", Evaluatable->False, FontFamily->"Times New Roman", FontSize->10, FontWeight->"Bold", FontColor->GrayLevel[0], Background->GrayLevel[1]], Cell[TextData["Compute the amount S of share to be held at time 0"], "Text", Evaluatable->False] }, Open ]] }, FrontEndVersion->"Microsoft Windows 3.0", ScreenRectangle->{{0, 1024}, {0, 689}}, WindowToolbars->{}, CellGrouping->Manual, WindowSize->{996, 623}, WindowMargins->{{2, Automatic}, {Automatic, 2}}, PrivateNotebookOptions->{"ColorPalette"->{RGBColor, -1}}, ShowCellLabel->True, ShowCellTags->False, RenderingOptions->{"ObjectDithering"->True, "RasterDithering"->False} ] (*********************************************************************** Cached data follows. If you edit this Notebook file directly, not using Mathematica, you must remove the line containing CacheID at the top of the file. The cache data will then be recreated when you save this file from within Mathematica. ***********************************************************************) (*CellTagsOutline CellTagsIndex->{} *) (*CellTagsIndex CellTagsIndex->{} *) (*NotebookFileOutline Notebook[{ Cell[1709, 49, 123, 3, 105, "Title", Evaluatable->False], Cell[1835, 54, 119, 3, 64, "Subtitle", Evaluatable->False], Cell[1957, 59, 173, 4, 71, "Subsubtitle", Evaluatable->False], Cell[CellGroupData[{ Cell[2155, 67, 357, 12, 44, "SmallText", Evaluatable->False], Cell[2515, 81, 265, 8, 70, "Name", Evaluatable->False], Cell[2783, 91, 282, 8, 70, "Name", Evaluatable->False] }, Closed]], Cell[CellGroupData[{ Cell[3102, 104, 354, 12, 42, "SmallText", Evaluatable->False], Cell[3459, 118, 955, 21, 70, "SmallText", Evaluatable->False] }, Closed]], Cell[4429, 142, 331, 9, 42, "SmallText", Evaluatable->False], Cell[CellGroupData[{ Cell[4785, 155, 317, 11, 44, "SmallText", Evaluatable->False], Cell[5105, 168, 418, 13, 70, "SmallText", Evaluatable->False], Cell[CellGroupData[{ Cell[5548, 185, 404, 13, 70, "SmallText", Evaluatable->False], Cell[5955, 200, 364, 9, 70, "SmallText", Evaluatable->False] }, Closed]], Cell[CellGroupData[{ Cell[6356, 214, 382, 13, 70, "SmallText", Evaluatable->False], Cell[6741, 229, 357, 9, 70, "SmallText", Evaluatable->False] }, Closed]] }, Closed]], Cell[CellGroupData[{ Cell[7147, 244, 244, 4, 68, "Text", Evaluatable->False], Cell[7394, 250, 205, 7, 46, "Input"] }, Open ]], Cell[CellGroupData[{ Cell[7636, 262, 103, 2, 53, "Section", Evaluatable->False], Cell[7742, 266, 164, 3, 33, "Text", Evaluatable->False], Cell[CellGroupData[{ Cell[7931, 273, 229, 8, 66, "Input"], Cell[8163, 283, 884, 23, 72, "Output"] }, Open ]], Cell[9062, 309, 470, 14, 49, "Text", Evaluatable->False], Cell[CellGroupData[{ Cell[9557, 327, 441, 10, 230, "Input"], Cell[10001, 339, 50, 1, 25, "Print"], Cell[10054, 342, 91, 1, 25, "Print"], Cell[10148, 345, 50, 1, 25, "Print"], Cell[10201, 348, 101, 2, 25, "Print"], Cell[10305, 352, 519, 13, 87, "Print"], Cell[10827, 367, 50, 1, 25, "Print"], Cell[10880, 370, 100, 2, 25, "Print"], Cell[10983, 374, 460, 12, 48, "Print"], Cell[11446, 388, 50, 1, 25, "Print"], Cell[11499, 391, 58, 1, 25, "Print"], Cell[11560, 394, 369, 10, 48, "Print"], Cell[11932, 406, 50, 1, 25, "Print"] }, Open ]] }, Open ]], Cell[CellGroupData[{ Cell[12031, 413, 92, 1, 53, "Section", Evaluatable->False], Cell[12126, 416, 373, 6, 52, "Text", Evaluatable->False], Cell[CellGroupData[{ Cell[12524, 426, 296, 6, 70, "Input"], Cell[12823, 434, 78, 1, 42, "Output"], Cell[12904, 437, 417, 12, 42, "Output"] }, Open ]] }, Open ]], Cell[CellGroupData[{ Cell[13370, 455, 90, 1, 53, "Section", Evaluatable->False], Cell[13463, 458, 294, 5, 52, "Text", Evaluatable->False], Cell[CellGroupData[{ Cell[13782, 467, 318, 7, 83, "Input"], Cell[14103, 476, 253, 7, 29, "Output"], Cell[14359, 485, 754, 20, 42, "Output"] }, Open ]] }, Open ]], Cell[CellGroupData[{ Cell[15162, 511, 108, 2, 53, "Section", Evaluatable->False], Cell[15273, 515, 561, 8, 109, "Text", Evaluatable->False], Cell[CellGroupData[{ Cell[15859, 527, 388, 10, 123, "Input"], Cell[16250, 539, 38, 1, 29, "Output"], Cell[16291, 542, 38, 1, 29, "Output"] }, Open ]], Cell[16344, 546, 244, 4, 33, "Text", Evaluatable->False], Cell[CellGroupData[{ Cell[16613, 554, 721, 19, 159, "Input"], Cell[17337, 575, 1041, 30, 44, "Output"] }, Open ]] }, Open ]], Cell[CellGroupData[{ Cell[18427, 611, 90, 1, 53, "Section", Evaluatable->False], Cell[18520, 614, 318, 5, 52, "Text", Evaluatable->False], Cell[CellGroupData[{ Cell[18863, 623, 772, 20, 194, "Input"], Cell[19638, 645, 77, 1, 42, "Output"], Cell[19718, 648, 658, 18, 42, "Output"] }, Open ]] }, Open ]], Cell[CellGroupData[{ Cell[20425, 672, 101, 1, 53, "Section", Evaluatable->False], Cell[20529, 675, 364, 6, 52, "Text", Evaluatable->False], Cell[CellGroupData[{ Cell[20918, 685, 792, 20, 199, "Input"], Cell[21713, 707, 122, 2, 42, "Output"], Cell[21838, 711, 686, 18, 42, "Output"] }, Open ]] }, Open ]], Cell[CellGroupData[{ Cell[22573, 735, 104, 2, 53, "Section", Evaluatable->False], Cell[22680, 739, 456, 7, 71, "Text", Evaluatable->False], Cell[CellGroupData[{ Cell[23161, 750, 315, 7, 125, "Input"], Cell[23479, 759, 116, 3, 53, "Output"], Cell[23598, 764, 190, 4, 70, "Output"] }, Open ]] }, Open ]], Cell[CellGroupData[{ Cell[23837, 774, 73, 1, 53, "Section", Evaluatable->False], Cell[23913, 777, 95, 1, 33, "Text", Evaluatable->False], Cell[CellGroupData[{ Cell[24033, 782, 81, 2, 30, "Input"], Cell[24117, 786, 38, 1, 29, "Output"] }, Open ]] }, Open ]], Cell[CellGroupData[{ Cell[24204, 793, 99, 1, 53, "Section", Evaluatable->False], Cell[24306, 796, 586, 11, 90, "Text", Evaluatable->False], Cell[CellGroupData[{ Cell[24917, 811, 137, 4, 30, "Input"], Cell[25057, 817, 154, 3, 25, "Message"], Cell[25214, 822, 381, 6, 78, "Output"] }, Open ]] }, Open ]], Cell[CellGroupData[{ Cell[25644, 834, 91, 1, 53, "Section", Evaluatable->False], Cell[25738, 837, 113, 2, 33, "Text", Evaluatable->False], Cell[CellGroupData[{ Cell[25876, 843, 101, 2, 30, "Input"], Cell[25980, 847, 197, 3, 62, "Output"] }, Open ]], Cell[26192, 853, 513, 8, 71, "Text", Evaluatable->False], Cell[CellGroupData[{ Cell[26730, 865, 221, 7, 46, "Input"], Cell[26954, 874, 90, 1, 38, "Output"] }, Open ]], Cell[27059, 878, 130, 3, 33, "Text", Evaluatable->False], Cell[CellGroupData[{ Cell[27214, 885, 273, 8, 56, "Input"], Cell[27490, 895, 561, 12, 77, "Output"] }, Open ]], Cell[28066, 910, 287, 5, 52, "Text", Evaluatable->False], Cell[CellGroupData[{ Cell[28378, 919, 315, 9, 46, "Input"], Cell[28696, 930, 181, 3, 25, "Message"], Cell[28880, 935, 154, 3, 25, "Message"], Cell[29037, 940, 156, 3, 44, "Output"] }, Open ]], Cell[29208, 946, 327, 6, 52, "Text", Evaluatable->False], Cell[CellGroupData[{ Cell[29560, 956, 401, 11, 60, "Input"], Cell[29964, 969, 779, 14, 143, "Output"] }, Open ]], Cell[30758, 986, 251, 4, 33, "Text", Evaluatable->False], Cell[CellGroupData[{ Cell[31034, 994, 598, 13, 54, "Input"], Cell[31635, 1009, 468, 9, 50, "Output"] }, Open ]] }, Open ]], Cell[CellGroupData[{ Cell[32152, 1024, 199, 6, 56, "Subsubsection", Evaluatable->False], Cell[32354, 1032, 101, 1, 33, "Text", Evaluatable->False] }, Open ]] } ] *) (*********************************************************************** End of Mathematica Notebook file. ***********************************************************************)