Wolfram Language Paclet Repository

Community-contributed installable additions to the Wolfram Language

Primary Navigation

    • Cloud & Deployment
    • Core Language & Structure
    • Data Manipulation & Analysis
    • Engineering Data & Computation
    • External Interfaces & Connections
    • Financial Data & Computation
    • Geographic Data & Computation
    • Geometry
    • Graphs & Networks
    • Higher Mathematical Computation
    • Images
    • Knowledge Representation & Natural Language
    • Machine Learning
    • Notebook Documents & Presentation
    • Scientific and Medical Data & Computation
    • Social, Cultural & Linguistic Data
    • Strings & Text
    • Symbolic & Numeric Computation
    • System Operation & Setup
    • Time-Related Computation
    • User Interface Construction
    • Visualization & Graphics
    • Random Paclet
    • Alphabetical List
  • Using Paclets
    • Get Started
    • Download Definition Notebook
  • Learn More about Wolfram Language

Itovsn3

Guides

  • Main

Tech Notes

  • Bessel
  • BlackScholes
  • ItoArea
  • MardiaDryden
  • Reflect
  • Stochastic Integration

Symbols

  • AddDrift
  • AddFixed
  • AddQuadVar
  • Brktbydt
  • BrownBasis
  • BrownSingle
  • BSDQ
  • Drftbydt
  • Drift
  • Fixed
  • GetItoProc
  • InitialValue
  • Introduce
  • ItoD
  • ItoExpand
  • ItoInit
  • ItoIntegral
  • ItoReset
  • Itosde
  • ItoStatus
  • RandomQ
Stochastic Integration
The function
ItoIntegral
can be extended with integration rules that allow explicit calculation of many Ito integrals.
ItoD
[f]
Ito stochastic differential of semimartingale expression
f
ItoIntegral
[sd]
Ito integral of stochastic differential expression
sd
ItoReset
[]
reset all structures
BrownBasis
[names,init]
create independent Brownian motions in list
names
with initial values in list
init
Itosde
[X,dX==sd,
X
0
]
introduce semimartingale
X
with initial value
X
0
through the stochastic differential equation
dX==sd
Drift
[sd]
computes the drift differential of expression
sd
InitialValue
[
t
0
,f]
computes the value of the expression
f
at time
t
0
Functions of Itovsn3 paclet that are useful for stochastic integration.
Load package
In[1]:=
Needs["FernandoDuarte`Itovsn3`"]
Set up two Brownian motions and a semimartingale
Z
that depends on them:
In[2]:=
ItoReset
[t,dt];​​
BrownBasis
[{X,Y},{1,0}];​​
Itosde
[Z,dZYdX-XdY,Z0];
ItoIntegral
represents the right-inverse of the stochastic differential
ItoD
:
In[5]:=
ItoD

ItoIntegral
[dXY]
Out[5]=
dXY
Even without further properties,
ItoIntegral
can compute some simple stochastic integrals:
In[6]:=
ItoIntegral
[dX]
Out[6]=
-1+X
Drift
behaves well with
ItoIntegral
:
In[7]:=
ItoD

ItoIntegral

ItoD
[
2
X
]
2
X

Out[7]=
5dt
2
X
+2dX
3
X
+dtItoIntegral[dt+2dXX]+2dXXItoIntegral[dt+2dXX]
In[8]:=
Drift

ItoD

ItoIntegral

ItoD
[
2
X
]
2
X

Out[8]=
dt(5
2
X
+ItoIntegral[dt+2dXX])
ItoIntegral
can be programmed with further Ito integral properties. The identity:
d(
n+1
X
)=(n+1)
n
X
dX+
n+1
2
d(
n
X
)dX
leads to:
(n+1)∫
n
X
dX=
n+1
X
-Subscript[
n+1
X
,0]-
n+1
2
∫d(
n
X
)dX
We implement this identity as follows:
In[9]:=
ItoIntegral
X_dX_/;
ItoD
[X]dX:=
1
2

2
X
-
InitialValue
[0,
2
X
]-
ItoIntegral

ItoExpand
[
2
dX
]
In[10]:=
ItoIntegral

n_Integer
X_
dX_/;
ItoD
[X]dX:=
1
n+1
n+1
X
-
InitialValue
[0,
n+1
X
]-
1
2
(n(n+1))
ItoIntegral
Expand
n-1
X
ItoExpand
[
2
dX
]
We can now solve some Ito integrals:
In[11]:=
ItoIntegral
[XdX]
Out[11]=
1
2
(-1-t+
2
X
)
In[12]:=
ItoD

ItoIntegral
[XdX]
Out[12]=
dXX
In[13]:=
ItoIntegral
[
3
X
dX]
Out[13]=
1
4
(-1+
4
X
-6ItoIntegral[dt
2
X
])
In[14]:=
ItoD

