Package 'SEIR'

Title: Susceptible, Exposed, Infectious, Removed Model
Description: This is a simple model for the spread of a virus. It is the solution to a system of differential equations with plot methods to visualize the solution.
Authors: Pierre Chausse <[email protected]>
Maintainer: Pierre Chausse <[email protected]>
License: GPL (>= 2)
Version: 0.1-0
Built: 2026-09-25 18:58:37 UTC
Source: https://codeberg.org/pchausse/SEIR

Help Index


The SEIR model plot method

Description

It is a plot method for seir objects.

Usage

## S3 method for class 'seir'
plot(x, which=c("acase","tcase", "S", "E", "I", "R",
                    "both","rzero"), add=FALSE, bothAdd=list(), ...)

Arguments

x

object of class seir.

which

A choice of lines to plot.

add

Should we add the lines to an existing plot?

bothAdd

A list if argument to pass to the active case plot when add is set to TRUE

...

Other arguments to pass to the plot method.


The SEIR model print method

Description

It is the print method for seir objects.

Usage

## S3 method for class 'seir'
print(x, digits=2, ...)

Arguments

x

Object of class seir

digits

Number of digits to print

...

Arguments to pass to other methods


The SEIR model for virus spread

Description

The function that solves the SEIR system of differential equations.

Usage

SEIR(t, y, y0, c=0, sigma=1/5.2, gamma=1/18,
     r0=matrix(c(0,20,70,84,90,3,2.6,1.9,1,.5),ncol=2),
     type=c("Lin", "Const"))    

solveSEIR(h=1e-2, T=180, c=0, y0=c(11e6, 40, 800, 0),
          sigma=1/5.2, gamma=1/18,
          r0=matrix(c(0,20,70,84,90,3,2.6,1.9,1,.5),ncol=2),
          type=c("Lin", "Const"))

Arguments

t

Time value to evaluate the derivatives.

y

The vector is variable of interest: S, E, I and R.

y0

Initial Values

sigma

Parameter.

gamma

Parameter.

c

Mutation Parameter

h

Step size for the RK4 method

T

Final t

r0

Matrix of breaking points for R-Zero. The first column is the time of the breaking points, and the second is the values of the R-zero.

type

Types of R-Zero function. The default is a linear interpolation and the second is a piecewise constant function.

Value

It returns an object of class "seir"

References

Wang, H., Wang, Z., Dong, Y. et al (2020), Phase-adjusted estimation of the number of Coronavirus Disease 2019 cases in Wuhan, China. Cell Discov, 6, 10.