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
Reflect
Set up semimartingales including local times
Dynamics of distance between hinge and bisector
Set up reflection coupling using elementary geometry
Contact Information
Computation of hinge location
Acknowledgements
Stochastic dynamics of hinge location
References
Author Information
Wilfrid S. Kendall
Statistics, University of Warwick,
Coventry CV4 7 AL, UK .
Purpose
This is a Mathematica notebook that demonstrates a pretty fact about coupled pairs of Brownian motions reflecting off a half-plane, and coupled by reflection. The result is easy to prove directly once known: however it is indeed the case that it was discovered using Itovsn3 (in fact in its REDUCE implementation).
IMPORTANT
This notebook assumes nothing has been previously defined. Quit Mathematica and reload if this is not the case!
Load package
In[1]:=
Needs["FernandoDuarte`Itovsn3`"]
Set up semimartingales including local times
Now we set up Itovsn3 with time t as the basic semimartingale and add a two-dimensional Brownian motion:
In[2]:=
ItoReset
[t,dt]​​
BrownBasis
[{A,B},{A0,B0}]
Out[2]//TableForm=
Itovsn3 resetting ...
Itovsn3 initialized
with time semimartingale t
and time differential dt
Next step is to introduce the two local times, one for each of the two coupled two-dimensional reflecting Brownian motions.
In[4]:=
Introduce
[L,dL]​​
AddQuadVar
[
2
dL
,0];​​
AddQuadVar
[dLdA,0];​​
AddQuadVar
[dLdB,0];​​
AddDrift
[dL,dL];​​
AddFixed
[0,L,L0];​​
Introduce
[H,dH]​​
AddQuadVar
[
2
dH
,0];​​
AddQuadVar
[dHdA,0];​​
AddQuadVar
[dHdB,0];​​
AddQuadVar
[dHdL,0];​​
AddDrift
[dH,dH];​​
AddFixed
[0,H,H0];
Out[4]=
{dL,dB,dA,dt}
Out[10]=
{dH,dL,dB,dA,dt}
We now redefine the drifts for (A,B) to allow for reflection (more economical than introducing further semimartingales!). We assume the half-plane of reflection is the region where A is negative.
In[17]:=
AddDrift
[dA,dL]
Out[17]=
dL
dt
Notice that the output is mathematically formal nonsense! Note also that the local time dL has the property A*dL == 0, which we will need to use in simplifications at the end!
We inspect the status of the stochastic differential multiplication and drift tables:
In[18]:=
ItoStatus
[]
Out[18]=
Summary of current structure of stochastic differentials
Current second-order structure of semimartingale differentials:
dH
dL
dB
dA
dt
dH
0
0
0
0
0
dL
0
0
0
0
0
dB
0
0
dt
0
0
dA
0
0
0
dt
0
dt
0
0
0
0
0
Current first-order structure of semimartingale differentials:
dH
dL
dB
dA
dt
dH
dL
0
dL
dt
Current initial values:
H
L
B
A
t
H0
L0
B0
A0
0
Set up reflection coupling using elementary geometry
The next step involves some simple geometry. We construct a unit vector UU pointing from (A,B) to (X,Y), and a perpendicular unit vector VV.
In[19]:=
AA={A,B};XX={X,Y};​​UU=XX-AA;​​UU=
UU
UU.UU
​​VV={{0,-1},{1,0}}.UU​​0UU.VV
Out[21]=

-A+X
2
(-A+X)
+
2
(-B+Y)
,
-B+Y
2
(-A+X)
+
2
(-B+Y)

Out[22]=
-
-B+Y
2
(-A+X)
+
2
(-B+Y)
,
-A+X
2
(-A+X)
+
2
(-B+Y)

Out[23]=
True
We use the unit vector UU to build a vector of stochastic differentials reflected in the UU direction based on {dA-dL,dB}: notice we take out the local time term from the dA differential to make it into a standard Brownian differential!
In[24]:=
dAA={dA-dL,dB}​​dXX=(IdentityMatrix[2]-2Transpose[{UU}].{UU}).dAA
Out[24]=
{dA-dL,dB}
Out[25]=
-
2dB(-A+X)(-B+Y)
2
(-A+X)
+
2
(-B+Y)
+(dA-dL)1-
2
2
(-A+X)
2
(-A+X)
+
2
(-B+Y)
,-
2(dA-dL)(-A+X)(-B+Y)
2
(-A+X)
+
2
(-B+Y)
+dB1-
2
2
(-B+Y)
2
(-A+X)
+
2
(-B+Y)