ItoIntegral
[
3
X
dX]
Out[14]=
dX
3
X
We now call on the well-known relationship between Ito differentials and Hermite polynomials:
In[15]:=
H[n_,x_,t_]:=HermiteHn,
x
2t

n

2t

First note that
ItoD
sends
H[n+1,X,t]
to
2(n+1)H[n,X,t]
:
In[16]:=
Simplify
ItoD
[H[n+1,X,t]]
2(n+1)H[n,X,t]
/.n{0,1,2,3,4,5,6}
Out[16]=
{dX,dX,dX,dX,dX,dX,dX}
We need some linearity for the Ito integrals for the next part:
In[17]:=
ItoIntegral
[0]:=0;​​
ItoIntegral
[sda_+sdb_]:=
ItoIntegral
[sda]+
ItoIntegral
[sdb];​​
ItoIntegral
[sda_-sdb_]:=
ItoIntegral
[sda]-
ItoIntegral
[sdb];​​
ItoIntegral
[-sdb_]:=-
ItoIntegral
[sdb];​​
ItoIntegral
[n_Integersda_]:=n
ItoIntegral
[sda];​​
ItoIntegral

sda_
n_Integer
:=
ItoIntegral
[sda]
n
;
For
n=0
and
n=1
, we have:
In[23]:=
0Simplify
ItoIntegral
[Expand[H[0,X,t]dX]]-
H[1,X,t]-
InitialValue
[0,Simplify[H[1,X,t]]]
2

Out[23]=
True
In[24]:=
0Simplify
ItoIntegral
[Expand[H[1,X,t]dX]]-
H[2,X,t]-
InitialValue
[0,Simplify[H[2,X,t]]]
4

Out[24]=
True
For
n=2
, our rules are not enough to compute the stochastic integral to
0
:
In[25]:=
0Simplify
ItoIntegral
[Expand[H[2,X,t]dX]]-
H[3,X,t]-
InitialValue
[0,Simplify[H[3,X,t]]]
6

Out[25]=
04tX-4ItoIntegral[dXt]-4ItoIntegral[dtX]
We can compute these integrals explicitly adding some new rules. The expression:
In[26]:=
SetAttributes[p,Constant];​​SetAttributes[q,Constant];​​
ItoD
[
p
t
q
X
]
Out[28]=
-
1
2
dtq
p
t
-2+q
X
+
1
2
dt
2
q
p
t
-2+q
X
+dXq
p
t
-1+q
X
+dtp
-1+p
t
q
X
leads to:
d(
m
t
n+1
X
)==m
m-1
t
n+1
X
dt+(n+1)
m
t
n
X
dX+
1
2
(n+1)n
m
t
n-1
X
dt
from which we derive the following rules:
In[29]:=
ItoIntegral
[tdX]:=tX-
InitialValue
[0,tX]-
ItoIntegral
ExpandX
ItoD
[t]​​
ItoIntegral
[tXdX]:=
1
2
t
2
X
-
InitialValue
[0,t
2
X
]-
ItoIntegral
[
2
X
dt]-
ItoIntegral
[tdt]​​
ItoIntegral
[
m_Integer
t
dX]:=
m
t
X-
InitialValue
[0,
m
t
X]-
ItoIntegral
ExpandX
ItoD
[
m
t
]​​
ItoIntegral
[
m_Integer
t
XdX]:=
1
2

m
t
2
X
-
InitialValue
[0,
m
t
2
X
]-
ItoIntegral
[m
m-1
t
2
X
dt]-
ItoIntegral
[
m
t
dt]​​
ItoIntegral
[t
n_Integer
X
dX]:=
1
n+1
t
n+1
X
-
InitialValue
[0,t
n+1
X
]-
ItoIntegral
[
n+1
X
dt]-
ItoIntegral

1
2
(n+1)nt
n-1
X
dt​​
ItoIntegral
[
m_Integer
t
n_Integer
X
dX]:=
1
n+1
m
t
n+1
X
-
InitialValue
[0,
m
t
n+1
X
]-
ItoIntegral
[m
m-1
t
n+1
X
dt]-
ItoIntegral

1
2
(n+1)n
m
t
n-1
X
dt
Now we can compute the integral with
n=2
:
In[35]:=
0Simplify
ItoIntegral
[Expand[H[2,X,t]dX]]-
H[3,X,t]-
InitialValue
[0,Simplify[H[3,X,t]]]
6

Out[35]=
True
And, indeed, for any other
n
:
In[36]:=
Table0Simplify
ItoIntegral
[Expand[H[n,X,t]dX]]-
H[n+1,X,t]-
InitialValue
[0,Simplify[H[n+1,X,t]]]
2(n+1)
,{n,3,10}
Out[36]=
{True,True,True,True,True,True,True,True}
Finally, a couple of random checks:
In[37]:=
ItoIntegral
[
5
t
dX]

© 2025 Wolfram. All rights reserved.

  • Legal & Privacy Policy
  • Contact Us
  • WolframAlpha.com
  • WolframCloud.com