SIR final size that we can use to demonstrate the fate of S
Version 1.0.1 (2.75 KB) by
Ayesha Sohail
This code utilises optimisation twice, for parametric approximation and for disease fate by optimising S_{\infty}. I hope it will help!
STAGE 1
We use optimization techniques to fit the parameters α and β by
minimizing the error function:
min
α,β
nX
i=1
(yactual,i − ypredicted,i (α, β))2
▶ Various optimization algorithms can be used, such as gradient
descent or least squares.
▶ MATLAB functions like fminsearch or lsqcurvefit are
commonly used.
STAGE 2
We present graphical results from the SIR model with fitted
parameters:
▶ Infected Data and Model Predictions:
▶ The plot shows actual infection data alongside predictions
generated by the SIR model.
▶ The model was used to estimate susceptible populations S(t)
based on given infected data.
▶ Susceptible Population (S(t)):
▶ The plot of S(t) was derived from the model, given the
constraints and conditions applied.
▶ The green star represents the optimized final size S∞, obtained
through constrained optimization.
▶ Note that S∞ is shown within the context of the model’s
predictions and the given infected data.
Cite As
Ayesha Sohail (2025). SIR final size that we can use to demonstrate the fate of S (https://uk.mathworks.com/matlabcentral/fileexchange/172665-sir-final-size-that-we-can-use-to-demonstrate-the-fate-of-s), MATLAB Central File Exchange. Retrieved .
MATLAB Release Compatibility
Created with
R2024b
Compatible with any release
Platform Compatibility
Windows macOS LinuxTags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!Discover Live Editor
Create scripts with code, output, and formatted text in a single executable document.
