(************** Content-type: application/mathematica ************** CreatedBy='Mathematica 4.2' Mathematica-Compatible Notebook This notebook can be used with any Mathematica-compatible application, such as Mathematica, MathReader or Publicon. The data for the notebook starts with the line containing 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[ 80737, 2867]*) (*NotebookOutlinePosition[ 82755, 2926]*) (* CellTagsIndexPosition[ 82408, 2914]*) (*WindowFrame->Normal*) Notebook[{ Cell[CellGroupData[{ Cell[TextData[{ "A Guide to ", StyleBox["ItosLemma", FontFamily->"Courier New"] }], "Title"], Cell[TextData[{ "A ", StyleBox["Mathematica", FontSlant->"Italic"], " package that implements Ito's Lemma for stochastic calculus" }], "Subtitle"], Cell["by Mark Fisher", "Subtitle"], Cell["Revised April 2003", "Subsubtitle"], Cell["\<\ Financial Economist and Associate Policy Advisor Research Department Federal Reserve Bank of Atlanta 1000 Peachtree Street, N.E. Atlanta, GA 30309-4470 mark@markfisher.net http://www.markfisher.net/~mefisher/\ \>", "Subsubtitle"], Cell[CellGroupData[{ Cell["What is Ito's lemma?", "Section"], Cell[TextData[{ "An Ito process can be thought of as a stochastic differential equation \ (SDE). Ito's lemma provides the rules for computing the Ito process of a \ function of Ito processes. In other words, it is the formula for computing \ stochastic derivatives. For example, given the stochastic differential \ equation ", Cell[BoxData[ \(TraditionalForm\`d\[InvisibleSpace]x\ = \ \[Mu]\ d\[InvisibleSpace]t\ \ + \ \[Sigma]\ d\[InvisibleSpace]B\)]], " and the (suitably smooth) function ", Cell[BoxData[ \(TraditionalForm\`f(x, t)\)]], ", the SDE for ", Cell[BoxData[ \(TraditionalForm\`y(t)\ = f(x(t), t)\)]], " is ", Cell[BoxData[ \(TraditionalForm\`d\[InvisibleSpace]y\ = \ \((\(f\_t\)(x, t)\ + \ \(\(f\_x\)(x, t)\) \[Mu]\ + \(\(f\_\(x\[InvisibleSpace]x\)\)(x, t)\)\ \(1\/2\) \[Sigma]\^2)\) d\[InvisibleSpace]t\ + \ \(\(f\_x\)(x, t)\) \[Sigma]\ d\[InvisibleSpace]B\)], TextAlignment->Left, TextJustification->0], ". \nThis package will compute Ito's formula for arbitrary functions of an \ arbitrary number of Ito processes with an arbitrary number of Brownians. The \ Brownians may have an arbitrary correlation matrix.\n\nFor a reasonably \ accessible introduction to SDEs, see Bernt \[CapitalOSlash]ksendal, ", StyleBox["Stochastic Differential Equations: An Introduction with \ Applications", FontSlant->"Italic"], ", Springer-Verlag (currently in its 5th edition). The latest edition of \ \[CapitalOSlash]ksendal has a chapter of applications to finance. See also \ Darrell Duffie, ", StyleBox["Dynamic Asset Pricing Theory", FontSlant->"Italic"], ", Princeton University Press (currently in its 3rd edition) for many \ applications of Ito's lemma to finance." }], "Text"], Cell[CellGroupData[{ Cell["\<\ A brief explanation of the code. (You don't need to read this.)\ \>", "Subsection"], Cell[TextData[{ "Ito's lemma itself (as a mathematical formula) is quite simple. The main \ programming challenge is to identify the Ito processes in the given \ expression and determine their drifts and diffusions. Below, I discuss two \ possible paradigms. The code in the package ", StyleBox["ItosLemma.m", FontFamily->"Courier New", FontWeight->"Bold"], " follows the second paradigm." }], "Text"], Cell[CellGroupData[{ Cell["First paradigm", "Subsubsection"], Cell["\<\ Ideally, the syntax for an Ito derivative would parallel that for an ordinary \ derivative. For example,\ \>", "Text"], Cell[BoxData[ \(ItoD[expression, \ arguments]\)], "Input", Evaluatable->False], Cell["\<\ where the expression is to be \"differentiated\" with respect to the \ arguments. In principle, the arguments would be the Ito processes (including \ the time argument). However, the drifts and diffusions would still need to be \ specified. It would be possible to use the following syntax:\ \>", "Text"], Cell[BoxData[ \(\(\(ItoD[f[x, t], \ ItoProcess[x, \[Mu]\_x, \[Sigma]\_x], \ ItoProcess[t, 1, 0]]\)\(\ \)\)\)], "Input", Evaluatable->False], Cell[TextData[{ "where ItoProcess[x,\[Mu],\[Sigma]] specifies that ", Cell[BoxData[ \(TraditionalForm\`x\)]], " is an Ito process with drift ", Cell[BoxData[ \(TraditionalForm\`\[Mu]\)]], " and diffusion ", Cell[BoxData[ \(TraditionalForm\`\[Sigma]\)]], " and ItoProcess[t,1,0] specifies that ", Cell[BoxData[ \(TraditionalForm\`t\)]], " is Ito process with drift 1 and diffusion 0 (i.e., ", Cell[BoxData[ \(TraditionalForm\`t\)]], " is time). ItoD could return an ''anonymous'' Ito process such as" }], "Text"], Cell[BoxData[ RowBox[{"ItoProcess", "[", RowBox[{ RowBox[{ RowBox[{ SuperscriptBox["f", TagBox[\((0, 1)\), Derivative], MultilineFunction->None], "[", \(x, t\), "]"}], "+", RowBox[{\(\[Mu]\_x\), " ", RowBox[{ SuperscriptBox["f", TagBox[\((1, 0)\), Derivative], MultilineFunction->None], "[", \(x, t\), "]"}]}], "+", RowBox[{\(1\/2\), " ", \(\[Sigma]\_x\%2\), " ", RowBox[{ SuperscriptBox["f", TagBox[\((2, 0)\), Derivative], MultilineFunction->None], "[", \(x, t\), "]"}]}]}], ",", RowBox[{\(\[Sigma]\_x\), " ", RowBox[{ SuperscriptBox["f", TagBox[\((1, 0)\), Derivative], MultilineFunction->None], "[", \(x, t\), "]"}]}]}], "]"}]], "Input", Evaluatable->False], Cell["\<\ The third argument in ItoProcess could be a vector. In addition, an option to \ ItoD could control how the correlations among the Brownian motions are \ treated.\ \>", "Text"] }, Closed]], Cell[CellGroupData[{ Cell["Second paradigm", "Subsubsection"], Cell[TextData[{ "\tThe code in ", StyleBox["ItosLemma.m", FontFamily->"Courier New", FontWeight->"Bold"], " takes a different route. Instead of passing an ItoProcess object as an \ argument to ItoD, one declares in advance that ", Cell[BoxData[ \(TraditionalForm\`x\)]], " is an Ito process with given drift and diffusion. In addition, global \ variables are used to identify time and other things. The three central \ global variables are TimeSymbol, TimeIncrement, and BrownianIncrement. \ Ordinarily, one would define convenient abbreviations using symbols that are \ not otherwise in use, such as t, dt, and dB. " }], "Text"], Cell[TextData[{ "\tTo declare ", Cell[BoxData[ \(TraditionalForm\`x\)]], " to be an Ito process with drift ", Cell[BoxData[ \(TraditionalForm\`\[Mu]\)]], " and diffusion ", Cell[BoxData[ \(TraditionalForm\`\[Sigma]\)]], ", use" }], "Text"], Cell[CellGroupData[{ Cell[BoxData[ \(ItoMake[x[t], \[Mu], \[Sigma]]\)], "Input"], Cell[BoxData[ \(dt\ \[Mu] + \[Sigma]\ dB\_1\)], "Output"] }, Closed]], Cell["which stores the following rule:", "Text"], Cell[CellGroupData[{ Cell[BoxData[ \(x[t + dt]\ = \ x[t]\ + \ \[Mu]\ dt\ + \ \[Sigma]\ dB\_1\)], "Input"], Cell[BoxData[ \(dt\ \[Mu] + \[Sigma]\ dB\_1 + x[t]\)], "Output"] }, Closed]], Cell[TextData[{ "Note the rule will only match ", Cell[BoxData[ \(TraditionalForm\`x[t + dt]\)]], " and nothing else; there are no underscores on the left-hand side. " }], "Text"], Cell[TextData[{ "\tProgramming note: ItoMake allows the user to redeclare ", Cell[BoxData[ \(TraditionalForm\`x\)]], " as an Ito process without clearing the previous definition by \ constructing and executing the following:" }], "Text"], Cell[CellGroupData[{ Cell[BoxData[ \(Set\ @@ \ Hold[x[t + dt], \ x[t]\ + \ \[Mu]\ dt\ + \ \[Sigma]\ dB\_1]\)], "Input"], Cell[BoxData[ \(dt\ \[Mu] + \[Sigma]\ dB\_1 + x[t]\)], "Output"] }, Closed]], Cell[TextData[{ "\tHaving declared that ", Cell[BoxData[ \(TraditionalForm\`x\)]], " is an Ito process via this route, we are free to use ItoD on any \ expression containing ", Cell[BoxData[ \(TraditionalForm\`x\)]], ". " }], "Text"], Cell["To see how ItoD works, consider the following expression:", "Text"], Cell[CellGroupData[{ Cell[BoxData[ \(expr\ = \ f[x[t], t]\)], "Input"], Cell[BoxData[ \(f[x[t], t]\)], "Output"] }, Closed]], Cell["\<\ To identify the Ito processes in the expression, substitute t+dt for t:\ \>", "Text"], Cell[CellGroupData[{ Cell[BoxData[ \(dtexpr\ = \ expr\ /. \ t \[Rule] t + dt\)], "Input"], Cell[BoxData[ \(f[dt\ \[Mu] + \[Sigma]\ dB\_1 + x[t], dt + t]\)], "Output"] }, Closed]], Cell["\<\ The rule matches for those symbols (and only those symbols) that have \ previously been declared Ito processes (including time, which has been \ declared implicitly). \ \>", "Text"], Cell["\<\ Now we can compute the Ito-Taylor series for the expression. We need the \ first derivative with respect to the time increment and the first two \ derivatives with respect to the Brownian increment:\ \>", "Text"], Cell[CellGroupData[{ Cell[BoxData[ \(derivatives = \((\(D[dtexpr, \ #] &\) /@ {dt, \ dB\_1, \ {dB\_1, 2}})\)\ /. \ dB\_1 | dt\ \[Rule] \ 0\)], "Input"], Cell[BoxData[ RowBox[{"{", RowBox[{ RowBox[{ RowBox[{ SuperscriptBox["f", TagBox[\((0, 1)\), Derivative], MultilineFunction->None], "[", \(x[t], t\), "]"}], "+", RowBox[{"\[Mu]", " ", RowBox[{ SuperscriptBox["f", TagBox[\((1, 0)\), Derivative], MultilineFunction->None], "[", \(x[t], t\), "]"}]}]}], ",", RowBox[{"\[Sigma]", " ", RowBox[{ SuperscriptBox["f", TagBox[\((1, 0)\), Derivative], MultilineFunction->None], "[", \(x[t], t\), "]"}]}], ",", RowBox[{\(\[Sigma]\^2\), " ", RowBox[{ SuperscriptBox["f", TagBox[\((2, 0)\), Derivative], MultilineFunction->None], "[", \(x[t], t\), "]"}]}]}], "}"}]], "Output"] }, Closed]], Cell[TextData[{ "With these derivatives, we construct the series using the Ito \ \"multiplication rule\" ", Cell[BoxData[ \(TraditionalForm\`dB\_1\%2 \[Rule] dt\)]], ":" }], "Text"], Cell[CellGroupData[{ Cell[BoxData[ \(Collect[ derivatives . {dt, \ dB\_1, 1\/2\ dB\_1\%2}\ /. \ dB\_1\%2 \[Rule] dt, \ dt]\)], "Input"], Cell[BoxData[ RowBox[{ RowBox[{"\[Sigma]", " ", \(dB\_1\), " ", RowBox[{ SuperscriptBox["f", TagBox[\((1, 0)\), Derivative], MultilineFunction->None], "[", \(x[t], t\), "]"}]}], "+", RowBox[{"dt", " ", RowBox[{"(", RowBox[{ RowBox[{ SuperscriptBox["f", TagBox[\((0, 1)\), Derivative], MultilineFunction->None], "[", \(x[t], t\), "]"}], "+", RowBox[{"\[Mu]", " ", RowBox[{ SuperscriptBox["f", TagBox[\((1, 0)\), Derivative], MultilineFunction->None], "[", \(x[t], t\), "]"}]}], "+", RowBox[{\(1\/2\), " ", \(\[Sigma]\^2\), " ", RowBox[{ SuperscriptBox["f", TagBox[\((2, 0)\), Derivative], MultilineFunction->None], "[", \(x[t], t\), "]"}]}]}], ")"}]}]}]], "Output"] }, Closed]] }, Closed]] }, Closed]] }, Closed]], Cell[CellGroupData[{ Cell["Load the package", "Section"], Cell[BoxData[{ \(Off[General::spell]\), "\[IndentingNewLine]", \(Off[General::spell1]\)}], "Input"], Cell[TextData[{ "You should put ", StyleBox["ItosLemma.m", FontFamily->"Courier New", FontWeight->"Bold"], " in a directory in the ", StyleBox["$Path", FontFamily->"Courier New", FontWeight->"Bold"], " (or add the directory where ", StyleBox["ItosLemma.m", FontFamily->"Courier New", FontWeight->"Bold"], " is located to the ", StyleBox["$Path", FontFamily->"Courier New", FontWeight->"Bold"], ")." }], "Text"], Cell[BoxData[ \(<< ItosLemma`\)], "Input"], Cell[CellGroupData[{ Cell[BoxData[ \(\(?ItosLemma\)\)], "Input"], Cell[BoxData[ \("ItosLemma.m is a package that implements Ito's Lemma. The package uses \ six global symbols: TimeSymbol, TimeIncrement, BrownianIncrement, \ CorrelationSymbol, DriftSymbol, and DiffusionSymbol. They can be defined in \ terms of more convenient symbols.\n Example:\n Clear[t, dt, dB, \[Rho], \ \[Mu], \[Sigma]];\n {TimeSymbol, TimeIncrement, BrownianIncrement, \ CorrelationSymbol, DriftSymbol, DiffusionSymbol} = {t, dt, dB, \[Rho], \[Mu], \ \[Sigma]}"\)], "Print", CellTags->"Info3260169726-5396987"] }, Closed]], Cell["Set the global symbols to convenient symbols:", "Text"], Cell[CellGroupData[{ Cell[BoxData[ \({TimeSymbol, TimeIncrement, BrownianIncrement, CorrelationSymbol, DriftSymbol, DiffusionSymbol} = {t, dt, dB, \[Rho], \[Mu], \[Sigma]}\)], "Input"], Cell[BoxData[ \({t, dt, dB, \[Rho], \[Mu], \[Sigma]}\)], "Output"] }, Closed]], Cell["List of all of the symbols defined in the package:", "Text"], Cell[CellGroupData[{ Cell[BoxData[ \(Names["\"]\)], "Input"], Cell[BoxData[ \({"BrownianIncrement", "BrownianList", "CorrelationSymbol", "Diffusion", "DiffusionSymbol", "Drift", "DriftSymbol", "ExponentialItoMake", "ExponentialItoMakeFromItoD", "IncludeArguments", "ItoD", "ItoMake", "ItoMakeFromItoD", "ItosLemma", "OrthogonalBrownians", "RelativeItoD", "RelativeItoMake", "RelativeItoMakeFromItoD", "Scalarize", "SuppressTime", "TimeIncrement", "TimeSymbol", "VectorItoMake"}\)], "Output"] }, Closed]], Cell["Some usage statements", "Text"], Cell[CellGroupData[{ Cell[BoxData[ \(\(?ItoMake\)\)], "Input"], Cell[BoxData[ \("ItoMake[x[args], mu, sigma] associates a rule with the (ultimate) head \ of the x[args]. The TimeSymbol should be one of the arguments; for example, \ ItoMake[x[t], \[Mu], \[Sigma]]. For multiple Brownians, sigma may be a list."\ \)], "Print", CellTags->"Info3260169726-1863836"] }, Closed]], Cell[CellGroupData[{ Cell[BoxData[ \(\(?ItoD\)\)], "Input"], Cell[BoxData[ \("ItoD[expr] applies Ito's lemma to expr. ItoD takes the option \ OrthogonalBrownians."\)], "Print", CellTags->"Info3260169726-5767607"] }, Closed]], Cell[CellGroupData[{ Cell[BoxData[ \(\(?Drift\)\)], "Input"], Cell[BoxData[ \("Drift[expr] returns the drift of an Ito process."\)], "Print", CellTags->"Info3260169726-1807366"] }, Closed]], Cell[CellGroupData[{ Cell[BoxData[ \(\(?Diffusion\)\)], "Input"], Cell[BoxData[ \("Diffusion[expr] returns the diffusion of an Ito process. Diffusion \ takes the options BrownianList and Scalarize."\)], "Print", CellTags->"Info3260169726-8451177"] }, Closed]] }, Closed]], Cell[CellGroupData[{ Cell["Introductory examples", "Section", CellDingbat->"\[FilledSquare]", ShowGroupOpenCloseIcon->False], Cell[CellGroupData[{ Cell["Getting started", "Subsection"], Cell[CellGroupData[{ Cell[TextData[{ "The canonical example: Find ", Cell[BoxData[ \(TraditionalForm\`d\[InvisibleSpace]y\)]], " where ", Cell[BoxData[ \(TraditionalForm\`y\ = \ f(x, t)\)]], " and ", Cell[BoxData[ \(TraditionalForm\`d\[InvisibleSpace]x\ = \ \[Mu]\ d\[InvisibleSpace]t\ \ + \ \[Sigma]\ d\[InvisibleSpace]W\)]], "." }], "Subsubsection"], Cell[CellGroupData[{ Cell[BoxData[{ \(Clear[x, y, f]\), "\n", \(dx\ = \ ItoMake[x[t], \ \[Mu], \ \[Sigma]]\)}], "Input"], Cell[BoxData[ \(dt\ \[Mu] + \[Sigma]\ dB\_1\)], "Output"] }, Closed]], Cell[TextData[{ "In this case, ", StyleBox["ItoMake", FontFamily->"Courier New", FontWeight->"Bold"], " stores a rule with ", Cell[BoxData[ \(TraditionalForm\`x\)]], ":" }], "Text"], Cell[CellGroupData[{ Cell[BoxData[ \(\(?x\)\)], "Input"], Cell["Global`x", "Print", CellTags->"Info3260169726-8573689"], Cell[BoxData[ InterpretationBox[GridBox[{ {GridBox[{ {\(x[dt + t] = dt\ \[Mu] + \[Sigma]\ "Subscript"[dB, 1] + x[t]\)} }, GridBaseline->{Baseline, {1, 1}}, ColumnWidths->0.999, ColumnAlignments->{Left}]} }, GridBaseline->{Baseline, {1, 1}}, ColumnAlignments->{Left}], Definition[ "x"], Editable->False]], "Print", CellTags->"Info3260169726-8573689"] }, Closed]], Cell[TextData[{ "The drift and diffusion can be extracted from ", Cell[BoxData[ \(TraditionalForm\`d\[InvisibleSpace]x\)]], ":" }], "Text"], Cell[CellGroupData[{ Cell[BoxData[ \(Drift[dx]\)], "Input"], Cell[BoxData[ \(\[Mu]\)], "Output"] }, Closed]], Cell[CellGroupData[{ Cell[BoxData[ \(Diffusion[dx]\)], "Input"], Cell[BoxData[ \(\[Sigma]\)], "Output"] }, Closed]], Cell["Now let's compute the stochastic derivative:", "Text"], Cell[CellGroupData[{ Cell[BoxData[{ \(y\ = \ f[x[t], \ t]\), "\n", \(ItoD[y]\)}], "Input"], Cell[BoxData[ \(f[x[t], t]\)], "Output"], Cell[BoxData[ RowBox[{ RowBox[{"\[Sigma]", " ", \(dB\_1\), " ", RowBox[{ SuperscriptBox["f", TagBox[\((1, 0)\), Derivative], MultilineFunction->None], "[", \(x, t\), "]"}]}], "+", RowBox[{"dt", " ", RowBox[{"(", RowBox[{ RowBox[{ SuperscriptBox["f", TagBox[\((0, 1)\), Derivative], MultilineFunction->None], "[", \(x, t\), "]"}], "+", RowBox[{"\[Mu]", " ", RowBox[{ SuperscriptBox["f", TagBox[\((1, 0)\), Derivative], MultilineFunction->None], "[", \(x, t\), "]"}]}], "+", RowBox[{\(1\/2\), " ", \(\[Sigma]\^2\), " ", RowBox[{ SuperscriptBox["f", TagBox[\((2, 0)\), Derivative], MultilineFunction->None], "[", \(x, t\), "]"}]}]}], ")"}]}]}]], "Output"] }, Closed]], Cell[TextData[{ "By default, ", StyleBox["ItoD", FontFamily->"Courier New", FontWeight->"Bold"], " removes the dependence of ", Cell[BoxData[ \(TraditionalForm\`x\)]], " on ", Cell[BoxData[ \(TraditionalForm\`t\)]], " in the output. This behavior can be over-ridden with the option ", StyleBox["SuppressTime", FontFamily->"Courier New", FontWeight->"Bold"] }], "Text"], Cell[CellGroupData[{ Cell[BoxData[ \(Options[ItoD]\)], "Input"], Cell[BoxData[ \({OrthogonalBrownians \[Rule] True, SuppressTime \[Rule] True}\)], "Output"] }, Closed]], Cell[CellGroupData[{ Cell[BoxData[ \(dy\ = \ ItoD[y, \ SuppressTime -> False]\)], "Input"], Cell[BoxData[ RowBox[{ RowBox[{"\[Sigma]", " ", \(dB\_1\), " ", RowBox[{ SuperscriptBox["f", TagBox[\((1, 0)\), Derivative], MultilineFunction->None], "[", \(x[t], t\), "]"}]}], "+", RowBox[{"dt", " ", RowBox[{"(", RowBox[{ RowBox[{ SuperscriptBox["f", TagBox[\((0, 1)\), Derivative], MultilineFunction->None], "[", \(x[t], t\), "]"}], "+", RowBox[{"\[Mu]", " ", RowBox[{ SuperscriptBox["f", TagBox[\((1, 0)\), Derivative], MultilineFunction->None], "[", \(x[t], t\), "]"}]}], "+", RowBox[{\(1\/2\), " ", \(\[Sigma]\^2\), " ", RowBox[{ SuperscriptBox["f", TagBox[\((2, 0)\), Derivative], MultilineFunction->None], "[", \(x[t], t\), "]"}]}]}], ")"}]}]}]], "Output"] }, Closed]], Cell[TextData[{ "Here's what happens if ", Cell[BoxData[ \(TraditionalForm\`x\)]], " isn't an Ito process:" }], "Text"], Cell[CellGroupData[{ Cell[BoxData[{ \(Clear[x]\), "\n", \(ItoD[x[t], \ SuppressTime\ -> \ False]\)}], "Input"], Cell[BoxData[ RowBox[{"dt", " ", RowBox[{ SuperscriptBox["x", "\[Prime]", MultilineFunction->None], "[", "t", "]"}]}]], "Output"] }, Closed]] }, Closed]], Cell[CellGroupData[{ Cell["Other examples", "Subsubsection"], Cell["Time itself:", "Text"], Cell[CellGroupData[{ Cell[BoxData[ \(ItoD[t]\)], "Input", CellDingbat->None, ShowGroupOpenCloseIcon->False], Cell[BoxData[ \(dt\)], "Output"] }, Closed]], Cell["\<\ Brownian motion. (Note: Do not make any assignments to dB, the \ BrownianIncrement symbol.)\ \>", "Text"], Cell[BoxData[ \(Clear[b]\)], "Input"], Cell[CellGroupData[{ Cell[BoxData[ \(db\ = \ ItoMake[B[t], 0, 1]\)], "Input", CellDingbat->None, ShowGroupOpenCloseIcon->False], Cell[BoxData[ \(dB\_1\)], "Output"] }, Closed]], Cell[CellGroupData[{ Cell[BoxData[ \(ItoD[B[t]\^2\/2]\)], "Input", CellDingbat->None, ShowGroupOpenCloseIcon->False], Cell[BoxData[ \(dt\/2 + B\ dB\_1\)], "Output"] }, Closed]], Cell[TextData[{ "Declare ", Cell[BoxData[ \(TraditionalForm\`x\)]], " again:" }], "Text"], Cell[CellGroupData[{ Cell[BoxData[ \(ItoMake[x[t], \ \[Mu], \ \[Sigma]]\)], "Input"], Cell[BoxData[ \(dt\ \[Mu] + \[Sigma]\ dB\_1\)], "Output"] }, Closed]], Cell[CellGroupData[{ Cell[BoxData[ \(ItoD[\[Integral]\_t\%T x[s] \[DifferentialD]s, SuppressTime -> False]\)], "Input", CellDingbat->None, ShowGroupOpenCloseIcon->False], Cell[BoxData[ \(\(-dt\)\ x[t]\)], "Output"] }, Closed]], Cell[TextData[{ "Make ", Cell[BoxData[ \(TraditionalForm\`y[t]\)]], " an Ito process with two Brownians" }], "Text"], Cell[BoxData[ \(Clear[y, g]\)], "Input"], Cell[CellGroupData[{ Cell[BoxData[ \(ItoMake[ y[t], \ \[VeryThinSpace]\[Mu]\_y, \ {\[Sigma]\_\(y\_1\), \ \ \[Sigma]\_\(y\_2\)}]\)], "Input", CellDingbat->None, ShowGroupOpenCloseIcon->False], Cell[BoxData[ \(dt\ \[Mu]\_y + dB\_1\ \[Sigma]\_\(y\_1\) + dB\_2\ \[Sigma]\_\(y\_2\)\)], "Output"] }, Closed]], Cell[CellGroupData[{ Cell[BoxData[ \(ItoD[y[t]]\)], "Input", CellDingbat->None, ShowGroupOpenCloseIcon->False], Cell[BoxData[ \(dt\ \[Mu]\_y + dB\_1\ \[Sigma]\_\(y\_1\) + dB\_2\ \[Sigma]\_\(y\_2\)\)], "Output"] }, Closed]], Cell["Here the Brownians are uncorrelated...", "Text"], Cell[CellGroupData[{ Cell[BoxData[ \(z = g[t, y[t]]\)], "Input"], Cell[BoxData[ \(g[t, y[t]]\)], "Output"] }, Closed]], Cell[CellGroupData[{ Cell[BoxData[ \(dz1 = ItoD[z]\)], "Input", CellDingbat->None, ShowGroupOpenCloseIcon->False], Cell[BoxData[ RowBox[{ RowBox[{\(dB\_1\), " ", \(\[Sigma]\_\(y\_1\)\), " ", RowBox[{ SuperscriptBox["g", TagBox[\((0, 1)\), Derivative], MultilineFunction->None], "[", \(t, y\), "]"}]}], "+", RowBox[{\(dB\_2\), " ", \(\[Sigma]\_\(y\_2\)\), " ", RowBox[{ SuperscriptBox["g", TagBox[\((0, 1)\), Derivative], MultilineFunction->None], "[", \(t, y\), "]"}]}], "+", RowBox[{"dt", " ", RowBox[{"(", RowBox[{ RowBox[{\(\[Mu]\_y\), " ", RowBox[{ SuperscriptBox["g", TagBox[\((0, 1)\), Derivative], MultilineFunction->None], "[", \(t, y\), "]"}]}], "+", RowBox[{\(1\/2\), " ", \(\[Sigma]\_\(y\_1\)\%2\), " ", RowBox[{ SuperscriptBox["g", TagBox[\((0, 2)\), Derivative], MultilineFunction->None], "[", \(t, y\), "]"}]}], "+", RowBox[{\(1\/2\), " ", \(\[Sigma]\_\(y\_2\)\%2\), " ", RowBox[{ SuperscriptBox["g", TagBox[\((0, 2)\), Derivative], MultilineFunction->None], "[", \(t, y\), "]"}]}], "+", RowBox[{ SuperscriptBox["g", TagBox[\((1, 0)\), Derivative], MultilineFunction->None], "[", \(t, y\), "]"}]}], ")"}]}]}]], "Output"] }, Closed]], Cell["While here they are correlated:", "Text"], Cell[CellGroupData[{ Cell[BoxData[ \(dz2 = ItoD[z, OrthogonalBrownians -> False]\)], "Input", CellDingbat->None, ShowGroupOpenCloseIcon->False], Cell[BoxData[ RowBox[{ RowBox[{\(dB\_1\), " ", \(\[Sigma]\_\(y\_1\)\), " ", RowBox[{ SuperscriptBox["g", TagBox[\((0, 1)\), Derivative], MultilineFunction->None], "[", \(t, y\), "]"}]}], "+", RowBox[{\(dB\_2\), " ", \(\[Sigma]\_\(y\_2\)\), " ", RowBox[{ SuperscriptBox["g", TagBox[\((0, 1)\), Derivative], MultilineFunction->None], "[", \(t, y\), "]"}]}], "+", RowBox[{"dt", " ", RowBox[{"(", RowBox[{ RowBox[{\(\[Mu]\_y\), " ", RowBox[{ SuperscriptBox["g", TagBox[\((0, 1)\), Derivative], MultilineFunction->None], "[", \(t, y\), "]"}]}], "+", RowBox[{\(1\/2\), " ", \(\[Sigma]\_\(y\_1\)\%2\), " ", RowBox[{ SuperscriptBox["g", TagBox[\((0, 2)\), Derivative], MultilineFunction->None], "[", \(t, y\), "]"}]}], "+", RowBox[{\(1\/2\), " ", \(\[Sigma]\_\(y\_2\)\%2\), " ", RowBox[{ SuperscriptBox["g", TagBox[\((0, 2)\), Derivative], MultilineFunction->None], "[", \(t, y\), "]"}]}], "+", RowBox[{\(\[Sigma]\_\(y\_1\)\), " ", \(\[Sigma]\_\(y\_2\)\), " ", \(\[Rho]\_\(1, 2\)\), " ", RowBox[{ SuperscriptBox["g", TagBox[\((0, 2)\), Derivative], MultilineFunction->None], "[", \(t, y\), "]"}]}], "+", RowBox[{ SuperscriptBox["g", TagBox[\((1, 0)\), Derivative], MultilineFunction->None], "[", \(t, y\), "]"}]}], ")"}]}]}]], "Output"] }, Closed]], Cell["Here is the extra term:", "Text"], Cell[CellGroupData[{ Cell[BoxData[ \(dz2 - dz1 // Simplify\)], "Input"], Cell[BoxData[ RowBox[{ "dt", " ", \(\[Sigma]\_\(y\_1\)\), " ", \(\[Sigma]\_\(y\_2\)\), " ", \(\[Rho]\_\(1, 2\)\), " ", RowBox[{ SuperscriptBox["g", TagBox[\((0, 2)\), Derivative], MultilineFunction->None], "[", \(t, y\), "]"}]}]], "Output"] }, Closed]], Cell[TextData[{ "We can mix ", Cell[BoxData[ \(TraditionalForm\`x\)]], " and ", Cell[BoxData[ \(TraditionalForm\`y\)]] }], "Text"], Cell[CellGroupData[{ Cell[BoxData[ \(\(\(ItoD[f[x[t], y[t]]]\)\(\ \)\)\)], "Input"], Cell[BoxData[ RowBox[{ RowBox[{\(dB\_2\), " ", \(\[Sigma]\_\(y\_2\)\), " ", RowBox[{ SuperscriptBox["f", TagBox[\((0, 1)\), Derivative], MultilineFunction->None], "[", \(x, y\), "]"}]}], "+", RowBox[{\(dB\_1\), " ", RowBox[{"(", RowBox[{ RowBox[{\(\[Sigma]\_\(y\_1\)\), " ", RowBox[{ SuperscriptBox["f", TagBox[\((0, 1)\), Derivative], MultilineFunction->None], "[", \(x, y\), "]"}]}], "+", RowBox[{"\[Sigma]", " ", RowBox[{ SuperscriptBox["f", TagBox[\((1, 0)\), Derivative], MultilineFunction->None], "[", \(x, y\), "]"}]}]}], ")"}]}], "+", RowBox[{"dt", " ", RowBox[{"(", RowBox[{ RowBox[{\(\[Mu]\_y\), " ", RowBox[{ SuperscriptBox["f", TagBox[\((0, 1)\), Derivative], MultilineFunction->None], "[", \(x, y\), "]"}]}], "+", RowBox[{\(1\/2\), " ", \(\[Sigma]\_\(y\_1\)\%2\), " ", RowBox[{ SuperscriptBox["f", TagBox[\((0, 2)\), Derivative], MultilineFunction->None], "[", \(x, y\), "]"}]}], "+", RowBox[{\(1\/2\), " ", \(\[Sigma]\_\(y\_2\)\%2\), " ", RowBox[{ SuperscriptBox["f", TagBox[\((0, 2)\), Derivative], MultilineFunction->None], "[", \(x, y\), "]"}]}], "+", RowBox[{"\[Mu]", " ", RowBox[{ SuperscriptBox["f", TagBox[\((1, 0)\), Derivative], MultilineFunction->None], "[", \(x, y\), "]"}]}], "+", RowBox[{"\[Sigma]", " ", \(\[Sigma]\_\(y\_1\)\), " ", RowBox[{ SuperscriptBox["f", TagBox[\((1, 1)\), Derivative], MultilineFunction->None], "[", \(x, y\), "]"}]}], "+", RowBox[{\(1\/2\), " ", \(\[Sigma]\^2\), " ", RowBox[{ SuperscriptBox["f", TagBox[\((2, 0)\), Derivative], MultilineFunction->None], "[", \(x, y\), "]"}]}]}], ")"}]}]}]], "Output"] }, Closed]], Cell[TextData[{ "To compute the instantaneous covariance between ", Cell[BoxData[ \(TraditionalForm\`x\)]], " and ", Cell[BoxData[ \(TraditionalForm\`y\)]], ", we can take the dot product of their diffusions" }], "Text"], Cell[CellGroupData[{ Cell[BoxData[ \(sigY\ = \ Diffusion[ItoD[y[t]]]\)], "Input"], Cell[BoxData[ \({\[Sigma]\_\(y\_1\), \[Sigma]\_\(y\_2\)}\)], "Output"] }, Closed]], Cell[TextData[{ "But the diffusion for ", Cell[BoxData[ \(TraditionalForm\`x\)]], " only has one Brownian" }], "Text"], Cell[CellGroupData[{ Cell[BoxData[ \(sigX\ = \ Diffusion[ItoD[x[t]]]\)], "Input"], Cell[BoxData[ \(\[Sigma]\)], "Output"] }, Closed]], Cell["To fix that, use the option BrownianList", "Text"], Cell[CellGroupData[{ Cell[BoxData[ \(blist = Cases[ItoD[y[t]], \ Subscript[BrownianIncrement, _], \[Infinity]]\)], "Input"], Cell[BoxData[ \({dB\_1, dB\_2}\)], "Output"] }, Closed]], Cell[CellGroupData[{ Cell[BoxData[ \(sigX\ = \ Diffusion[ItoD[x[t]], BrownianList\ -> \ blist]\)], "Input"], Cell[BoxData[ \({\[Sigma], 0}\)], "Output"] }, Closed]], Cell[CellGroupData[{ Cell[BoxData[ \(sigX . sigY\)], "Input"], Cell[BoxData[ \(\[Sigma]\ \[Sigma]\_\(y\_1\)\)], "Output"] }, Closed]] }, Closed]] }, Closed]], Cell[CellGroupData[{ Cell["Two variables, each with two shocks", "Subsection"], Cell[BoxData[ \(Clear[Subscript, f]\)], "Input"], Cell[CellGroupData[{ Cell[BoxData[ \(ItoMake[ x\_1[t], \ \[Mu]\_1, \ {\[Sigma]\_11, \ \[Sigma]\_12}]\)], "Input"], Cell[BoxData[ \(dt\ \[Mu]\_1 + dB\_1\ \[Sigma]\_11 + dB\_2\ \[Sigma]\_12\)], "Output"] }, Closed]], Cell[TextData[{ "In this case, the rule is associated with ", StyleBox["Subscript", FontFamily->"Courier New", FontWeight->"Bold"], " (which is the Head of ", Cell[BoxData[ \(TraditionalForm\`x\_1\)]], ")." }], "Text"], Cell[CellGroupData[{ Cell[BoxData[ \(\(?Subscript\)\)], "Input"], Cell["System`Subscript", "Print", CellTags->"Info3260169727-9252446"], Cell[BoxData[ InterpretationBox[GridBox[{ {GridBox[{ {\(\("Subscript"[x, 1]\)[dt + t] = dt\ "Subscript"[\[Mu], 1] + "Subscript"[dB, 1]\ "Subscript"[\[Sigma], 11] + "Subscript"[dB, 2]\ "Subscript"[\[Sigma], 12] + \("Subscript"[x, 1]\)[t]\)} }, GridBaseline->{Baseline, {1, 1}}, ColumnWidths->0.999, ColumnAlignments->{Left}]} }, GridBaseline->{Baseline, {1, 1}}, ColumnAlignments->{Left}], Definition[ "Subscript"], Editable->False]], "Print", CellTags->"Info3260169727-9252446"] }, Closed]], Cell[CellGroupData[{ Cell[BoxData[ \(ItoMake[ x\_2[t], \ \[Mu]\_2, \ {\[Sigma]\_21, \ \[Sigma]\_22}]\)], "Input"], Cell[BoxData[ \(dt\ \[Mu]\_2 + dB\_1\ \[Sigma]\_21 + dB\_2\ \[Sigma]\_22\)], "Output"] }, Closed]], Cell[TextData[{ "Alternatively one can use ", StyleBox["VectorItoMake", FontFamily->"Courier", FontWeight->"Bold"], ", which applies ", StyleBox["ItoMake", FontFamily->"Courier New", FontWeight->"Bold"], " to a vector indexed with ", StyleBox["Subscripts", FontFamily->"Courier New", FontWeight->"Bold"], ":" }], "Text"], Cell[CellGroupData[{ Cell[BoxData[ \(VectorItoMake[x[t], 2]\)], "Input"], Cell[BoxData[ \({dt\ \[Mu][x\_1] + dB\_1\ \[Sigma]\_1[x\_1] + dB\_2\ \[Sigma]\_2[x\_1], dt\ \[Mu][x\_2] + dB\_1\ \[Sigma]\_1[x\_2] + dB\_2\ \[Sigma]\_2[x\_2]}\)], "Output"] }, Closed]], Cell[CellGroupData[{ Cell[BoxData[ \(ItoD[\ f[x\_1[t], x\_2[t], t]\ ]\)], "Input"], Cell[BoxData[ RowBox[{ RowBox[{\(dB\_1\), " ", RowBox[{"(", RowBox[{ RowBox[{\(\[Sigma]\_1[x\_2]\), " ", RowBox[{ SuperscriptBox["f", TagBox[\((0, 1, 0)\), Derivative], MultilineFunction->None], "[", \(x\_1, x\_2, t\), "]"}]}], "+", RowBox[{\(\[Sigma]\_1[x\_1]\), " ", RowBox[{ SuperscriptBox["f", TagBox[\((1, 0, 0)\), Derivative], MultilineFunction->None], "[", \(x\_1, x\_2, t\), "]"}]}]}], ")"}]}], "+", RowBox[{\(dB\_2\), " ", RowBox[{"(", RowBox[{ RowBox[{\(\[Sigma]\_2[x\_2]\), " ", RowBox[{ SuperscriptBox["f", TagBox[\((0, 1, 0)\), Derivative], MultilineFunction->None], "[", \(x\_1, x\_2, t\), "]"}]}], "+", RowBox[{\(\[Sigma]\_2[x\_1]\), " ", RowBox[{ SuperscriptBox["f", TagBox[\((1, 0, 0)\), Derivative], MultilineFunction->None], "[", \(x\_1, x\_2, t\), "]"}]}]}], ")"}]}], "+", RowBox[{"dt", " ", RowBox[{"(", RowBox[{ RowBox[{ SuperscriptBox["f", TagBox[\((0, 0, 1)\), Derivative], MultilineFunction->None], "[", \(x\_1, x\_2, t\), "]"}], "+", RowBox[{\(\[Mu][x\_2]\), " ", RowBox[{ SuperscriptBox["f", TagBox[\((0, 1, 0)\), Derivative], MultilineFunction->None], "[", \(x\_1, x\_2, t\), "]"}]}], "+", RowBox[{\(1\/2\), " ", \(\[Sigma]\_1[x\_2]\^2\), " ", RowBox[{ SuperscriptBox["f", TagBox[\((0, 2, 0)\), Derivative], MultilineFunction->None], "[", \(x\_1, x\_2, t\), "]"}]}], "+", RowBox[{\(1\/2\), " ", \(\[Sigma]\_2[x\_2]\^2\), " ", RowBox[{ SuperscriptBox["f", TagBox[\((0, 2, 0)\), Derivative], MultilineFunction->None], "[", \(x\_1, x\_2, t\), "]"}]}], "+", RowBox[{\(\[Mu][x\_1]\), " ", RowBox[{ SuperscriptBox["f", TagBox[\((1, 0, 0)\), Derivative], MultilineFunction->None], "[", \(x\_1, x\_2, t\), "]"}]}], "+", RowBox[{\(\[Sigma]\_1[x\_1]\), " ", \(\[Sigma]\_1[x\_2]\), " ", RowBox[{ SuperscriptBox["f", TagBox[\((1, 1, 0)\), Derivative], MultilineFunction->None], "[", \(x\_1, x\_2, t\), "]"}]}], "+", RowBox[{\(\[Sigma]\_2[x\_1]\), " ", \(\[Sigma]\_2[x\_2]\), " ", RowBox[{ SuperscriptBox["f", TagBox[\((1, 1, 0)\), Derivative], MultilineFunction->None], "[", \(x\_1, x\_2, t\), "]"}]}], "+", RowBox[{\(1\/2\), " ", \(\[Sigma]\_1[x\_1]\^2\), " ", RowBox[{ SuperscriptBox["f", TagBox[\((2, 0, 0)\), Derivative], MultilineFunction->None], "[", \(x\_1, x\_2, t\), "]"}]}], "+", RowBox[{\(1\/2\), " ", \(\[Sigma]\_2[x\_1]\^2\), " ", RowBox[{ SuperscriptBox["f", TagBox[\((2, 0, 0)\), Derivative], MultilineFunction->None], "[", \(x\_1, x\_2, t\), "]"}]}]}], ")"}]}]}]], "Output"] }, Closed]] }, Closed]], Cell[CellGroupData[{ Cell["A vector of Brownians; three examples from \[CapitalOSlash]ksendal", \ "Subsection"], Cell[CellGroupData[{ Cell[BoxData[{ \(Clear[B]\), "\n", \(VectorItoMake[B[t], \ 0, \ 1, \ 3]\), "\n", \(Bvec\ = \ Array[B\_#[t] &, \ 3]\)}], "Input"], Cell[BoxData[ \({dB\_1, dB\_2, dB\_3}\)], "Output"], Cell[BoxData[ \({B\_1[t], B\_2[t], B\_3[t]}\)], "Output"] }, Closed]], Cell[CellGroupData[{ Cell["First example", "Subsubsection"], Cell[CellGroupData[{ Cell[BoxData[ \(R = Sqrt[Bvec . Bvec]\)], "Input"], Cell[BoxData[ \(\@\(B\_1[t]\^2 + B\_2[t]\^2 + B\_3[t]\^2\)\)], "Output"] }, Closed]], Cell[CellGroupData[{ Cell[BoxData[ \(\(\(Simplify\ /@ \ ItoD[R]\)\(\ \)\)\)], "Input"], Cell[BoxData[ \(dt\/\@\(B\_1\%2 + B\_2\%2 + B\_3\%2\) + \(B\_1\ dB\_1\)\/\@\(B\_1\%2 + \ B\_2\%2 + B\_3\%2\) + \(B\_2\ dB\_2\)\/\@\(B\_1\%2 + B\_2\%2 + B\_3\%2\) + \ \(B\_3\ dB\_3\)\/\@\(B\_1\%2 + B\_2\%2 + B\_3\%2\)\)], "Output"] }, Closed]] }, Closed]], Cell[CellGroupData[{ Cell["Second example", "Subsubsection"], Cell[CellGroupData[{ Cell[BoxData[ \(vec2\ = \ {Plus\ @@ \ Bvec, \ B\_2[t]\^2 - \ B\_1[t] B\_3[t]}\)], "Input"], Cell[BoxData[ \({B\_1[t] + B\_2[t] + B\_3[t], B\_2[t]\^2 - B\_1[t]\ B\_3[t]}\)], "Output"] }, Closed]], Cell[CellGroupData[{ Cell[BoxData[ \(ItoD[vec2] // MatrixForm\)], "Input"], Cell[BoxData[ InterpretationBox[ RowBox[{"(", "\[NoBreak]", GridBox[{ {\(dB\_1 + dB\_2 + dB\_3\)}, {\(dt - B\_3\ dB\_1 + 2\ B\_2\ dB\_2 - B\_1\ dB\_3\)} }], "\[NoBreak]", ")"}], MatrixForm[ { Plus[ Subscript[ dB, 1], Subscript[ dB, 2], Subscript[ dB, 3]], Plus[ dt, Times[ -1, Subscript[ B, 3], Subscript[ dB, 1]], Times[ 2, Subscript[ B, 2], Subscript[ dB, 2]], Times[ -1, Subscript[ B, 1], Subscript[ dB, 3]]]}]]], "Output"] }, Closed]] }, Closed]], Cell[CellGroupData[{ Cell["Third example", "Subsubsection"], Cell["Show that the following have zero drifts", "Text"], Cell[CellGroupData[{ Cell[BoxData[ \(vec3 = {E\^\(t/2\)\ Cos[B\_1[t]], E\^\(t/2\)\ Sin[B\_1[t]], \ \((B\_1[t]\ + \ t)\) Exp[\(-B\_1[t]\) - t/2]}\)], "Input"], Cell[BoxData[ \({\[ExponentialE]\^\(t/2\)\ Cos[B\_1[t]], \[ExponentialE]\^\(t/2\)\ Sin[ B\_1[t]], \[ExponentialE]\^\(\(-\(t\/2\)\) - B\_1[t]\)\ \((t + B\_1[t])\)}\)], "Output"] }, Closed]], Cell[CellGroupData[{ Cell[BoxData[ \(\(ItoD[vec3] // Drift\) // Simplify\)], "Input"], Cell[BoxData[ \({0, 0, 0}\)], "Output"] }, Closed]] }, Closed]] }, Closed]] }, Closed]], Cell[CellGroupData[{ Cell["Examples from finance", "Section"], Cell[CellGroupData[{ Cell["Forward rates and bond prices", "Subsection", ShowGroupOpenCloseIcon->False], Cell[CellGroupData[{ Cell["Forward rates", "Subsubsection"], Cell[TextData[{ "Start with Ito process for forward rates, ", Cell[BoxData[ \(TraditionalForm\`f[t, T]\)]], ", where ", Cell[BoxData[ \(TraditionalForm\`T - t\)]], " is the maturity of the forward rate and ", Cell[BoxData[ \(TraditionalForm\`T\)]], " is a fixed time in the future." }], "Text"], Cell[CellGroupData[{ Cell[BoxData[{ \(Clear[f]\), "\n", \(ItoMake[f[t, T], \ \[Mu]\_f[t, T], \ \[Sigma]\_f[t, T]]\)}], "Input"], Cell[BoxData[ \(dt\ \[Mu]\_f[t, T] + dB\_1\ \[Sigma]\_f[t, T]\)], "Output"] }, Closed]] }, Closed]], Cell[CellGroupData[{ Cell[TextData[{ "The interest rate as ", Cell[BoxData[ \(TraditionalForm\`f[t, t]\)]] }], "Subsubsection"], Cell[TextData[{ "The instantaneous forward rate is the interest rate: ", Cell[BoxData[ \(TraditionalForm\`r[t]\ = \ f[t, t]\)]], ". In this case, however, the second argument is no longer fixed." }], "Text"], Cell[CellGroupData[{ Cell[BoxData[ \(ItoD[f[t, t]]\)], "Input"], Cell[BoxData[ RowBox[{\(dB\_1\ \[Sigma]\_f[t, t]\), "+", RowBox[{"dt", " ", RowBox[{"(", RowBox[{\(\[Mu]\_f[t, t]\), "+", RowBox[{ SuperscriptBox["f", TagBox[\((0, 1)\), Derivative], MultilineFunction->None], "[", \(t, t\), "]"}]}], ")"}]}]}]], "Output"] }, Closed]], Cell[TextData[{ "The preceding result is formally correct if we interpret ", Cell[BoxData[ FormBox[ RowBox[{ SuperscriptBox["f", TagBox[\((0, 1)\), Derivative], MultilineFunction->None], "[", \(t, t\), "]"}], TraditionalForm]]], " as follows:" }], "Text", TextAlignment->Left, TextJustification->0], Cell[TextData[{ " ", Cell[BoxData[ FormBox[ RowBox[{ RowBox[{ FormBox[ RowBox[{ RowBox[{ SuperscriptBox["f", TagBox[\((0, 1)\), Derivative], MultilineFunction->None], "(", \(t, t\), ")"}], " ", "=", " ", \(\(f\^\((0, 1)\)\)(0, t)\ + \ \[Integral]\_0\%t\)}], "TraditionalForm"], \(\[PartialD]\/\[PartialD]\[InvisibleSpace]t\), \(\(\[Mu]\_f\)(s, t)\), \(\[DifferentialD]s\)}], " ", "+", " ", \(\[Integral]\_0\%t\(\[PartialD]\/\[PartialD]\[InvisibleSpace]t\) \(\(\[Sigma]\_f\)(s, t)\) \(\[DifferentialD]\(W(s)\) . \)\)}], TraditionalForm]], TextAlignment->Left, TextJustification->0] }], "Text", TextAlignment->Center, TextJustification->0] }, Closed]], Cell[CellGroupData[{ Cell["From forward rates to bond prices and back again", "Subsubsection"], Cell[TextData[{ "Bond prices: ", Cell[BoxData[ \(TraditionalForm \`p[t, T]\ = \ \[ExponentialE]\^\(- \(\[Integral]\_t\%T f[t, v] \[DifferentialD]v\)\)\)]], "." }], "Text"], Cell[CellGroupData[{ Cell[BoxData[ \(dp\ = ItoD[\[ExponentialE]\^\(-\(\[Integral]\_t\%T f[t, v] \ \[DifferentialD]v\)\)]\)], "Input"], Cell[BoxData[ \(dt\ \((\[ExponentialE]\^\(-\(\[Integral]\_t\%T f[t, v] \ \[DifferentialD]v\)\)\ \((f[t, t] - \[Integral]\_t\%T \[Mu]\_f[t, v] \[DifferentialD]v)\) + 1\/2\ \[ExponentialE]\^\(-\(\[Integral]\_t\%T f[t, v] \ \[DifferentialD]v\)\)\ \((\[Integral]\_t\%T \[Sigma]\_f[t, v] \ \[DifferentialD]v)\)\^2)\) - \[ExponentialE]\^\(-\(\[Integral]\_t\%T f[t, v] \ \[DifferentialD]v\)\)\ \((\[Integral]\_t\%T \[Sigma]\_f[t, v] \[DifferentialD]v)\)\ dB\_1\)], "Output"] }, Closed]], Cell[BoxData[ \(Clear[p]\)], "Input"], Cell[CellGroupData[{ Cell[BoxData[ \(ItoMakeFromItoD[p[t, T], dp]\)], "Input", CellDingbat->None, ShowGroupOpenCloseIcon->False], Cell[BoxData[ \(dt\ \((\[ExponentialE]\^\(-\(\[Integral]\_t\%T f[t, v] \ \[DifferentialD]v\)\)\ \((f[t, t] - \[Integral]\_t\%T \[Mu]\_f[t, v] \[DifferentialD]v)\) + 1\/2\ \[ExponentialE]\^\(-\(\[Integral]\_t\%T f[t, v] \ \[DifferentialD]v\)\)\ \((\[Integral]\_t\%T \[Sigma]\_f[t, v] \ \[DifferentialD]v)\)\^2)\) - \[ExponentialE]\^\(-\(\[Integral]\_t\%T f[t, v] \ \[DifferentialD]v\)\)\ \((\[Integral]\_t\%T \[Sigma]\_f[t, v] \[DifferentialD]v)\)\ dB\_1\)], "Output"] }, Closed]], Cell[TextData[{ "The Ito process for forward rates: ", Cell[BoxData[ \(TraditionalForm \`d\[InvisibleSpace]f[t, T]\ = \ \(-\(\[PartialD]\/\[PartialD]T\)\) d \[InvisibleSpace]\(log(p[t, T])\)\)]], "." }], "Text"], Cell[CellGroupData[{ Cell[BoxData[ \(df\ = \ \(-D[ItoD[Log[p[t, T]]], T]\)\)], "Input"], Cell[BoxData[ RowBox[{\(-\(\(\[ExponentialE]\^\(-\(\[Integral]\_t\%T f[t, v] \ \[DifferentialD]v\)\)\ f[t, T]\ \((\[Integral]\_t\%T \[Sigma]\_f[t, v] \[DifferentialD]v)\)\ dB\_1\)\/p[t, T]\)\), "+", \(\(\[ExponentialE]\^\(-\(\[Integral]\_t\%T f[t, v] \ \[DifferentialD]v\)\)\ dB\_1\ \[Sigma]\_f[t, T]\)\/p[t, T]\), "-", FractionBox[ RowBox[{\(\[ExponentialE]\^\(-\(\[Integral]\_t\%T f[t, v] \[DifferentialD]v\)\)\), " ", \((\[Integral]\_t\%T \[Sigma]\_f[t, v] \[DifferentialD]v)\), " ", \(dB\_1\), " ", RowBox[{ SuperscriptBox["p", TagBox[\((0, 1)\), Derivative], MultilineFunction->None], "[", \(t, T\), "]"}]}], \(p[t, T]\^2\)], "-", RowBox[{"dt", " ", RowBox[{"(", RowBox[{\(\(\[ExponentialE]\^\(\(-2\)\ \(\[Integral]\_t\%T f[t, v] \ \[DifferentialD]v\)\)\ f[t, T]\ \((\[Integral]\_t\%T \[Sigma]\_f[t, v] \ \[DifferentialD]v)\)\^2\)\/p[t, T]\^2\), "-", \(\(\[ExponentialE]\^\(\(-2\)\ \(\[Integral]\_t\%T f[t, v] \ \[DifferentialD]v\)\)\ \((\[Integral]\_t\%T \[Sigma]\_f[t, v] \[DifferentialD]v)\)\ \[Sigma]\_f[t, T]\)\/p[t, T]\^2\), "+", \(\(1\/p[t, T]\)\((\(-\[ExponentialE]\^\(-\(\[Integral]\_t\%T f[t, v] \ \[DifferentialD]v\)\)\)\ f[t, T]\ \((f[t, t] - \[Integral]\_t\%T \[Mu]\_f[t, v] \[DifferentialD]v)\) - 1\/2\ \[ExponentialE]\^\(-\(\[Integral]\_t\%T f[t, v] \ \[DifferentialD]v\)\)\ f[t, T]\ \((\[Integral]\_t\%T \[Sigma]\_f[t, v] \ \[DifferentialD]v)\)\^2 - \[ExponentialE]\^\(-\(\[Integral]\_t\%T f[t, v] \ \[DifferentialD]v\)\)\ \[Mu]\_f[t, T] + \[ExponentialE]\^\(-\(\[Integral]\_t\%T f[t, v] \ \[DifferentialD]v\)\)\ \((\[Integral]\_t\%T \[Sigma]\_f[t, v] \[DifferentialD]v)\)\ \[Sigma]\_f[t, T])\)\), "+", FractionBox[ RowBox[{\(\[ExponentialE]\^\(\(-2\)\ \(\[Integral]\_t\%T f[t, v] \[DifferentialD]v\)\)\), " ", \(\((\[Integral]\_t\%T \[Sigma]\_f[t, v] \[DifferentialD]v)\)\^2\), " ", RowBox[{ SuperscriptBox["p", TagBox[\((0, 1)\), Derivative], MultilineFunction->None], "[", \(t, T\), "]"}]}], \(p[t, T]\^3\)], "-", RowBox[{\(1\/p[t, T]\^2\), RowBox[{"(", RowBox[{\((\[ExponentialE]\^\(-\(\[Integral]\_t\%T f[t, v] \ \[DifferentialD]v\)\)\ \((f[t, t] - \[Integral]\_t\%T \[Mu]\_f[t, v] \[DifferentialD]v)\) + 1\/2\ \[ExponentialE]\^\(-\(\[Integral]\_t\%T f[t, v] \ \[DifferentialD]v\)\)\ \((\[Integral]\_t\%T \[Sigma]\_f[t, v] \ \[DifferentialD]v)\)\^2)\), " ", RowBox[{ SuperscriptBox["p", TagBox[\((0, 1)\), Derivative], MultilineFunction->None], "[", \(t, T\), "]"}]}], ")"}]}]}], ")"}]}]}]], "Output"] }, Closed]], Cell["\<\ The preceding expression looks somewhat messy. We can simplify it a bit:\ \>", "Text"], Cell[CellGroupData[{ Cell[BoxData[ \(df /. p -> Function[{t, T}, \ \[ExponentialE]\^\(-\(\[Integral]\_t\%T f[t, v] \ \[DifferentialD]v\)\)] // Simplify\)], "Input"], Cell[BoxData[ \(dt\ \[Mu]\_f[t, T] + dB\_1\ \[Sigma]\_f[t, T]\)], "Output"] }, Closed]] }, Closed]], Cell[CellGroupData[{ Cell["From bond prices to forward rates and back again", "Subsubsection"], Cell["Start with the Ito process for bond prices", "Text"], Cell[CellGroupData[{ Cell[BoxData[{ \(Clear[p]\), "\n", \(RelativeItoMake[p[t, T], \[Mu]\_p[t, T], \[Sigma]\_p[t, T]]\)}], "Input"], Cell[BoxData[ \(dt\ p[t, T]\ \[Mu]\_p[t, T] + p[t, T]\ dB\_1\ \[Sigma]\_p[t, T]\)], "Output"] }, Closed]], Cell[CellGroupData[{ Cell[BoxData[ \(dp1\ = \ RelativeItoD[p[t, T]]\)], "Input"], Cell[BoxData[ \(dt\ \[Mu]\_p[t, T] + dB\_1\ \[Sigma]\_p[t, T]\)], "Output"] }, Closed]], Cell[TextData[{ "Again, the Ito process for forward rates: ", Cell[BoxData[ \(TraditionalForm \`d\[InvisibleSpace]f[t, T]\ = \ \(-\(\[PartialD]\/\[PartialD]T\)\) d \[InvisibleSpace]\(log(p[t, T])\)\)]], "." }], "Text"], Cell[BoxData[ \(Clear[f]\)], "Input"], Cell[CellGroupData[{ Cell[BoxData[ \(df\ = ItoMakeFromItoD[f[t, T], \(-D[ItoD[Log[p[t, T]]], T]\)]\)], "Input"], Cell[BoxData[ RowBox[{ RowBox[{\(-dB\_1\), " ", RowBox[{ SubsuperscriptBox["\[Sigma]", "p", TagBox[\((0, 1)\), Derivative], MultilineFunction->None], "[", \(t, T\), "]"}]}], "+", RowBox[{"dt", " ", RowBox[{"(", RowBox[{ RowBox[{"-", RowBox[{ SubsuperscriptBox["\[Mu]", "p", TagBox[\((0, 1)\), Derivative], MultilineFunction->None], "[", \(t, T\), "]"}]}], "+", RowBox[{\(\[Sigma]\_p[t, T]\), " ", RowBox[{ SubsuperscriptBox["\[Sigma]", "p", TagBox[\((0, 1)\), Derivative], MultilineFunction->None], "[", \(t, T\), "]"}]}]}], ")"}]}]}]], "Output"] }, Closed]], Cell["An aside: The arbitrage-free drift of forward rates", "Text"], Cell[CellGroupData[{ Cell[BoxData[ \(Drift[df]\ /. \ \ \[Mu]\_p -> Function[{t, T}, \ r[t] + \[Sigma]\_p[t, T] \[Lambda][t]\ ] // Simplify\)], "Input"], Cell[BoxData[ RowBox[{\((\(-\[Lambda][t]\) + \[Sigma]\_p[t, T])\), " ", RowBox[{ SubsuperscriptBox["\[Sigma]", "p", TagBox[\((0, 1)\), Derivative], MultilineFunction->None], "[", \(t, T\), "]"}]}]], "Output"] }, Closed]], Cell["\<\ Use Ito's lemma to compute the Ito process for bond prices given the derived \ process for forward rates:\ \>", "Text"], Cell[CellGroupData[{ Cell[BoxData[ \(dp2\ = \ RelativeItoD[\[ExponentialE]\^\(-\(\[Integral]\_t\%T f[t, v] \ \[DifferentialD]v\)\)]\)], "Input", CellDingbat->None, ShowGroupOpenCloseIcon->False], Cell[BoxData[ \(\(-dB\_1\)\ \((\[Sigma]\_p[t, t] - \[Sigma]\_p[t, T])\) + dt\ \((f[t, t] - \[Mu]\_p[t, t] + \[Mu]\_p[t, T] + \[Sigma]\_p[t, t]\^2 - \[Sigma]\_p[t, t]\ \[Sigma]\_p[t, T])\)\)], "Output"] }, Closed]], Cell[TextData[{ "What is the difference between ", StyleBox["dp1", FontFamily->"Courier", FontWeight->"Bold"], " and ", StyleBox["dp2", FontFamily->"Courier", FontWeight->"Bold"], "?" }], "Text"], Cell[CellGroupData[{ Cell[BoxData[ \(diff\ = \ {Diffusion[dp1] - Diffusion[dp2]\ == \ 0, Drift[dp1] - Drift[dp2] == 0}\)], "Input"], Cell[BoxData[ \({\[Sigma]\_p[t, t] == 0, \(-f[t, t]\) + \[Mu]\_p[t, t] - \[Sigma]\_p[t, t]\^2 + \[Sigma]\_p[t, t]\ \[Sigma]\_p[t, T] == 0}\)], "Output"] }, Closed]], Cell["What conditions must be identically true?", "Text"], Cell[CellGroupData[{ Cell[BoxData[ \(SolveAlways[diff, \ \[Sigma]\_p[t, T]]\)], "Input"], Cell[BoxData[ \({{f[t, t] \[Rule] \[Mu]\_p[t, t], \[Sigma]\_p[t, t] \[Rule] 0}}\)], "Output"] }, Closed]] }, Closed]], Cell[CellGroupData[{ Cell["An annuity", "Subsubsection"], Cell[CellGroupData[{ Cell[BoxData[{ \(Clear[p]\), "\n", \(RelativeItoMake[p[t, T], \[Mu]\_p[t, T], \[Sigma]\_p[t, T]]\)}], "Input"], Cell[BoxData[ \(dt\ p[t, T]\ \[Mu]\_p[t, T] + p[t, T]\ dB\_1\ \[Sigma]\_p[t, T]\)], "Output"] }, Closed]], Cell["\<\ Compute the process for an annuity (using the fact that a zero-coupon bond is \ worth one at maturity).\ \>", "Text"], Cell[CellGroupData[{ Cell[BoxData[ \(ItoD[\[Integral]\_t\%T p[t, s] \[DifferentialD]s] /. \ p[T_, T_] -> 1\)], "Input"], Cell[BoxData[ \(dt\ \((\(-1\) + \[Integral]\_t\%T\( p[t, s]\ \[Mu]\_p[t, s]\) \[DifferentialD]s)\) + \((\[Integral]\_t\%T\( p[t, s]\ \[Sigma]\_p[t, s]\) \[DifferentialD]s)\)\ dB\_1\)], "Output"] }, Closed]] }, Closed]] }, Closed]], Cell[CellGroupData[{ Cell["Exponential diffusions", "Subsection", ShowGroupOpenCloseIcon->False], Cell[CellGroupData[{ Cell[BoxData[ \(ExponentialItoMake[v[t]]\)], "Input", CellDingbat->None, ShowGroupOpenCloseIcon->False], Cell[BoxData[ \(dB\_1\ \[Sigma]\_v\ v[t] + dt\ \((\[Sigma]\_v\%2\/2 + \(\[Mu]\&~\)\_v)\)\ v[t]\)], "Output"] }, Closed]], Cell[CellGroupData[{ Cell[BoxData[ \(ItoD[Log[v[t]]]\)], "Input", CellDingbat->None, ShowGroupOpenCloseIcon->False], Cell[BoxData[ \(dB\_1\ \[Sigma]\_v + dt\ \(\[Mu]\&~\)\_v\)], "Output"] }, Closed]], Cell[CellGroupData[{ Cell[BoxData[ \(RelativeItoD[v[t]]\)], "Input", CellDingbat->None, ShowGroupOpenCloseIcon->False], Cell[BoxData[ \(dB\_1\ \[Sigma]\_v + dt\ \((\[Sigma]\_v\%2\/2 + \(\[Mu]\&~\)\_v)\)\)], "Output"] }, Closed]], Cell[CellGroupData[{ Cell[BoxData[ \(ExponentialItoMake[\[Psi][t], \[Mu]\&~, \ \[Sigma], 2]\)], "Input", CellDingbat->None, ShowGroupOpenCloseIcon->False], Cell[BoxData[ \(dB\_1\ \[Psi][t]\ \[Sigma]\_1[\[Psi]] + dB\_2\ \[Psi][t]\ \[Sigma]\_2[\[Psi]] + dt\ \[Psi][ t]\ \((\(\[Mu]\&~\)[\[Psi]] + 1\/2\ \((\[Sigma]\_1[\[Psi]]\^2 + \ \[Sigma]\_2[\[Psi]]\^2)\))\)\)], "Output"] }, Closed]], Cell[CellGroupData[{ Cell[BoxData[ \(Simplify /@ ItoD[Log[\[Psi][t]]]\)], "Input", CellDingbat->None, ShowGroupOpenCloseIcon->False], Cell[BoxData[ \(dt\ \(\[Mu]\&~\)[\[Psi]] + dB\_1\ \[Sigma]\_1[\[Psi]] + dB\_2\ \[Sigma]\_2[\[Psi]]\)], "Output"] }, Closed]] }, Closed]], Cell[CellGroupData[{ Cell["State-price deflator and money-market account", "Subsection", ShowGroupOpenCloseIcon->False], Cell[BoxData[ \(Clear[m, \[Beta], \[Zeta], n, \ r, \ \[Lambda], \ R, \ \[CapitalLambda]]\)], "Input"], Cell["State-price deflator", "Text"], Cell[CellGroupData[{ Cell[BoxData[ \(RelativeItoMake[m[t], \(-r\), \(-\[Lambda]\)]\)], "Input", CellDingbat->None, ShowGroupOpenCloseIcon->False], Cell[BoxData[ \(\(-dt\)\ r\ m[t] - \[Lambda]\ m[t]\ dB\_1\)], "Output"] }, Closed]], Cell[CellGroupData[{ Cell[BoxData[ \(RelativeItoD[m[t]]\)], "Input", CellDingbat->None, ShowGroupOpenCloseIcon->False], Cell[BoxData[ \(\(-dt\)\ r - \[Lambda]\ dB\_1\)], "Output"] }, Closed]], Cell["Money-market account", "Text", CellDingbat->None, ShowGroupOpenCloseIcon->False], Cell[CellGroupData[{ Cell[BoxData[ \(RelativeItoMake[\[Beta][t], r, 0]\)], "Input", CellDingbat->None, ShowGroupOpenCloseIcon->False], Cell[BoxData[ \(dt\ r\ \[Beta][t]\)], "Output"] }, Closed]], Cell[CellGroupData[{ Cell[BoxData[ \(RelativeItoD[\[Beta][t]]\)], "Input", CellDingbat->None, ShowGroupOpenCloseIcon->False], Cell[BoxData[ \(dt\ r\)], "Output"] }, Closed]], Cell[CellGroupData[{ Cell[BoxData[ \(RelativeItoMake[\[Zeta][t], \ 0, \ \(-\[Lambda]\)]\)], "Input"], Cell[BoxData[ \(\(-\[Lambda]\)\ dB\_1\ \[Zeta][t]\)], "Output"] }, Closed]], Cell[CellGroupData[{ Cell[BoxData[ \(RelativeItoD[\[Zeta][t]/\[Beta][t]]\)], "Input"], Cell[BoxData[ \(\(-dt\)\ r - \[Lambda]\ dB\_1\)], "Output"] }, Closed]], Cell["Two state-price deflators", "Text"], Cell[CellGroupData[{ Cell[BoxData[ \(RelativeItoMake[n[t], \ \(-R\), \ \(-\[CapitalLambda]\)]\)], "Input"], Cell[BoxData[ \(\(-dt\)\ R\ n[t] - \[CapitalLambda]\ n[t]\ dB\_1\)], "Output"] }, Closed]], Cell["The Ito process for the log of the exchange rate", "Text"], Cell[CellGroupData[{ Cell[BoxData[ \(dX\ = \ ItoD[Log[m[t]/n[t]]] // Simplify\)], "Input"], Cell[BoxData[ \(1\/2\ dt\ \((\(-2\)\ r + 2\ R - \[Lambda]\^2 + \[CapitalLambda]\^2)\) + \((\(-\[Lambda]\) \ + \[CapitalLambda])\)\ dB\_1\)], "Output"] }, Closed]], Cell["Expected exchange rate depreciation", "Text"], Cell[CellGroupData[{ Cell[BoxData[ \(Drift[dX] // Expand\)], "Input"], Cell[BoxData[ \(\(-r\) + R - \[Lambda]\^2\/2 + \[CapitalLambda]\^2\/2\)], "Output"] }, Closed]] }, Closed]], Cell[CellGroupData[{ Cell["Exponentially-weighted forecast", "Subsection"], Cell[TextData[{ "Exponentially-weighted forecast, where ", Cell[BoxData[ \(TraditionalForm\`z[t, s]\ := \ E\_t[z[s]]\)]], "." }], "Text"], Cell[BoxData[ \(Clear[z, V]\)], "Input"], Cell[BoxData[ \(\(SetOptions[Integrate, \ GenerateConditions -> False];\)\)], "Input"], Cell["Conditional expectations are martingales:", "Text"], Cell[CellGroupData[{ Cell[BoxData[ \(ItoMake[z[t, s], 0, sigZ[t, s]]\)], "Input", CellDingbat->None, ShowGroupOpenCloseIcon->False], Cell[BoxData[ \(sigZ[t, s]\ dB\_1\)], "Output"] }, Closed]], Cell[TextData[StyleBox["Define the weighted forecast,"]], "Text"], Cell[CellGroupData[{ Cell[BoxData[ \(V[t_]\ = \ \[Integral]\_t\%T \[Theta]\ \ \(\[ExponentialE]\^\(\(-\[Theta]\) \((s - t)\)\)\) z[t, s] \[DifferentialD]s\)], "Input"], Cell[BoxData[ \(\[Theta]\ \(\[Integral]\_t\%T\( \[ExponentialE]\^\(\(-\((s - t)\)\)\ \ \[Theta]\)\ z[t, s]\) \[DifferentialD]s\)\)], "Output"] }, Closed]], Cell["where", "Text"], Cell[CellGroupData[{ Cell[BoxData[ \(\(\(\ \)\(\[Integral]\_t\%T \[Theta]\ \ \(\[ExponentialE]\^\(\(-\[Theta]\) \((s - t)\)\)\) \[DifferentialD]s // Simplify\)\)\)], "Input"], Cell[BoxData[ \(1 - \[ExponentialE]\^\(\((t - T)\)\ \[Theta]\)\)], "Output"] }, Closed]], Cell[CellGroupData[{ Cell[BoxData[ \(dV\ \ = ItoD[V[t]]\)], "Input", CellDingbat->None, ShowGroupOpenCloseIcon->False], Cell[BoxData[ \(\[Theta]\ \((\[Integral]\_t\%T\( \[ExponentialE]\^\(\(-\((s - t)\)\)\ \ \[Theta]\)\ sigZ[t, s]\) \[DifferentialD]s)\)\ dB\_1 + dt\ \[Theta]\ \((\[Theta]\ \(\[Integral]\_t\%T\( \[ExponentialE]\^\(\(-\ \((s - t)\)\)\ \[Theta]\)\ z[t, s]\) \[DifferentialD]s\) - z[t, t])\)\)], "Output"] }, Closed]], Cell[TextData[{ "Note the drift of ", Cell[BoxData[ \(TraditionalForm\`V\)]], " is ", Cell[BoxData[ \(TraditionalForm\`\[Theta]\ \((V[t]\ - z[t, t])\)\)]], "." }], "Text"], Cell[CellGroupData[{ Cell[BoxData[ \(Drift[dV]\ == \ \[Theta]\ \((V[t] - z[t, t])\) // Simplify\)], "Input"], Cell[BoxData[ \(True\)], "Output"] }, Closed]] }, Closed]] }, Closed]], Cell[CellGroupData[{ Cell["\<\ Deriving the Black-Scholes PDE using a replicating, self-financing trading \ strategy\ \>", "Section"], Cell["\<\ In this section, we use ItosLemma to derive the Black-Scholes PDE in two \ separate ways.\ \>", "Text"], Cell[CellGroupData[{ Cell["Setup", "Subsection"], Cell[BoxData[ \(\(SetOptions[ItoD, SuppressTime \[Rule] False];\)\)], "Input"] }, Closed]], Cell[CellGroupData[{ Cell["First Derivation", "Subsection"], Cell[TextData[{ "This derivation follows that given by Darrell Duffie in chapter 5 of ", StyleBox["Dynamic Asset Pricing Theory", FontSlant->"Italic"], "." }], "Text"], Cell[BoxData[ \(Clear[s, \[Beta], f, \[Mu], \[Sigma]]\)], "Input"], Cell["The diffusions for the stock and the money-market account:", "Text"], Cell[BoxData[ \(TraditionalForm\`\(d\[InvisibleSpace]\(s(t)\)\)\/\(s(t)\) = \ \ \(\[Mu]\ \[InvisibleSpace]dt + \[Sigma]\[InvisibleSpace]\ dB\_1\ \ \ \ and\ \ \ \ \(d\[InvisibleSpace]\(\[Beta](t)\)\)\/\(\[Beta](t)\) = \ r\ \[InvisibleSpace]\(\(dt\)\(.\)\)\)\)], "DisplayFormula"], Cell[CellGroupData[{ Cell[BoxData[{ \(RelativeItoMake[s[t], \[Mu], \ \[Sigma]]\), "\[IndentingNewLine]", \(RelativeItoMake[\[Beta][t], r, \ 0]\)}], "Input"], Cell[BoxData[ \(dt\ \[Mu]\ s[t] + \[Sigma]\ s[t]\ dB\_1\)], "Output"], Cell[BoxData[ \(dt\ r\ \[Beta][t]\)], "Output"] }, Closed]], Cell[TextData[{ "Consider the function of ", Cell[BoxData[ \(TraditionalForm\`f(s(t), t)\)]], ". Its dynamics are given as follows:" }], "Text"], Cell[CellGroupData[{ Cell[BoxData[ \(df = ItoD[f[s[t], t]]\)], "Input"], Cell[BoxData[ RowBox[{ RowBox[{"\[Sigma]", " ", \(s[t]\), " ", \(dB\_1\), " ", RowBox[{ SuperscriptBox["f", TagBox[\((1, 0)\), Derivative], MultilineFunction->None], "[", \(s[t], t\), "]"}]}], "+", RowBox[{"dt", " ", RowBox[{"(", RowBox[{ RowBox[{ SuperscriptBox["f", TagBox[\((0, 1)\), Derivative], MultilineFunction->None], "[", \(s[t], t\), "]"}], "+", RowBox[{"\[Mu]", " ", \(s[t]\), " ", RowBox[{ SuperscriptBox["f", TagBox[\((1, 0)\), Derivative], MultilineFunction->None], "[", \(s[t], t\), "]"}]}], "+", RowBox[{\(1\/2\), " ", \(\[Sigma]\^2\), " ", \(s[t]\^2\), " ", RowBox[{ SuperscriptBox["f", TagBox[\((2, 0)\), Derivative], MultilineFunction->None], "[", \(s[t], t\), "]"}]}]}], ")"}]}]}]], "Output"] }, Closed]], Cell[TextData[{ "Suppose the function can be replicated by a self-financing trading \ strategy with portfolio weights ", Cell[BoxData[ \(TraditionalForm\`a(t)\)]], " and ", Cell[BoxData[ \(TraditionalForm\`b(t)\)]], ":" }], "Text"], Cell[CellGroupData[{ Cell[BoxData[ \(self\ = \ a[t] s[t] + b[t] \[Beta][t]\)], "Input"], Cell[BoxData[ \(a[t]\ s[t] + b[t]\ \[Beta][t]\)], "Output"] }, Closed]], Cell["\<\ By definition, the dynamics of a self-financing trading strategy are given \ by:\ \>", "Text"], Cell[BoxData[ \(TraditionalForm\`\((\[Dagger])\)\ \ \ \ \ \ \ \ \ \ \(d(\(a(t)\) \(s( t)\) + \(b(t)\) \(\[Beta](t)\))\)\ = \ \(a(t)\) d\[InvisibleSpace]\(s(t)\) + \(b(t)\) d\[InvisibleSpace]\(\[Beta](t)\)\)], "DisplayFormula"], Cell[CellGroupData[{ Cell[BoxData[ \(dself = Collect[\[IndentingNewLine]a[t]\ ItoD[s[t]] + b[t]\ ItoD[\[Beta][t]], \[IndentingNewLine]{dt, \ dB\_1}]\)], "Input"], Cell[BoxData[ \(\[Sigma]\ a[t]\ s[t]\ dB\_1 + dt\ \((\[Mu]\ a[t]\ s[t] + r\ b[t]\ \[Beta][t])\)\)], "Output"] }, Closed]], Cell["\<\ If the self-financing trading strategy replicates the function, then the \ drift and diffusion of the self-financing trading strategy will equal the \ drift and diffusion of the function:\ \>", "Text"], Cell[CellGroupData[{ Cell[BoxData[ \(equations = {\[IndentingNewLine]self \[Equal] f[s[t], t], \[IndentingNewLine]Drift[dself] \[Equal] Drift[df], \ Diffusion[dself] \[Equal] Diffusion[df]\[IndentingNewLine]\t}\)], "Input"], Cell[BoxData[ RowBox[{"{", RowBox[{\(a[t]\ s[t] + b[t]\ \[Beta][t] == f[s[t], t]\), ",", RowBox[{\(\[Mu]\ a[t]\ s[t] + r\ b[t]\ \[Beta][t]\), "==", RowBox[{ RowBox[{ SuperscriptBox["f", TagBox[\((0, 1)\), Derivative], MultilineFunction->None], "[", \(s[t], t\), "]"}], "+", RowBox[{"\[Mu]", " ", \(s[t]\), " ", RowBox[{ SuperscriptBox["f", TagBox[\((1, 0)\), Derivative], MultilineFunction->None], "[", \(s[t], t\), "]"}]}], "+", RowBox[{\(1\/2\), " ", \(\[Sigma]\^2\), " ", \(s[t]\^2\), " ", RowBox[{ SuperscriptBox["f", TagBox[\((2, 0)\), Derivative], MultilineFunction->None], "[", \(s[t], t\), "]"}]}]}]}], ",", RowBox[{\(\[Sigma]\ a[t]\ s[t]\), "==", RowBox[{"\[Sigma]", " ", \(s[t]\), " ", RowBox[{ SuperscriptBox["f", TagBox[\((1, 0)\), Derivative], MultilineFunction->None], "[", \(s[t], t\), "]"}]}]}]}], "}"}]], "Output"] }, Closed]], Cell["\<\ We can obtain the PDE by eliminating the weights from the equations:\ \>", "Text"], Cell[CellGroupData[{ Cell[BoxData[ \(pde1\ = \ Eliminate[equations, \ {a[t], \ b[t]}] /. s[t] \[Rule] x\)], "Input"], Cell[BoxData[ RowBox[{ RowBox[{"\[Sigma]", " ", RowBox[{"(", RowBox[{ RowBox[{"2", " ", RowBox[{ SuperscriptBox["f", TagBox[\((0, 1)\), Derivative], MultilineFunction->None], "[", \(x, t\), "]"}]}], "+", RowBox[{"2", " ", "r", " ", "x", " ", RowBox[{ SuperscriptBox["f", TagBox[\((1, 0)\), Derivative], MultilineFunction->None], "[", \(x, t\), "]"}]}], "+", RowBox[{\(x\^2\), " ", \(\[Sigma]\^2\), " ", RowBox[{ SuperscriptBox["f", TagBox[\((2, 0)\), Derivative], MultilineFunction->None], "[", \(x, t\), "]"}]}]}], ")"}]}], "==", \(2\ r\ \[Sigma]\ f[x, t]\)}]], "Output"] }, Closed]], Cell[CellGroupData[{ Cell["Is the trading strategy really self-financing?", "Subsubsection"], Cell["\<\ We can solve for the portfolio weights using the equality of the function \ with the portfolio and the equality of the diffusions:\ \>", "Text"], Cell[CellGroupData[{ Cell[BoxData[ \(weights\ = \ First\ @\ Solve[equations[\([{1, 3}]\)], {a[t], \ b[t]}]\)], "Input"], Cell[BoxData[ RowBox[{"{", RowBox[{ RowBox[{\(b[t]\), "\[Rule]", RowBox[{"-", FractionBox[ RowBox[{\(-f[s[t], t]\), "+", RowBox[{\(s[t]\), " ", RowBox[{ SuperscriptBox["f", TagBox[\((1, 0)\), Derivative], MultilineFunction->None], "[", \(s[t], t\), "]"}]}]}], \(\[Beta][t]\)]}]}], ",", RowBox[{\(a[t]\), "\[Rule]", RowBox[{ SuperscriptBox["f", TagBox[\((1, 0)\), Derivative], MultilineFunction->None], "[", \(s[t], t\), "]"}]}]}], "}"}]], "Output"] }, Closed]], Cell[TextData[{ "Is the trading strategy really self-financing? We can check ", Cell[BoxData[ \(TraditionalForm\`\((\[Dagger])\)\)]], "." }], "Text"], Cell[CellGroupData[{ Cell[BoxData[ \(firstway\ = \ ItoD[self /. weights]\)], "Input"], Cell[BoxData[ RowBox[{ RowBox[{"\[Sigma]", " ", \(s[t]\), " ", \(dB\_1\), " ", RowBox[{ SuperscriptBox["f", TagBox[\((1, 0)\), Derivative], MultilineFunction->None], "[", \(s[t], t\), "]"}]}], "+", RowBox[{"dt", " ", RowBox[{"(", RowBox[{ RowBox[{ SuperscriptBox["f", TagBox[\((0, 1)\), Derivative], MultilineFunction->None], "[", \(s[t], t\), "]"}], "+", RowBox[{"\[Mu]", " ", \(s[t]\), " ", RowBox[{ SuperscriptBox["f", TagBox[\((1, 0)\), Derivative], MultilineFunction->None], "[", \(s[t], t\), "]"}]}], "+", RowBox[{\(1\/2\), " ", \(\[Sigma]\^2\), " ", \(s[t]\^2\), " ", RowBox[{ SuperscriptBox["f", TagBox[\((2, 0)\), Derivative], MultilineFunction->None], "[", \(s[t], t\), "]"}]}]}], ")"}]}]}]], "Output"] }, Closed]], Cell[CellGroupData[{ Cell[BoxData[ \(secondway = dself /. weights\)], "Input"], Cell[BoxData[ RowBox[{ RowBox[{"\[Sigma]", " ", \(s[t]\), " ", \(dB\_1\), " ", RowBox[{ SuperscriptBox["f", TagBox[\((1, 0)\), Derivative], MultilineFunction->None], "[", \(s[t], t\), "]"}]}], "+", RowBox[{"dt", " ", RowBox[{"(", RowBox[{ RowBox[{"\[Mu]", " ", \(s[t]\), " ", RowBox[{ SuperscriptBox["f", TagBox[\((1, 0)\), Derivative], MultilineFunction->None], "[", \(s[t], t\), "]"}]}], "-", RowBox[{"r", " ", RowBox[{"(", RowBox[{\(-f[s[t], t]\), "+", RowBox[{\(s[t]\), " ", RowBox[{ SuperscriptBox["f", TagBox[\((1, 0)\), Derivative], MultilineFunction->None], "[", \(s[t], t\), "]"}]}]}], ")"}]}]}], ")"}]}]}]], "Output"] }, Closed]], Cell["The diffusions are equal:", "Text"], Cell[CellGroupData[{ Cell[BoxData[ \(Diffusion[firstway] \[Equal] Diffusion[secondway] // Simplify\)], "Input"], Cell[BoxData[ \(True\)], "Output"] }, Closed]], Cell["\<\ The drifts are equal if and only if the PDE is satisfied. In other words, the \ trading strategy is self-financing if and only if it replicates.\ \>", "Text"], Cell[CellGroupData[{ Cell[BoxData[ \(pde2\ = \ Drift[firstway] == Drift[secondway] /. s[t] \[Rule] x\)], "Input"], Cell[BoxData[ RowBox[{ RowBox[{ RowBox[{ SuperscriptBox["f", TagBox[\((0, 1)\), Derivative], MultilineFunction->None], "[", \(x, t\), "]"}], "+", RowBox[{"x", " ", "\[Mu]", " ", RowBox[{ SuperscriptBox["f", TagBox[\((1, 0)\), Derivative], MultilineFunction->None], "[", \(x, t\), "]"}]}], "+", RowBox[{\(1\/2\), " ", \(x\^2\), " ", \(\[Sigma]\^2\), " ", RowBox[{ SuperscriptBox["f", TagBox[\((2, 0)\), Derivative], MultilineFunction->None], "[", \(x, t\), "]"}]}]}], "==", RowBox[{ RowBox[{"x", " ", "\[Mu]", " ", RowBox[{ SuperscriptBox["f", TagBox[\((1, 0)\), Derivative], MultilineFunction->None], "[", \(x, t\), "]"}]}], "-", RowBox[{"r", " ", RowBox[{"(", RowBox[{\(-f[x, t]\), "+", RowBox[{"x", " ", RowBox[{ SuperscriptBox["f", TagBox[\((1, 0)\), Derivative], MultilineFunction->None], "[", \(x, t\), "]"}]}]}], ")"}]}]}]}]], "Output"] }, Closed]], Cell[TextData[{ "We can check that the two PDEs are the same by eliminating the parameter \ ", Cell[BoxData[ \(TraditionalForm\`r\)]], " from the two:" }], "Text"], Cell[CellGroupData[{ Cell[BoxData[ \(Eliminate[{pde1, pde2}, r]\)], "Input"], Cell[BoxData[ \(True\)], "Output"] }, Closed]] }, Closed]] }, Closed]], Cell[CellGroupData[{ Cell["Second derivation", "Subsection"], Cell[TextData[{ "The absence of arbitrage requires that any self-financing trading strategy \ deflated by the state-price deflator must be a martingale. In other words, \ the drift of the deflated trading strategy must be zero. The dynamics of the \ state-price deflator ", Cell[BoxData[ \(TraditionalForm\`\[DoubledPi](t)\)]], " can be expressed in terms of the risk-free rate and the price of risk ", Cell[BoxData[ \(TraditionalForm\`\[Lambda]\)]], ":" }], "Text"], Cell[CellGroupData[{ Cell[BoxData[ \(RelativeItoMake[\[DoubledPi][t], \ \(-r\), \ \(-\[Lambda]\)]\)], "Input"], Cell[BoxData[ \(\(-dt\)\ r\ \[DoubledPi][t] - \[Lambda]\ dB\_1\ \[DoubledPi][ t]\)], "Output"] }, Closed]], Cell["\<\ The simplest trading strategy is to buy and hold an asset that pays no \ dividends. For the stock we have:\ \>", "Text"], Cell[CellGroupData[{ Cell[BoxData[ \(noarb1\ = Drift\ @\ ItoD[s[t] \[DoubledPi][t]] \[Equal] 0\)], "Input"], Cell[BoxData[ \(\(-r\)\ s[t]\ \[DoubledPi][t] + \[Mu]\ s[t]\ \[DoubledPi][ t] - \[Lambda]\ \[Sigma]\ s[t]\ \[DoubledPi][t] == 0\)], "Output"] }, Closed]], Cell["\<\ In this case, the martingale property implies the expected return equals the \ risk-free rate plus a risk premium that is the product of the relative \ volatility and the price of risk:\ \>", "Text"], Cell[CellGroupData[{ Cell[BoxData[ \(Solve[noarb1, \ \[Mu]]\)], "Input"], Cell[BoxData[ \({{\[Mu] \[Rule] \(r\ s[t]\ \[DoubledPi][t] + \[Lambda]\ \[Sigma]\ s[t]\ \ \[DoubledPi][t]\)\/\(s[t]\ \[DoubledPi][t]\)}}\)], "Output"] }, Closed]], Cell["For the derivative security we have:", "Text"], Cell[CellGroupData[{ Cell[BoxData[ \(noarb2\ = \ Drift\ @\ ItoD[f[s[t], t] \[DoubledPi][t]] \[Equal] 0\)], "Input"], Cell[BoxData[ RowBox[{ RowBox[{\(\(-r\)\ f[s[t], t]\ \[DoubledPi][t]\), "-", RowBox[{ "\[Lambda]", " ", "\[Sigma]", " ", \(s[t]\), " ", \(\[DoubledPi][t]\), " ", RowBox[{ SuperscriptBox["f", TagBox[\((1, 0)\), Derivative], MultilineFunction->None], "[", \(s[t], t\), "]"}]}], "+", RowBox[{\(\[DoubledPi][t]\), " ", RowBox[{"(", RowBox[{ RowBox[{ SuperscriptBox["f", TagBox[\((0, 1)\), Derivative], MultilineFunction->None], "[", \(s[t], t\), "]"}], "+", RowBox[{"\[Mu]", " ", \(s[t]\), " ", RowBox[{ SuperscriptBox["f", TagBox[\((1, 0)\), Derivative], MultilineFunction->None], "[", \(s[t], t\), "]"}]}]}], ")"}]}], "+", RowBox[{\(1\/2\), " ", \(\[Sigma]\^2\), " ", \(s[t]\^2\), " ", \(\[DoubledPi][t]\), " ", RowBox[{ SuperscriptBox["f", TagBox[\((2, 0)\), Derivative], MultilineFunction->None], "[", \(s[t], t\), "]"}]}]}], "==", "0"}]], "Output"] }, Closed]], Cell[TextData[{ "We can obtain the PDE by eliminating the price of risk ", Cell[BoxData[ \(TraditionalForm\`\[Lambda]\)]], " from the two absence-of-arbitrage conditions:" }], "Text"], Cell[CellGroupData[{ Cell[BoxData[ \(pde3 = Eliminate[{noarb1, \ noarb2}, \ \[Lambda]] /. s[t] \[Rule] x\)], "Input"], Cell[BoxData[ RowBox[{ RowBox[{\(\[DoubledPi][t]\), " ", RowBox[{"(", RowBox[{\(2\ r\ f[x, t]\), "-", RowBox[{"2", " ", "r", " ", "x", " ", RowBox[{ SuperscriptBox["f", TagBox[\((1, 0)\), Derivative], MultilineFunction->None], "[", \(x, t\), "]"}]}], "-", RowBox[{\(x\^2\), " ", \(\[Sigma]\^2\), " ", RowBox[{ SuperscriptBox["f", TagBox[\((2, 0)\), Derivative], MultilineFunction->None], "[", \(x, t\), "]"}]}]}], ")"}]}], "==", RowBox[{"2", " ", \(\[DoubledPi][t]\), " ", RowBox[{ SuperscriptBox["f", TagBox[\((0, 1)\), Derivative], MultilineFunction->None], "[", \(x, t\), "]"}]}]}]], "Output"] }, Closed]], Cell["\<\ We can check that this PDE is the same as the one derived above:\ \>", "Text"], Cell[CellGroupData[{ Cell[BoxData[ \(Eliminate[{pde1, pde3}, \ r]\)], "Input"], Cell[BoxData[ \(True\)], "Output"] }, Closed]], Cell[BoxData[ \(\(SetOptions[ItoD, SuppressTime \[Rule] True];\)\)], "Input"] }, Closed]], Cell[CellGroupData[{ Cell["\<\ FYI: Black-Scholes solution to the PDE for price of a call option\ \>", "Subsection"], Cell[TextData[{ "European call option pays ", Cell[BoxData[ \(TraditionalForm\`max(x - k, 0)\)]], " on expiration date ", Cell[BoxData[ \(TraditionalForm\`T > t\)]], "." }], "Text"], Cell[BoxData[{ \(Clear[V, \[CapitalPhi]]\), "\[IndentingNewLine]", \(\(\[CapitalPhi][z_] = CDF[NormalDistribution[0, 1], z];\)\), "\[IndentingNewLine]", \(V[x_, t_]\ := \ With[{a = \(Log[x/k] + \((r + \[Sigma]\^2/2)\) \((T - \ t)\)\)\/\(\[Sigma]\ Sqrt[T - t]\)}, x\ \[CapitalPhi][a] - k\ Exp[\(-r\) \((T - t)\)] \[CapitalPhi][ a - \[Sigma]\ Sqrt[T - t]]\[IndentingNewLine]] // Evaluate\)}], "Input"], Cell[CellGroupData[{ Cell[BoxData[ \(V[x, t] // TraditionalForm\)], "Input"], Cell[BoxData[ \(TraditionalForm\`1\/2\ x\ \((erf(\(\((T - t)\)\ \((\[Sigma]\^2\/2 + \ r)\) + log(x\/k)\)\/\(\@2\ \@\(T - t\)\ \[Sigma]\)) + 1)\) - 1\/2\ \[ExponentialE]\^\(\(-r\)\ \((T - t)\)\)\ k\ \((erf(\(\(\((T - t)\ \)\ \((\[Sigma]\^2\/2 + r)\) + log(x\/k)\)\/\(\@\(T - t\)\ \[Sigma]\) - \@\(T \ - t\)\ \[Sigma]\)\/\@2) + 1)\)\)], "Output"] }, Closed]], Cell[CellGroupData[{ Cell[BoxData[ \(pde1 /. f \[Rule] V // Simplify\)], "Input"], Cell[BoxData[ \(True\)], "Output"] }, Closed]] }, Closed]] }, Closed]] }, Open ]] }, FrontEndVersion->"4.2 for Microsoft Windows", ScreenRectangle->{{0, 1280}, {0, 979}}, WindowSize->{644, 696}, WindowMargins->{{Automatic, 20}, {Automatic, 45}}, PrintingCopies->1, PrintingPageRange->{Automatic, Automatic}, Magnification->1.5 ] (******************************************************************* 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->{ "Info3260169726-5396987"->{ Cell[13971, 473, 524, 8, 335, "Print", CellTags->"Info3260169726-5396987"]}, "Info3260169726-1863836"->{ Cell[15620, 521, 302, 5, 135, "Print", CellTags->"Info3260169726-1863836"]}, "Info3260169726-5767607"->{ Cell[16004, 534, 157, 3, 60, "Print", CellTags->"Info3260169726-5767607"]}, "Info3260169726-1807366"->{ Cell[16244, 545, 121, 2, 60, "Print", CellTags->"Info3260169726-1807366"]}, "Info3260169726-8451177"->{ Cell[16452, 555, 187, 3, 85, "Print", CellTags->"Info3260169726-8451177"]}, "Info3260169726-8573689"->{ Cell[17732, 614, 63, 1, 70, "Print", CellTags->"Info3260169726-8573689"], Cell[17798, 617, 498, 14, 70, "Print", CellTags->"Info3260169726-8573689"]}, "Info3260169727-9252446"->{ Cell[33515, 1216, 71, 1, 70, "Print", CellTags->"Info3260169727-9252446"], Cell[33589, 1219, 700, 17, 70, "Print", CellTags->"Info3260169727-9252446"]} } *) (*CellTagsIndex CellTagsIndex->{ {"Info3260169726-5396987", 81427, 2885}, {"Info3260169726-1863836", 81544, 2888}, {"Info3260169726-5767607", 81661, 2891}, {"Info3260169726-1807366", 81777, 2894}, {"Info3260169726-8451177", 81893, 2897}, {"Info3260169726-8573689", 82009, 2900}, {"Info3260169727-9252446", 82210, 2905} } *) (*NotebookFileOutline Notebook[{ Cell[CellGroupData[{ Cell[1776, 53, 100, 4, 174, "Title"], Cell[1879, 59, 156, 5, 181, "Subtitle"], Cell[2038, 66, 34, 0, 95, "Subtitle"], Cell[2075, 68, 41, 0, 78, "Subsubtitle"], Cell[2119, 70, 241, 10, 286, "Subsubtitle"], Cell[CellGroupData[{ Cell[2385, 84, 39, 0, 89, "Section"], Cell[2427, 86, 1846, 39, 468, "Text"], Cell[CellGroupData[{ Cell[4298, 129, 93, 2, 68, "Subsection"], Cell[4394, 133, 415, 9, 152, "Text"], Cell[CellGroupData[{ Cell[4834, 146, 39, 0, 61, "Subsubsection"], Cell[4876, 148, 128, 3, 73, "Text"], Cell[5007, 153, 84, 2, 42, "Input", Evaluatable->False], Cell[5094, 157, 314, 5, 125, "Text"], Cell[5411, 164, 152, 3, 68, "Input", Evaluatable->False], Cell[5566, 169, 564, 17, 125, "Text"], Cell[6133, 188, 1011, 28, 97, "Input", Evaluatable->False], Cell[7147, 218, 185, 4, 99, "Text"] }, Closed]], Cell[CellGroupData[{ Cell[7369, 227, 40, 0, 61, "Subsubsection"], Cell[7412, 229, 653, 14, 204, "Text"], Cell[8068, 245, 271, 11, 47, "Text"], Cell[CellGroupData[{ Cell[8364, 260, 63, 1, 42, "Input"], Cell[8430, 263, 61, 1, 41, "Output"] }, Closed]], Cell[8506, 267, 48, 0, 47, "Text"], Cell[CellGroupData[{ Cell[8579, 271, 91, 1, 42, "Input"], Cell[8673, 274, 68, 1, 41, "Output"] }, Closed]], Cell[8756, 278, 191, 5, 73, "Text"], Cell[8950, 285, 249, 6, 99, "Text"], Cell[CellGroupData[{ Cell[9224, 295, 121, 3, 42, "Input"], Cell[9348, 300, 68, 1, 41, "Output"] }, Closed]], Cell[9431, 304, 255, 9, 73, "Text"], Cell[9689, 315, 73, 0, 47, "Text"], Cell[CellGroupData[{ Cell[9787, 319, 54, 1, 42, "Input"], Cell[9844, 322, 44, 1, 41, "Output"] }, Closed]], Cell[9903, 326, 95, 2, 47, "Text"], Cell[CellGroupData[{ Cell[10023, 332, 74, 1, 42, "Input"], Cell[10100, 335, 79, 1, 41, "Output"] }, Closed]], Cell[10194, 339, 191, 4, 99, "Text"], Cell[10388, 345, 222, 4, 99, "Text"], Cell[CellGroupData[{ Cell[10635, 353, 160, 3, 94, "Input"], Cell[10798, 358, 948, 27, 69, "Output"] }, Closed]], Cell[11761, 388, 193, 6, 73, "Text"], Cell[CellGroupData[{ Cell[11979, 398, 134, 3, 96, "Input"], Cell[12116, 403, 1049, 28, 125, "Output"] }, Closed]] }, Closed]] }, Closed]] }, Closed]], Cell[CellGroupData[{ Cell[13238, 439, 35, 0, 57, "Section"], Cell[13276, 441, 108, 2, 68, "Input"], Cell[13387, 445, 460, 18, 75, "Text"], Cell[13850, 465, 46, 1, 42, "Input"], Cell[CellGroupData[{ Cell[13921, 470, 47, 1, 42, "Input"], Cell[13971, 473, 524, 8, 335, "Print", CellTags->"Info3260169726-5396987"] }, Closed]], Cell[14510, 484, 61, 0, 47, "Text"], Cell[CellGroupData[{ Cell[14596, 488, 185, 3, 94, "Input"], Cell[14784, 493, 70, 1, 41, "Output"] }, Closed]], Cell[14869, 497, 66, 0, 47, "Text"], Cell[CellGroupData[{ Cell[14960, 501, 57, 1, 42, "Input"], Cell[15020, 504, 475, 7, 241, "Output"] }, Closed]], Cell[15510, 514, 37, 0, 47, "Text"], Cell[CellGroupData[{ Cell[15572, 518, 45, 1, 42, "Input"], Cell[15620, 521, 302, 5, 135, "Print", CellTags->"Info3260169726-1863836"] }, Closed]], Cell[CellGroupData[{ Cell[15959, 531, 42, 1, 42, "Input"], Cell[16004, 534, 157, 3, 60, "Print", CellTags->"Info3260169726-5767607"] }, Closed]], Cell[CellGroupData[{ Cell[16198, 542, 43, 1, 42, "Input"], Cell[16244, 545, 121, 2, 60, "Print", CellTags->"Info3260169726-1807366"] }, Closed]], Cell[CellGroupData[{ Cell[16402, 552, 47, 1, 42, "Input"], Cell[16452, 555, 187, 3, 85, "Print", CellTags->"Info3260169726-8451177"] }, Closed]] }, Closed]], Cell[CellGroupData[{ Cell[16688, 564, 107, 2, 57, "Section"], Cell[CellGroupData[{ Cell[16820, 570, 37, 0, 68, "Subsection"], Cell[CellGroupData[{ Cell[16882, 574, 365, 12, 83, "Subsubsection"], Cell[CellGroupData[{ Cell[17272, 590, 109, 2, 68, "Input"], Cell[17384, 594, 61, 1, 70, "Output"] }, Closed]], Cell[17460, 598, 205, 9, 48, "Text"], Cell[CellGroupData[{ Cell[17690, 611, 39, 1, 42, "Input"], Cell[17732, 614, 63, 1, 70, "Print", CellTags->"Info3260169726-8573689"], Cell[17798, 617, 498, 14, 70, "Print", CellTags->"Info3260169726-8573689"] }, Closed]], Cell[18311, 634, 151, 5, 47, "Text"], Cell[CellGroupData[{ Cell[18487, 643, 42, 1, 42, "Input"], Cell[18532, 646, 39, 1, 70, "Output"] }, Closed]], Cell[CellGroupData[{ Cell[18608, 652, 46, 1, 42, "Input"], Cell[18657, 655, 42, 1, 70, "Output"] }, Closed]], Cell[18714, 659, 60, 0, 47, "Text"], Cell[CellGroupData[{ Cell[18799, 663, 79, 2, 68, "Input"], Cell[18881, 667, 44, 1, 70, "Output"], Cell[18928, 670, 1037, 28, 70, "Output"] }, Closed]], Cell[19980, 701, 412, 15, 75, "Text"], Cell[CellGroupData[{ Cell[20417, 720, 46, 1, 42, "Input"], Cell[20466, 723, 102, 2, 70, "Output"] }, Closed]], Cell[CellGroupData[{ Cell[20605, 730, 74, 1, 42, "Input"], Cell[20682, 733, 1049, 28, 70, "Output"] }, Closed]], Cell[21746, 764, 131, 5, 47, "Text"], Cell[CellGroupData[{ Cell[21902, 773, 99, 2, 68, "Input"], Cell[22004, 777, 158, 4, 70, "Output"] }, Closed]] }, Closed]], Cell[CellGroupData[{ Cell[22211, 787, 39, 0, 38, "Subsubsection"], Cell[22253, 789, 28, 0, 47, "Text"], Cell[CellGroupData[{ Cell[22306, 793, 94, 3, 42, "Input"], Cell[22403, 798, 36, 1, 41, "Output"] }, Closed]], Cell[22454, 802, 115, 3, 73, "Text"], Cell[22572, 807, 41, 1, 42, "Input"], Cell[CellGroupData[{ Cell[22638, 812, 115, 3, 42, "Input"], Cell[22756, 817, 39, 1, 41, "Output"] }, Closed]], Cell[CellGroupData[{ Cell[22832, 823, 103, 3, 69, "Input"], Cell[22938, 828, 50, 1, 57, "Output"] }, Closed]], Cell[23003, 832, 101, 5, 47, "Text"], Cell[CellGroupData[{ Cell[23129, 841, 67, 1, 42, "Input"], Cell[23199, 844, 61, 1, 41, "Output"] }, Closed]], Cell[CellGroupData[{ Cell[23297, 850, 163, 4, 62, "Input"], Cell[23463, 856, 47, 1, 41, "Output"] }, Closed]], Cell[23525, 860, 128, 5, 47, "Text"], Cell[23656, 867, 44, 1, 42, "Input"], Cell[CellGroupData[{ Cell[23725, 872, 183, 5, 45, "Input"], Cell[23911, 879, 109, 2, 44, "Output"] }, Closed]], Cell[CellGroupData[{ Cell[24057, 886, 97, 3, 42, "Input"], Cell[24157, 891, 109, 2, 44, "Output"] }, Closed]], Cell[24281, 896, 54, 0, 47, "Text"], Cell[CellGroupData[{ Cell[24360, 900, 47, 1, 42, "Input"], Cell[24410, 903, 44, 1, 41, "Output"] }, Closed]], Cell[CellGroupData[{ Cell[24491, 909, 100, 3, 42, "Input"], Cell[24594, 914, 1570, 40, 132, "Output"] }, Closed]], Cell[26179, 957, 47, 0, 47, "Text"], Cell[CellGroupData[{ Cell[26251, 961, 130, 3, 42, "Input"], Cell[26384, 966, 1908, 48, 166, "Output"] }, Closed]], Cell[28307, 1017, 39, 0, 47, "Text"], Cell[CellGroupData[{ Cell[28371, 1021, 54, 1, 42, "Input"], Cell[28428, 1024, 303, 8, 46, "Output"] }, Closed]], Cell[28746, 1035, 150, 7, 47, "Text"], Cell[CellGroupData[{ Cell[28921, 1046, 66, 1, 42, "Input"], Cell[28990, 1049, 2502, 63, 205, "Output"] }, Closed]], Cell[31507, 1115, 242, 8, 73, "Text"], Cell[CellGroupData[{ Cell[31774, 1127, 65, 1, 42, "Input"], Cell[31842, 1130, 74, 1, 44, "Output"] }, Closed]], Cell[31931, 1134, 130, 5, 47, "Text"], Cell[CellGroupData[{ Cell[32086, 1143, 65, 1, 42, "Input"], Cell[32154, 1146, 42, 1, 41, "Output"] }, Closed]], Cell[32211, 1150, 56, 0, 47, "Text"], Cell[CellGroupData[{ Cell[32292, 1154, 122, 3, 68, "Input"], Cell[32417, 1159, 48, 1, 41, "Output"] }, Closed]], Cell[CellGroupData[{ Cell[32502, 1165, 92, 1, 68, "Input"], Cell[32597, 1168, 47, 1, 41, "Output"] }, Closed]], Cell[CellGroupData[{ Cell[32681, 1174, 44, 1, 42, "Input"], Cell[32728, 1177, 62, 1, 44, "Output"] }, Closed]] }, Closed]] }, Closed]], Cell[CellGroupData[{ Cell[32851, 1185, 57, 0, 68, "Subsection"], Cell[32911, 1187, 52, 1, 42, "Input"], Cell[CellGroupData[{ Cell[32988, 1192, 102, 2, 42, "Input"], Cell[33093, 1196, 90, 1, 70, "Output"] }, Closed]], Cell[33198, 1200, 242, 9, 74, "Text"], Cell[CellGroupData[{ Cell[33465, 1213, 47, 1, 42, "Input"], Cell[33515, 1216, 71, 1, 70, "Print", CellTags->"Info3260169727-9252446"], Cell[33589, 1219, 700, 17, 70, "Print", CellTags->"Info3260169727-9252446"] }, Closed]], Cell[CellGroupData[{ Cell[34326, 1241, 102, 2, 42, "Input"], Cell[34431, 1245, 90, 1, 70, "Output"] }, Closed]], Cell[34536, 1249, 358, 14, 75, "Text"], Cell[CellGroupData[{ Cell[34919, 1267, 55, 1, 42, "Input"], Cell[34977, 1270, 192, 3, 70, "Output"] }, Closed]], Cell[CellGroupData[{ Cell[35206, 1278, 65, 1, 42, "Input"], Cell[35274, 1281, 3940, 100, 70, "Output"] }, Closed]] }, Closed]], Cell[CellGroupData[{ Cell[39263, 1387, 90, 1, 42, "Subsection"], Cell[CellGroupData[{ Cell[39378, 1392, 143, 3, 94, "Input"], Cell[39524, 1397, 55, 1, 70, "Output"], Cell[39582, 1400, 61, 1, 70, "Output"] }, Closed]], Cell[CellGroupData[{ Cell[39680, 1406, 38, 0, 61, "Subsubsection"], Cell[CellGroupData[{ Cell[39743, 1410, 54, 1, 42, "Input"], Cell[39800, 1413, 76, 1, 70, "Output"] }, Closed]], Cell[CellGroupData[{ Cell[39913, 1419, 70, 1, 42, "Input"], Cell[39986, 1422, 234, 3, 70, "Output"] }, Closed]] }, Closed]], Cell[CellGroupData[{ Cell[40269, 1431, 39, 0, 61, "Subsubsection"], Cell[CellGroupData[{ Cell[40333, 1435, 105, 2, 43, "Input"], Cell[40441, 1439, 101, 2, 70, "Output"] }, Closed]], Cell[CellGroupData[{ Cell[40579, 1446, 57, 1, 42, "Input"], Cell[40639, 1449, 639, 20, 70, "Output"] }, Closed]] }, Closed]], Cell[CellGroupData[{ Cell[41327, 1475, 38, 0, 61, "Subsubsection"], Cell[41368, 1477, 56, 0, 47, "Text"], Cell[CellGroupData[{ Cell[41449, 1481, 161, 3, 69, "Input"], Cell[41613, 1486, 203, 3, 70, "Output"] }, Closed]], Cell[CellGroupData[{ Cell[41853, 1494, 68, 1, 42, "Input"], Cell[41924, 1497, 43, 1, 70, "Output"] }, Closed]] }, Closed]] }, Closed]] }, Closed]], Cell[CellGroupData[{ Cell[42040, 1506, 40, 0, 57, "Section"], Cell[CellGroupData[{ Cell[42105, 1510, 84, 1, 68, "Subsection"], Cell[CellGroupData[{ Cell[42214, 1515, 38, 0, 61, "Subsubsection"], Cell[42255, 1517, 326, 11, 73, "Text"], Cell[CellGroupData[{ Cell[42606, 1532, 115, 2, 68, "Input"], Cell[42724, 1536, 79, 1, 70, "Output"] }, Closed]] }, Closed]], Cell[CellGroupData[{ Cell[42852, 1543, 116, 4, 38, "Subsubsection"], Cell[42971, 1549, 220, 5, 73, "Text"], Cell[CellGroupData[{ Cell[43216, 1558, 46, 1, 42, "Input"], Cell[43265, 1561, 374, 10, 43, "Output"] }, Closed]], Cell[43654, 1574, 380, 13, 47, "Text"], Cell[44037, 1589, 893, 24, 52, "Text"] }, Closed]], Cell[CellGroupData[{ Cell[44967, 1618, 73, 0, 61, "Subsubsection"], Cell[45043, 1620, 211, 8, 52, "Text"], Cell[CellGroupData[{ Cell[45279, 1632, 124, 3, 49, "Input"], Cell[45406, 1637, 547, 9, 70, "Output"] }, Closed]], Cell[45968, 1649, 41, 1, 42, "Input"], Cell[CellGroupData[{ Cell[46034, 1654, 115, 3, 42, "Input"], Cell[46152, 1659, 547, 9, 70, "Output"] }, Closed]], Cell[46714, 1671, 249, 8, 52, "Text"], Cell[CellGroupData[{ Cell[46988, 1683, 71, 1, 42, "Input"], Cell[47062, 1686, 3455, 71, 70, "Output"] }, Closed]], Cell[50532, 1760, 96, 2, 47, "Text"], Cell[CellGroupData[{ Cell[50653, 1766, 171, 4, 76, "Input"], Cell[50827, 1772, 79, 1, 70, "Output"] }, Closed]] }, Closed]], Cell[CellGroupData[{ Cell[50955, 1779, 73, 0, 38, "Subsubsection"], Cell[51031, 1781, 58, 0, 47, "Text"], Cell[CellGroupData[{ Cell[51114, 1785, 119, 2, 69, "Input"], Cell[51236, 1789, 104, 2, 42, "Output"] }, Closed]], Cell[CellGroupData[{ Cell[51377, 1796, 64, 1, 42, "Input"], Cell[51444, 1799, 79, 1, 42, "Output"] }, Closed]], Cell[51538, 1803, 256, 8, 52, "Text"], Cell[51797, 1813, 41, 1, 42, "Input"], Cell[CellGroupData[{ Cell[51863, 1818, 102, 2, 68, "Input"], Cell[51968, 1822, 853, 23, 76, "Output"] }, Closed]], Cell[52836, 1848, 67, 0, 47, "Text"], Cell[CellGroupData[{ Cell[52928, 1852, 153, 3, 95, "Input"], Cell[53084, 1857, 260, 6, 46, "Output"] }, Closed]], Cell[53359, 1866, 129, 3, 73, "Text"], Cell[CellGroupData[{ Cell[53513, 1873, 189, 5, 49, "Input"], Cell[53705, 1880, 244, 4, 96, "Output"] }, Closed]], Cell[53964, 1887, 221, 10, 48, "Text"], Cell[CellGroupData[{ Cell[54210, 1901, 125, 2, 68, "Input"], Cell[54338, 1905, 187, 4, 70, "Output"] }, Closed]], Cell[54540, 1912, 57, 0, 47, "Text"], Cell[CellGroupData[{ Cell[54622, 1916, 71, 1, 43, "Input"], Cell[54696, 1919, 108, 2, 42, "Output"] }, Closed]] }, Closed]], Cell[CellGroupData[{ Cell[54853, 1927, 35, 0, 61, "Subsubsection"], Cell[CellGroupData[{ Cell[54913, 1931, 119, 2, 69, "Input"], Cell[55035, 1935, 104, 2, 70, "Output"] }, Closed]], Cell[55154, 1940, 127, 3, 73, "Text"], Cell[CellGroupData[{ Cell[55306, 1947, 109, 2, 62, "Input"], Cell[55418, 1951, 257, 4, 70, "Output"] }, Closed]] }, Closed]] }, Closed]], Cell[CellGroupData[{ Cell[55736, 1962, 77, 1, 68, "Subsection"], Cell[CellGroupData[{ Cell[55838, 1967, 111, 3, 42, "Input"], Cell[55952, 1972, 119, 2, 70, "Output"] }, Closed]], Cell[CellGroupData[{ Cell[56108, 1979, 102, 3, 42, "Input"], Cell[56213, 1984, 74, 1, 70, "Output"] }, Closed]], Cell[CellGroupData[{ Cell[56324, 1990, 105, 3, 42, "Input"], Cell[56432, 1995, 107, 2, 70, "Output"] }, Closed]], Cell[CellGroupData[{ Cell[56576, 2002, 141, 3, 42, "Input"], Cell[56720, 2007, 257, 6, 70, "Output"] }, Closed]], Cell[CellGroupData[{ Cell[57014, 2018, 119, 3, 42, "Input"], Cell[57136, 2023, 123, 2, 70, "Output"] }, Closed]] }, Closed]], Cell[CellGroupData[{ Cell[57308, 2031, 100, 1, 42, "Subsection"], Cell[57411, 2034, 112, 2, 42, "Input"], Cell[57526, 2038, 36, 0, 47, "Text"], Cell[CellGroupData[{ Cell[57587, 2042, 132, 3, 42, "Input"], Cell[57722, 2047, 75, 1, 70, "Output"] }, Closed]], Cell[CellGroupData[{ Cell[57834, 2053, 105, 3, 42, "Input"], Cell[57942, 2058, 63, 1, 70, "Output"] }, Closed]], Cell[58020, 2062, 90, 2, 47, "Text"], Cell[CellGroupData[{ Cell[58135, 2068, 120, 3, 42, "Input"], Cell[58258, 2073, 51, 1, 70, "Output"] }, Closed]], Cell[CellGroupData[{ Cell[58346, 2079, 111, 3, 42, "Input"], Cell[58460, 2084, 39, 1, 70, "Output"] }, Closed]], Cell[CellGroupData[{ Cell[58536, 2090, 83, 1, 42, "Input"], Cell[58622, 2093, 67, 1, 70, "Output"] }, Closed]], Cell[CellGroupData[{ Cell[58726, 2099, 68, 1, 42, "Input"], Cell[58797, 2102, 63, 1, 70, "Output"] }, Closed]], Cell[58875, 2106, 41, 0, 47, "Text"], Cell[CellGroupData[{ Cell[58941, 2110, 89, 1, 42, "Input"], Cell[59033, 2113, 82, 1, 70, "Output"] }, Closed]], Cell[59130, 2117, 64, 0, 47, "Text"], Cell[CellGroupData[{ Cell[59219, 2121, 74, 1, 42, "Input"], Cell[59296, 2124, 167, 3, 70, "Output"] }, Closed]], Cell[59478, 2130, 51, 0, 47, "Text"], Cell[CellGroupData[{ Cell[59554, 2134, 52, 1, 42, "Input"], Cell[59609, 2137, 87, 1, 70, "Output"] }, Closed]] }, Closed]], Cell[CellGroupData[{ Cell[59745, 2144, 53, 0, 42, "Subsection"], Cell[59801, 2146, 150, 5, 47, "Text"], Cell[59954, 2153, 44, 1, 42, "Input"], Cell[60001, 2156, 90, 1, 68, "Input"], Cell[60094, 2159, 57, 0, 47, "Text"], Cell[CellGroupData[{ Cell[60176, 2163, 118, 3, 42, "Input"], Cell[60297, 2168, 51, 1, 41, "Output"] }, Closed]], Cell[60363, 2172, 65, 0, 47, "Text"], Cell[CellGroupData[{ Cell[60453, 2176, 162, 3, 62, "Input"], Cell[60618, 2181, 146, 2, 62, "Output"] }, Closed]], Cell[60779, 2186, 21, 0, 47, "Text"], Cell[CellGroupData[{ Cell[60825, 2190, 164, 3, 62, "Input"], Cell[60992, 2195, 80, 1, 43, "Output"] }, Closed]], Cell[CellGroupData[{ Cell[61109, 2201, 106, 3, 42, "Input"], Cell[61218, 2206, 323, 5, 112, "Output"] }, Closed]], Cell[61556, 2214, 194, 8, 47, "Text"], Cell[CellGroupData[{ Cell[61775, 2226, 92, 1, 42, "Input"], Cell[61870, 2229, 38, 1, 41, "Output"] }, Closed]] }, Closed]] }, Closed]], Cell[CellGroupData[{ Cell[61969, 2237, 112, 3, 98, "Section"], Cell[62084, 2242, 113, 3, 73, "Text"], Cell[CellGroupData[{ Cell[62222, 2249, 27, 0, 68, "Subsection"], Cell[62252, 2251, 82, 1, 42, "Input"] }, Closed]], Cell[CellGroupData[{ Cell[62371, 2257, 38, 0, 42, "Subsection"], Cell[62412, 2259, 177, 5, 73, "Text"], Cell[62592, 2266, 70, 1, 42, "Input"], Cell[62665, 2269, 74, 0, 47, "Text"], Cell[62742, 2271, 291, 4, 59, "DisplayFormula"], Cell[CellGroupData[{ Cell[63058, 2279, 144, 2, 68, "Input"], Cell[63205, 2283, 73, 1, 41, "Output"], Cell[63281, 2286, 51, 1, 41, "Output"] }, Closed]], Cell[63347, 2290, 156, 5, 47, "Text"], Cell[CellGroupData[{ Cell[63528, 2299, 54, 1, 42, "Input"], Cell[63585, 2302, 1097, 28, 125, "Output"] }, Closed]], Cell[64697, 2333, 253, 9, 73, "Text"], Cell[CellGroupData[{ Cell[64975, 2346, 71, 1, 42, "Input"], Cell[65049, 2349, 63, 1, 41, "Output"] }, Closed]], Cell[65127, 2353, 104, 3, 47, "Text"], Cell[65234, 2358, 269, 4, 35, "DisplayFormula"], Cell[CellGroupData[{ Cell[65528, 2366, 173, 4, 94, "Input"], Cell[65704, 2372, 120, 2, 41, "Output"] }, Closed]], Cell[65839, 2377, 211, 4, 99, "Text"], Cell[CellGroupData[{ Cell[66075, 2385, 237, 4, 146, "Input"], Cell[66315, 2391, 1255, 30, 168, "Output"] }, Closed]], Cell[67585, 2424, 92, 2, 47, "Text"], Cell[CellGroupData[{ Cell[67702, 2430, 107, 2, 68, "Input"], Cell[67812, 2434, 911, 23, 69, "Output"] }, Closed]], Cell[CellGroupData[{ Cell[68760, 2462, 71, 0, 61, "Subsubsection"], Cell[68834, 2464, 154, 3, 73, "Text"], Cell[CellGroupData[{ Cell[69013, 2471, 110, 2, 94, "Input"], Cell[69126, 2475, 735, 20, 96, "Output"] }, Closed]], Cell[69876, 2498, 161, 5, 47, "Text"], Cell[CellGroupData[{ Cell[70062, 2507, 69, 1, 42, "Input"], Cell[70134, 2510, 1097, 28, 125, "Output"] }, Closed]], Cell[CellGroupData[{ Cell[71268, 2543, 61, 1, 42, "Input"], Cell[71332, 2546, 1021, 26, 95, "Output"] }, Closed]], Cell[72368, 2575, 41, 0, 47, "Text"], Cell[CellGroupData[{ Cell[72434, 2579, 101, 2, 68, "Input"], Cell[72538, 2583, 38, 1, 41, "Output"] }, Closed]], Cell[72591, 2587, 168, 3, 73, "Text"], Cell[CellGroupData[{ Cell[72784, 2594, 104, 2, 68, "Input"], Cell[72891, 2598, 1305, 36, 114, "Output"] }, Closed]], Cell[74211, 2637, 175, 6, 73, "Text"], Cell[CellGroupData[{ Cell[74411, 2647, 59, 1, 42, "Input"], Cell[74473, 2650, 38, 1, 41, "Output"] }, Closed]] }, Closed]] }, Closed]], Cell[CellGroupData[{ Cell[74572, 2658, 39, 0, 68, "Subsection"], Cell[74614, 2660, 488, 11, 151, "Text"], Cell[CellGroupData[{ Cell[75127, 2675, 93, 1, 42, "Input"], Cell[75223, 2678, 108, 2, 70, "Output"] }, Closed]], Cell[75346, 2683, 130, 3, 73, "Text"], Cell[CellGroupData[{ Cell[75501, 2690, 91, 1, 42, "Input"], Cell[75595, 2693, 157, 2, 70, "Output"] }, Closed]], Cell[75767, 2698, 209, 4, 99, "Text"], Cell[CellGroupData[{ Cell[76001, 2706, 55, 1, 42, "Input"], Cell[76059, 2709, 154, 2, 70, "Output"] }, Closed]], Cell[76228, 2714, 52, 0, 47, "Text"], Cell[CellGroupData[{ Cell[76305, 2718, 106, 2, 42, "Input"], Cell[76414, 2722, 1296, 33, 70, "Output"] }, Closed]], Cell[77725, 2758, 195, 5, 73, "Text"], Cell[CellGroupData[{ Cell[77945, 2767, 107, 2, 68, "Input"], Cell[78055, 2771, 900, 23, 70, "Output"] }, Closed]], Cell[78970, 2797, 88, 2, 47, "Text"], Cell[CellGroupData[{ Cell[79083, 2803, 61, 1, 42, "Input"], Cell[79147, 2806, 38, 1, 70, "Output"] }, Closed]], Cell[79200, 2810, 81, 1, 42, "Input"] }, Closed]], Cell[CellGroupData[{ Cell[79318, 2816, 95, 2, 68, "Subsection"], Cell[79416, 2820, 203, 8, 47, "Text"], Cell[79622, 2830, 479, 10, 212, "Input"], Cell[CellGroupData[{ Cell[80126, 2844, 59, 1, 42, "Input"], Cell[80188, 2847, 355, 5, 70, "Output"] }, Closed]], Cell[CellGroupData[{ Cell[80580, 2857, 64, 1, 42, "Input"], Cell[80647, 2860, 38, 1, 70, "Output"] }, Closed]] }, Closed]] }, Closed]] }, Open ]] } ] *) (******************************************************************* End of Mathematica Notebook file. *******************************************************************)