Forums  > Pricing & Modelling  > On the General Solution of Initial Value Problems of Ordinary Differential Equations Using the Method of Iterated Integrals.  
     
Page 2 of 2Goto to page: 1, [2] Prev
Display using:  

amin


Total Posts: 279
Joined: Aug 2005
 
Posted: 2017-02-24 13:00
Here I do the complete analysis as I promised yesterday.

Equation(1)

When we are given initial values t0 and y(t0), it is obvious we can easily solve for dy/dt(y(t0),t0).
Let us take a total derivative of Equation(1), it reads


Equation(2)

please notice that I missed a term yesterday when I wrote the equation (2). We make the following observation that time dependent partial derivatives in third and fourth term of equation(2) can be combined to give the expression below.

Equation(3)
Now we can write the third and fourth term in equation (2) to give us the
Equation(4)

using the above expression in equation 2, we get
Equation(5)

which can be solved to give us a second order ODE given below.
Equation(6)

which can easily be solved by the method of iterated integrals if we can integrate the expressions in corresponding integrals.

We notice that at any given time tn, equation (1) has to be satisfied as

which means that everywhere on the surface F, the following equation would have to be true as well
Equation(7)
which makes our second order ODE in equation (6) to be solved as
Equation(8)

amin


Total Posts: 279
Joined: Aug 2005
 
Posted: 2017-03-11 16:39
Here is cross-reference to another related thread in off-topic for applications of the research in this technical forum thread. https://defence.pk/pdf/threads/proposal-for-a-nanotechnology-open-knowledge-research-effort.482885/
I thought some friends would be interested.

amin


Total Posts: 279
Joined: Aug 2005
 
Posted: 2017-11-23 16:23

Solution of SDEs and ODEs using method of iterated integrals

Please look at post 563 for solution of ODEs and post 564 for solution of SDEs in the above thread. I wanted to make a new post here but had problems with latex so I am just referring to where I have already posted.

https://www.linkedin.com/pulse/higher-order-sde-monte-carlo-simulation-schemes-ahsan-amin/

pj


Total Posts: 3406
Joined: Jun 2004
 
Posted: 2017-11-24 13:58
Hi Amin,

You should use this link
instead.
W****tt is unpronounceable name here.

The older I grow, the more I distrust the familiar doctrine that age brings wisdom Henry L. Mencken

amin


Total Posts: 279
Joined: Aug 2005
 
Posted: 2017-12-05 16:40
In a new post there .https://goo.gl/ue7PfT Post:565, I have written the solution to stochastic integrals that are needed for monte carlo. Now I believe people have full recipe for higher order monte carlo

amin


Total Posts: 279
Joined: Aug 2005
 
Posted: 2017-12-09 11:19
Here is a matlab program that simulates higher order iterated integral monte carlo of lognormal diffusion with drift and compares it with traditional Euler method and also with exact analytic solution.

function [] = SVMonteCarloHigherOrderInfiniti( )
%SDE being discretized is
%dX(t)=mu0*X(t)*dt+simga0*X(t)*dz(t)
T_index=8; %No. of Simulation time steps
dt=.125/1.0; % Discretization spacing
TT=T_index*dt;%%Terminal Time
mu0=.40; %drift
sigma0=1.0;%volatility
X_0=1.0; %Starting Value of the lognormal diffusion
paths=1000000; %No Of Paths.
X(1:paths)=X_0; %Traditional Monte Carlo Variable
X1(1:paths)=X_0;%Iterated Integral Monte Carlo Variable
for nn=1:T_index %Loop over time.
    Random0=randn(size(X));
    %Stochastic integrals follow
    dZn=Random0*sqrt(dt);
    dZndt(1:paths)=dt.^1.5/sqrt(3)*Random0;
    dtdZn(1:paths)=dt.^1.5/sqrt(3)*Random0;
    dZndZn(1:paths)=dt/2.0.*(Random0.^2-1);
    dtdt=dt.^2.0/2.0;
   
   
    X=X+mu0.*X*dt+sigma0*X.*dZn; %Discretization of traditional Monte Carlo
    X1=X1+mu0.*X1*dt+sigma0*X1.*dZn ... %%Discretization of Iterated Integral
        +mu0.*mu0.*X1.*dtdt ...         %% Monte Carlo
        +mu0.*sigma0.*X1.*dZndt ...
        +sigma0.*mu0.*X1.*dtdZn ...
        +sigma0.*sigma0.*X1.*dZndZn;
   
end
%Following block is the analytic solution of lognormal SDE with drift.
n=0;
for n=1:2000
    n=n+1
    Z(n)=n*.005;
    Logf(n)=1.0/sqrt(2*pi)/Z(n)./(sigma0*sqrt(TT)).* ...
    exp(-.5*(log(Z(n))-log(X_0)-(mu0-.5*sigma0.^2)*TT).^2./(sigma0.^2*TT));
end
%The next block turns monte carlo diffusion into density.
MaxCutOff=50;
BinSize=.01;
[XDensity,IndexOutX,IndexMaxX] = MakeDensityFromSimulation_Infiniti(X,paths,BinSize,MaxCutOff );
[XDensity1,IndexOutX1,IndexMaxX1] = MakeDensityFromSimulation_Infiniti(X1,paths,BinSize,MaxCutOff );
   
plot(IndexOutX(1:IndexMaxX),XDensity(1:IndexMaxX),'r',IndexOutX1(1:IndexMaxX1),XDensity1(1:IndexMaxX1),'g', ...
 Z(1:2000),Logf(1:2000),'k')
%In the graph red line is traditional monte carlo with Euler method.
%green line is iterated integral monte carlo
%black line is analytic solution
str=input('look at overlaid Graph comparison of Monte carlo density of SDE using iterated integral(green line) with density of SDE generated from analytic method(black line)>');

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%5
Below is another function that is used for graphing the monte carlo diffusion and is called in the above program.

function [XDensity,IndexOut,IndexMax] = MakeDensityFromSimulation_Infiniti(X,Paths,BinSize,MaxCutOff )
%Processes monte carlo paths to return a series Xdensity as a function of IndexOut. IndexMax is the %maximum value of index.
%

Xmin=0;
Xmax=0;
for p=1:Paths
if(X(p)>MaxCutOff)
X(p)=MaxCutOff;
end
if(Xmin>real(X(p)))
Xmin=real(X(p));
end
if(XmaxXmax=real(X(p));
end
end

IndexMax=floor((Xmax-Xmin)/BinSize+.5)+1
XDensity(1:IndexMax)=0.0;
for p=1:Paths
index=real(floor(real(X(p)-Xmin)/BinSize+.5)+1);
if(real(index)<1)
index=1;
end
if(real(index)>IndexMax)
index=IndexMax;
end
XDensity(index)=XDensity(index)+1.0/Paths/BinSize;
end
IndexOut(1:IndexMax)=Xmin+(0:(IndexMax-1))*BinSize;
endAttached File: SVMonteCarloHigherOrderInfiniti.zip
Attached File: MakeDensityFromSimulation_Infiniti.zip
Previous Thread :: Next Thread 
Page 2 of 2Goto to page: 1, [2] Prev