Who is this talk primarily for?
What are we going to do?
What sort of things to look out for?
What are your suggestions/comments/questions?
Those of you who:
use Moodle as a virtual learning environment or have a possibility to use it
use STACK (question type for Moodle) or would like to use STACK
would like to implement a longish exercise (with several answer boxes) in STACK; an example of a longish exercise is an application of Itô’s Lemma
Things that we will need:
Moodle with STACK plug-in (you can use EMS2022 Moodle to practice)
MAXIMA installation (MAXIMA is the computer algebra system behind STACK)
Things that will be helpful but not necessary:
We will go over a longish exercise (Itô’s Lemma) in a general case
We will go over a longish exercise (Itô’s Lemma) in a specific case, for which:
We will label the answer boxes from 1 to 14 (on a piece of paper)
Code it in MAXIMA
‘Code’ it as a STACK question on Moodle
Randomize its sub-parts/elements (MAXIMA code)
Refine and finish
Itô‘s Lemma: Given an Itô process \(\{X_t\}\), \(dX_t=a(X_t,t) dt+ b(X_t,t) dZ_t\), where \(\{Z_t\}\) is the Wiener Process, \(a(\cdot,\cdot)\) and \(b(\cdot,\cdot)\) are functions of two variables satisfying some regularity conditions, the ’new’ Itô process \(\{G_t\}\), \(G_t=G(X_t,t)\), satisfies the following stochastic differential equation
\[ dG_t=\left( \frac{\partial G}{\partial X_t}a(X_t,t) + \frac{\partial G}{\partial t}+ \frac{1}{2} \frac{\partial^2 G}{\partial X_t^2} [b(X_t,t)]^2 \right) dt+ \frac{\partial G}{\partial X_t} b(X_t,t) dZ_t \]
To apply this lemma we need to know how to:
Identify functions \(a(\cdot,\cdot)\) and \(b(\cdot,\cdot)\) in a given stochastic differential equation.
Find partial derivatives \(\frac{\partial G}{\partial X_t}\), \(\frac{\partial^2 G}{\partial X_t^2}\), \(\frac{\partial G}{\partial t}\)
Plug-in the elements from parts 1. and 2. into the formula from the lemma and then simplify the expression.
Let \(\{S_t\}\) be an Itô process satisfying the following stochastic differential equation
\[ dS_t=\mu S_tdt+\sigma S_tdZt \] where \(\mu\) and \(\sigma\) are constants. (\(\{S_t\}\) is called Geometric Brownian Motion.)
Apply Itô’s Lemma to derive a stochastic differential equation for the process \(\{G_t\}\), where
\[ G_t=G(S_t,t)=S_t^2 \]
Let \(\{{@var@}\}\) be an Itô process satisfying the following stochastic differential equation
\[d{@var@}={@driftpar@}{@var@}dt+{@diffusionpar@}{@var@}dZ_t,\]
where \({@driftpar@}\) and \({@diffusionpar@}\) are constants.
Apply Itô's Lemma to derive a stochastic differential equation for the process \(\{G_t\}\), where
\[
G_t=G({@var@},t)={@GG@}
\]
Follow the steps below.
We have
\(a({@var@},t)=\) [[input:ans1]] [[validation:ans1]] [[feedback:prt1]]
\(b({@var@},t)=\) [[input:ans2]] [[validation:ans2]] [[feedback:prt2]]
\(\frac{\partial G}{\partial {@var@}}=\) [[input:ans3]] [[validation:ans3]] [[feedback:prt3]]
\(\frac{\partial^2 G}{\partial {@var@}^2}=\) [[input:ans4]] [[validation:ans4]] [[feedback:prt4]]
\(\frac{\partial G}{\partial t}=\) [[input:ans5]] [[validation:ans5]] [[feedback:prt5]]
Hence
\(dG_t=(\) [[input:ans6]][[validation:ans6]][[feedback:prt6]] \(\cdot \) [[input:ans7]][[validation:ans7]][[feedback:prt7]] \(+\) [[input:ans8]][[validation:ans8]][[feedback:prt8]]\(+\frac{1}{2}\cdot\) [[input:ans9]][[validation:ans9]][[feedback:prt9]] \(\cdot [\) [[input:ans10]][[validation:ans10]][[feedback:prt10]] \(]^2\) \(\left . \right)dt\)
\( +\) [[input:ans11]][[validation:ans11]][[feedback:prt11]] \(\cdot \) [[input:ans12]][[validation:ans12]][[feedback:prt12]]\(dZ_t \)
And finally, making the substitution \(G_t={@GG@}\), we obtain
\(dG_t = \) [[input:ans13]][[validation:ans13]][[feedback:prt13]] \(dt + \) [[input:ans14]][[validation:ans14]][[feedback:prt14]] \(dZ_t\)
var: rand([S_t,U_t,V_t,Y_t]);/*BEFORE var: S_t*/;
driftdiffusionpar: rand([[mu,sigma],[m,s],[a,b],[e,f]]); /*BEFORE driftdiffusionpar: [mu,sigma];*/
driftpar: driftdiffusionpar[1];
diffusionpar: driftdiffusionpar[2];
aa: driftpar*var;
bb: diffusionpar*var;
pp: rand([-5,-4,-3,-2,2,3,4,5]);/*BEFORE pp: 2;*/
GG: var^pp;
GX1: diff(GG,var,1);
GX2: diff(GG,var,2);
Gt: diff(GG,t,1);
driftfinal: factor(subst(GG=G_t,GX1*aa+Gt+GX2*bb^2/2));
diffusionfinal: factor(subst(GG=G_t,GX1*bb));
In STACK’s \(\fbox{Input}\) for parts 6-12 possibly disable \(\fbox{Show the validation}\)
The usual things…
For a Moodle quiz, one can add ‘warm-up’ questions for practicing with:
Identify functions \(a(\cdot,\cdot)\) and \(b(\cdot,\cdot)\) in a given stochastic differential
equation.
Find partial derivatives \(\frac{\partial G}{\partial X_t}\), \(\frac{\partial^2 G}{\partial X_t^2}\), \(\frac{\partial G}{\partial t}\)
Please, visit the corresponding paragraph on EAMS2022 Moodle page under ‘Software demos’.