Milstein method for Stochastic SIR model - Mathlab program - Graph shows that deterministic not stochastic
Show older comments
clf
A=12;
la=0.01;
d=0.1;
ep=0.01;
mu=0.1;
r=2;
al=1;
k=0.1;
si= 0.01;
randn('state',1)
T = 300; Delta = 2^(-10); delta = Delta^2;
L = T/Delta; K = Delta/delta;
S = zeros(1,L+1);
I = zeros(1,L+1);
R = zeros(1,L+1);
S(1) = 60;
I(1) = 20;
R(1) = 20;
for n = 1:L
Winc1 = 0;
for k = 1:K
Winc1 = sqrt(delta)*randn;
end
S(n+1) = S(n) + (A-d*S(n)-((la*S(n)*I(n))/(1+k*I(n))))*Delta- ...
((si*S(n)*I(n))/(1+k*I(n)))*Winc1*sqrt(Delta)+...
0.5*si^2*((S(n)*I(n))/(1+k*I(n)))*Delta*(Winc1^2 - 1);
I(n+1) = I(n)+ Delta*(((la*S(n)*I(n))/(1+k*I(n)))-(d+ep+mu)*I(n)-
(r*I(n))/(1+al*I(n)))+...
((si*S(n)*I(n))/(1+k*I(n)))*Winc1*sqrt(Delta)+...
0.5*si^2*((S(n)*I(n))/(1+k*I(n)))*Delta*(Winc1^2 - 1);
R(n+1) = R(n) + (mu*I(n)+(r*I(n)/(1+I(n)*al))-d*R(n))*Delta;
end
subplot(231)
plot([0:Delta:T],S,'r-'), hold on
subplot(232)
plot([0:Delta:T],I,'g-')
subplot(233)
plot([0:Delta:T],R,'b-')
What can i do to get graph interms of stochastic increments. The given mathlab program graph does not include stochastic increments. May i know what term is missing in the above program. In out Stochastic SIR model:
S'(t) = (A-d*S(t)-((la*S(t)*I(t))/(1+k*I(t))))* dt -
((si*S(t)*I(t))/(1+k*I(t)))*dW(t);
I'(t) = (((la*S(t)*I(t))/(1+k*I(t)))-(d+ep+mu)*I(t)- (r*I(t))/(1+al*I(t)))*dt+...
((si*S(t)*I(t))/(1+k*I(t)))*dW(t);
R'(t) = (mu*I(t)+(r*I(t)/(1+I(t)*al))-d*R(t))*dt;
kindly help me.
I thank you.
3 Comments
Rajasekar S P
on 1 Jan 2018
Rajasekar S P
on 2 Jan 2018
Walter Roberson
on 2 Jan 2018
I suspect that not many of us are familiar with this topic.
Answers (1)
Tawfiqullah Ayoubi
on 1 May 2020
Edited: Tawfiqullah Ayoubi
on 1 May 2020
0 votes
I need Matlab code for Stochastic differential equations (SDDEs) via Euler-Maruyama numerical method, Milstein Scheme or Stochastics Runge-Kutta.
Note: Any method does not matter.
Example Logistc model or other models
where a,b sigma are real number, T is terminianl time, r is time delay h(t) is initial function.
Thanks in Addvance
Ayoubi
t.ayoubi1985@gmail.com
1 Comment
Walter Roberson
on 1 May 2020
The volunteers do not appear to be familiar with SDDEs.
The SDDEs methods available from Mathworks appear to be listed at https://www.mathworks.com/help/finance/sde-objects.html#brg0w0_
Categories
Find more on Stochastic Differential Equation (SDE) Models in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!