Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
SIRC ParamEst Project
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Rivnyák Tímea
SIRC ParamEst Project
Commits
ed723738
Commit
ed723738
authored
4 years ago
by
Rivnyák Tímea
Browse files
Options
Downloads
Patches
Plain Diff
SIRC RLS with additive noise
parent
93f2c210
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
SIRC_noiseRLSQ.m
+92
-0
92 additions, 0 deletions
SIRC_noiseRLSQ.m
with
92 additions
and
0 deletions
SIRC_noiseRLSQ.m
0 → 100644
+
92
−
0
View file @
ed723738
clc
%% System initalization
% Population
N
=
1000
;
% Initial number of infected individuals
I0
=
10
;
% Initial number of recovered individuals
R0
=
0
;
% Initial number of carrier individuals
C0
=
0
;
% Everyone else is susceptible
S0
=
N
-
I0
-
R0
-
C0
;
% Initial parameteres
nu
=
14
;
mu
=
0.013
;
epsilon
=
1.2
;
beta
=
0.0002
;
gamma
=
0.05
;
Gamma
=
0.03
;
q
=
0.8
;
time
=
200
;
%t = linspace(0, time, time);
y0
=
[
S0
,
I0
,
R0
,
C0
];
[
t
,
y
]
=
ode45
(
@
(
t
,
y
)
deriv
(
y
,
nu
,
mu
,
epsilon
,
beta
,
gamma
,
Gamma
,
q
),
[
0
time
],
y0
);
%% Add noise
noise
=
wgn
(
size
(
t
,
1
),
4
,
0
,
42
);
y
=
y
+
noise
;
figure
(
1
)
plot
(
t
,
y
);
xlabel
(
'Time(days)'
);
ylabel
(
'Number of individuals'
);
legend
(
'S'
,
'I'
,
'R'
,
'C'
);
%% Recursive Least Square with additive noise
h
=
1.0
;
lambda0
=
0.95
;
% 0.95-0.99
alpha
=
0.5
;
N
=
length
(
y
);
% dSdt = nu - beta*I*S - epsilon*beta*C*S - mu*S;
y_S
=
(
y
(
2
:
end
,
1
)
-
y
(
1
:
end
-
1
,
1
))
/
h
;
phi_S
=
zeros
(
N
-
1
,
4
);
phi_S
(:,
1
)
=
ones
(
N
-
1
,
1
);
phi_S
(:,
2
)
=
y
(
1
:
end
-
1
,
2
)
.*
y
(
1
:
end
-
1
,
1
);
phi_S
(:,
3
)
=
y
(
1
:
end
-
1
,
4
)
.*
y
(
1
:
end
-
1
,
1
);
phi_S
(:,
4
)
=
y
(
1
:
end
-
1
,
1
);
[
theta_S
,
p_S
]
=
recursiveLSQ
(
phi_S
,
y_S
,
lambda0
,
alpha
)
figure
(
2
)
plot
(
theta_S
);
legend
(
'nu'
,
'-beta'
,
'-epsilon*beta'
,
'-mu'
)
% dIdt = beta*I*S + epsilon*beta*C*S - (gamma + mu)*I;
y_I
=
(
y
(
2
:
end
,
2
)
-
y
(
1
:
end
-
1
,
2
))
/
h
;
phi_I
=
zeros
(
N
-
1
,
3
);
phi_I
(:,
1
)
=
y
(
1
:
end
-
1
,
2
)
.*
y
(
1
:
end
-
1
,
1
);
phi_I
(:,
2
)
=
y
(
1
:
end
-
1
,
4
)
.*
y
(
1
:
end
-
1
,
1
);
phi_I
(:,
3
)
=
y
(
1
:
end
-
1
,
2
);
[
theta_I
,
p_I
]
=
recursiveLSQ
(
phi_I
,
y_I
,
lambda0
,
alpha
)
figure
(
3
)
plot
(
theta_I
);
legend
(
'beta'
,
'epsilon*beta'
,
'-(gamma+mu)'
)
% dRdt = gamma*(1-q)*I + Gamma*C - mu*R;
y_R
=
(
y
(
2
:
end
,
3
)
-
y
(
1
:
end
-
1
,
3
))
/
h
;
phi_R
=
zeros
(
N
-
1
,
3
);
phi_R
(:,
1
)
=
y
(
1
:
end
-
1
,
2
);
phi_R
(:,
2
)
=
y
(
1
:
end
-
1
,
4
);
phi_R
(:,
3
)
=
y
(
1
:
end
-
1
,
3
);
[
theta_R
,
p_R
]
=
recursiveLSQ
(
phi_R
,
y_R
,
lambda0
,
alpha
)
figure
(
4
)
plot
(
theta_R
);
legend
(
'gamma*(1-q)'
,
'Gamma'
,
'-mu'
)
% dCdt = gamma*q*I - (Gamma + mu)*C;
y_C
=
(
y
(
2
:
end
,
4
)
-
y
(
1
:
end
-
1
,
4
))
/
h
;
phi_C
=
zeros
(
N
-
1
,
2
);
phi_C
(:,
1
)
=
y
(
1
:
end
-
1
,
2
);
phi_C
(:,
2
)
=
y
(
1
:
end
-
1
,
4
);
[
theta_C
,
p_C
]
=
recursiveLSQ
(
phi_C
,
y_C
,
lambda0
,
alpha
)
figure
(
5
)
plot
(
theta_C
);
legend
(
'gamma*q'
,
'-(Gamma+mu)'
)
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment