Simulating Stochastic Differential equations

4 ビュー (過去 30 日間)
jacob Mitch
jacob Mitch 2019 年 11 月 14 日
編集済み: jacob Mitch 2019 年 11 月 14 日
I am just learning about Stochastic differential equations if I have a SDE of dX(t) = -μ*X(t)*dt + σ*W(t) X0=x0>0 where W(t) is the Wiener process and I am trying to simulate it using
X(n+1)=X(n)−μX(n)∆t+σ*sqrt(∆t)*ηn, where ∆t = T /N :and ηn ∼ N (0, 1) normal distribution
So far I am here but not sure how to proceed and if I am simulating correctly and how the initial condition X0=x0>0 comes into it
dt_large = T / N;
t = linspace ( 0, T, N + 1 );
x = zeros ( 1, N + 1 );
x(1) = x0;
for j = 1 : n
dw = sqrt ( dt_large ) * randn ( 1, r );
x(j+1) = x(j) - x(j)* mu*dt_large + sigma * sum ( dw(1:r) );
end

回答 (0 件)

カテゴリ

Help Center および File ExchangeStochastic Differential Equation (SDE) Models についてさらに検索

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by