Model Class Reference

CPP API: mio::iseir::Model Class Reference

#include <model.h>

Collaboration diagram for mio::iseir::Model:

Public Member Functions

TimeSeries< ScalarType > const & calculate_EIR ()
 Calculate the distribution of the population in E, I and, R based on the calculated values for S. More...
 
 Model (TimeSeries< ScalarType > &&init, ScalarType dt_init, int N_init, const Pa &Parameterset_init=Pa())
 Create an IDE SEIR model. More...
 
TimeSeries< ScalarType > const & simulate (int t_max)
 Simulate the evolution of infection numbers with the given IDE SEIR model. More...
 

Public Attributes

Pa parameters {}
 

Private Types

using Pa = ParametersBase
 
using Vec = Eigen::VectorX< ScalarType >
 

Private Member Functions

ScalarType central_difference_quotient (TimeSeries< ScalarType > const &ts_ide, InfectionState compartment, Eigen::Index idx) const
 Numerical differentiation of one compartment using a central difference quotient. More...
 
ScalarType generalized_beta_distribution (ScalarType tau, ScalarType p=3.0, ScalarType q=10.0) const
 Density of the generalized beta distribution used for the function f_{beta} of the IDE SEIR model. More...
 
ScalarType num_integration_inner_integral (Eigen::Index idx) const
 Numerical integration of the inner integral of the integro-differential equation for the group S using a trapezoidal sum. More...
 

Private Attributes

ScalarType m_dt {0}
 
Eigen::Index m_k {0}
 
Eigen::Index m_l {0}
 
int m_N {0}
 
TimeSeries< ScalarTypem_result
 
TimeSeries< ScalarTypem_result_SEIR
 

Member Typedef Documentation

◆ Pa

◆ Vec

using mio::iseir::Model::Vec = Eigen::VectorX<ScalarType>
private

Constructor & Destructor Documentation

◆ Model()

mio::iseir::Model::Model ( TimeSeries< ScalarType > &&  init,
ScalarType  dt_init,
int  N_init,
const Pa Parameterset_init = Pa() 
)
inline

Create an IDE SEIR model.

Parameters
[in,out]initTimeSeries with the initial values of the number of susceptibles at associated initial times. The time steps in this vector should be equidistant and equal to the time step used for the simulation. A certain history of time steps and values for susceptibles is needed. A warning is displayed if the condition is violated. Co be more precise, the first time point needs to be smaller than -(k-1)*TimeStep with k=ceil((InfectiousTime + LatencyTime)/TimeStep). The last time point in this vector should be a time 0.
[in]dt_initThe size of the time step used for numerical simulation.
[in]N_initThe population of the considered region.

Member Function Documentation

◆ calculate_EIR()

TimeSeries<ScalarType> const& mio::iseir::Model::calculate_EIR ( )
inline

Calculate the distribution of the population in E, I and, R based on the calculated values for S.

The values are calculated using the average latency and infection time, not using model equations. The simulated values of S are used for this purpose, so the simulate() function should be called beforehand.

Returns
The result of the calculation stored in an TimeSeries. The TimeSeries contains the simulation time and an associated Vector with values for S, E, I, and R.

◆ central_difference_quotient()

ScalarType mio::iseir::Model::central_difference_quotient ( TimeSeries< ScalarType > const &  ts_ide,
InfectionState  compartment,
Eigen::Index  idx 
) const
inlineprivate

Numerical differentiation of one compartment using a central difference quotient.

Parameters
[in]ts_ideTimeSeries with the time steps already calculated. Used as function values in numerical differentiation.
[in]idxTime index at which the numerical differentiation should be performed.
[in]compartmentCompartment for which the numerical differentiation is to be performed.
Returns
Numerically approximated derivative of the function belonging to the compartment at the point t[idx].

◆ generalized_beta_distribution()

ScalarType mio::iseir::Model::generalized_beta_distribution ( ScalarType  tau,
ScalarType  p = 3.0,
ScalarType  q = 10.0 
) const
inlineprivate

Density of the generalized beta distribution used for the function f_{beta} of the IDE SEIR model.

Parameters
[in]tauevaluation point of the generalized Beta distribution.
[in]pparameter p of the generalized Beta distribution.
[in]qparameter q of the generalized Beta distribution.
Returns
Evaluation of the generalized beta distribution at the given evaluation point.

◆ num_integration_inner_integral()

ScalarType mio::iseir::Model::num_integration_inner_integral ( Eigen::Index  idx) const
inlineprivate

Numerical integration of the inner integral of the integro-differential equation for the group S using a trapezoidal sum.

Parameters
[in]idxIndex of the point of time used in the inner integral.
Returns
Result of the numerical integration.

◆ simulate()

TimeSeries<ScalarType> const& mio::iseir::Model::simulate ( int  t_max)
inline

Simulate the evolution of infection numbers with the given IDE SEIR model.

The simulation is performed by solving the underlying model equation numerically. Here, an integro-differential equation is to be solved. The model parameters and the initial data are used.

Parameters
[in]t_maxLast simulation day. If the last point of time of the initial TimeSeries was 0, the simulation will be executed for t_max days.
Returns
The result of the simulation, stored in a TimeSeries with simulation time and associated number of susceptibles.

Member Data Documentation

◆ m_dt

ScalarType mio::iseir::Model::m_dt {0}
private

◆ m_k

Eigen::Index mio::iseir::Model::m_k {0}
private

◆ m_l

Eigen::Index mio::iseir::Model::m_l {0}
private

◆ m_N

int mio::iseir::Model::m_N {0}
private

◆ m_result

TimeSeries<ScalarType> mio::iseir::Model::m_result
private

◆ m_result_SEIR

TimeSeries<ScalarType> mio::iseir::Model::m_result_SEIR
private

◆ parameters

Pa mio::iseir::Model::parameters {}