We now introduce the reflection coupling, by using the geometry to construct the coupled process (X,Y). Note the local time term added in the dX sde.
In[26]:=
Itosde
[X,dXdXX.{1,0}+dH,X0]​​
Itosde
[Y,dYdXX.{0,1},Y0]
Again the local time term dH has the property X*dH == 0. We summarize the local time relationships:
In[28]:=
localtimes={AdL0,XdH0}
Out[28]=
{AdL0,dHX0}
Computation of hinge location
The next step is to compute the location of the hinge (in the terminology of Burdzy and Kendall, 1998), the vertical intercept Z of the perpendicular bisector between {A,B} and {X,Y}. We do this by solving the appropriate simultaneous linear equations:
In[29]:=
bisector=
AA+XX
2
;​​ZZ={0,Z};​​solution=First[Solve[rhoVV+bisectorZZ,{rho,Z}]];​​Z=Simplify[Z/.solution]
Out[32]=
2
A
+
2
B
-
2
X
-
2
Y
2B-2Y

Figure to illustrate coupling

In[33]:=
picture=GraphicsPointSize[0.05],Point[AA],Text["(A,B)",AA,{1,-1}],Point[XX],Text["(X,Y)",XX,{2,0}],Line[{AA,XX}],Point[bisector],Text["bisector",bisector,{0,1}],Point[ZZ],Text["(0,Z)",ZZ,{0,-1}],Dashing[{0.1}],Line[{bisector,ZZ}],Text"rho",
bisector+ZZ
2
,{0,-1},Thickness[0.01],Dashing[{0.02}],RGBColor[1.0,0.0,0.0],Line[{AA,AA+dAA/.dL0/.dA0.4/.dB0.0}],Line[{XX,XX+dXX/.dL0/.dA0.4/.dB0.0}]/.{A1,B-2,X2,Y2},{Axes{False,True},AxesOrigin{0,-2},AspectRatioGoldenRatio};
In[34]:=
Show[picture]
Out[34]=
Stochastic dynamics of hinge location
Finally we examine the characteristics of the semimartingale Z
So Z doesn't move at all!
Dynamics of distance between hinge and bisector
Just to finish off, we examine the distance rho between {0,Z} and the perpendicular bisector point. First we obtain the expression for rho from our previous solution of simultaneous linear equations:
Now we compute its stochastic differential sd and its drift sd1. It is immediately clear that the drift is zero when the local time terms vanish, as the coefficient of dt is zero:
So consider the coefficient of dL. Here we know A must be zero, as we interpret dL as the differential of the local time of A at zero:
Now consider the differential of dH. Similarly, here we know X must be zero, as we interpret dH as the differential of the local time of X at zero:
These last two calculations give us simpler forms for the drift of rho when either A or X is zero. We deduce the drift of rho is given in general by
Here is a check. We know either dH, dL are both zero (off the boundary!)
or X, dL are both zero (AA is on the axis X=0)
or dH, A are both zero (XX is on the axis X=0)
Now consider the second-order aspect of sd = ItoD[rho]. For some reason it is computationally burdensome to compute ItoExpand[sd^2] so we ease the task by noting that dA and dB generate the filtration. (Ignore the spelling warning!)
We deduce that rho behaves as a Brownian motion when XX and AA are away from the boundary: we have already computed the behaviour on the boundary!
So rho behaves as a standard Brownian motion with a singular drift imposed whenever one of the coupled Brownian motions hits the boundary.
As a further exercise, use Itovsn3 to compute the characteristics of the semimartingale given by the angle made by the bisector with the boundary.
Contact Information
Email: w.s.kendall@warwick.ac.uk
URL: http://www.warwick.ac.uk/go/WSK
Acknowledgements
The research reported here was supported by EPSRC grants GR/71677 (Stochastic calculus in AXIOM using modules of stochastic differentials) and GR/L56831 (Perfect simulation in stochastic geometry), and a joint EPSRC/BBSRC research grant (Multi-strain species modelling and control via differential algebra reductions). This Mathematica notebook was constructed on a visit to MSRI Berkeley CA during its 1997-1998 program Stochastic Analysis. Finally, it is a pleasure to express my gratitude to my friends Suzanne Scotchmer and Joseph Farrell for the generous hospitality they showed to me during my visit to MSRI.
References
This calculation was a significant step in the following paper:
It also contributed usefully to:

© 2025 Wolfram. All rights reserved.

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