Skip to main content

Notice: this Wiki will be going read only early in 2024 and edits will no longer be possible. Please see: https://gitlab.eclipse.org/eclipsefdn/helpdesk/-/wikis/Wiki-shutdown-plan for the plan.

Jump to: navigation, search

Difference between revisions of "Estimating Model Parameters from External Data"

(Mathematics)
(Mathematics)
Line 94: Line 94:
 
Using the method of least squares, we can fit all four equations to a line (y = mx + b) and get the slope (m) and intercept (b) from each equation. The slopes and interecepts in each equation corresponds to a parameter in the model equations.
 
Using the method of least squares, we can fit all four equations to a line (y = mx + b) and get the slope (m) and intercept (b) from each equation. The slopes and interecepts in each equation corresponds to a parameter in the model equations.
  
 
+
=== For Nonlinear Case ===
== Nonlinear SEIR Models and Parameter Estimation ==
+
  
 
= Implementation =
 
= Implementation =

Revision as of 14:54, 1 August 2008

Introduction

STEM provides a way for users to input data from CSV Files and Estimated model parameters in, for example, an SIR or SEIR model so that model will best approximate the input data.

Mathematics

SI Models and Parameter Estimation

There are two equations that the SI model can be defined by:

Equation6.jpg

where:

β is the infection rate

α is the recovery rate (back to being susceptible)

Dividing through the dI/dt equation by I gives the following equation:

Equation7.jpg

which can then be fit to a line y = βx - α, where x = S and y = dlnI/dt, using the method of least squares. This will give values for β and α and their standard deviations and variances.


SIR Models and Parameter Estimation

There are three equations that the SIR model is defined by:

Equation4.jpg

where:

β is the infection rate

α is the immunity loss rate

ε is the recovery rate

Adding the first two equations together gives us the following equation:

Equation5.jpg

which can be fit to a line z = αx - εy, where x = R and y = I, using the method of least squares. In this way, we can solve for α and ε and their respective standard deviations and variances.

Next we go on to fit the dS/dt equation to the line z = αx - βy, where x = IS and y = R, using the same method of least squares method. In this way we can solve for β and α and their standard deviations and variances.


SEIR Models and Parameter Estimation

There are four equations with four parameters that the SEIR model is defined by:

Equations.jpg

where:

β is the infection rate

α is the immunity loss rate

γ is the infectious recovery rate

ε is the incubation rate


Method One

When rearranged by simple algebra, the four equations above can be made into the following:

Equation8.jpg

We can fit this equation to the line z = αx - γy, where z = dS/dt + dE/dt + dI/dt and x = R and y = I

Using the method of least squares, we can find the values for α and γ and the variance and the standard deviation for each.

Then we go onto the equation dE/dt = βSI - εE and fit this to the equation z = βx - εy, where z = dE/dt and x = SI and y = E.

Using the same method as above, we can find the values for β and ε and the variance and the standard deviation for each.

Method Two

When rearranged by simple algebra, the four equations at the top turn into the following:

Equation2.jpg


All four of the above equations are in the form y = mx + b, where:

Equation3.jpg


Using the method of least squares, we can fit all four equations to a line (y = mx + b) and get the slope (m) and intercept (b) from each equation. The slopes and interecepts in each equation corresponds to a parameter in the model equations.

For Nonlinear Case

Implementation

Package

All of the analysis is in the package org.eclipse.ohf.stem.analysis and projects within

Classes

ModelParameters.java

This class holds all of the parameters that we want to estimate and their variances and standard deviations. Also holds the local population density, local population, and a reference population density of 100 for fixing the β parameter.

There is an empty constructor that initializes all values to zero, and there is a constructor for each method of SEIR and SIR.

To find the average of the parameters found from each location, the average() method averages using standard deviations to weight each parameter.

The same is done to find the standard deviation of the average of the parameters, calculateStdAvg().

The toString() method will return the values of all of the parameters and the standard deviations of each.


ParameterEstimator.java

This class is an abstract class from which the subclasses inherits from.

Constants are set in this class that decide what derivative method will be used. The arrays for S, E, I, R, and t are also made.


SEIRparameterEstimator.java

This class estimates the parameters for a SEIR model.

The estimate() method estimates parameters for a SEIR model using one of the mathematical methods and returns values for β, α, γ, and ε and their respective standard deviations and variances.


NonlinearSEIRParameterEstimator.java

This class estimates the parameters for a SEIR model when beta is a function rather than a constant.

The estimate() method estimates parameters for a SEIR model using the mathematical method from above and returns values for β, α, γ, ε, and λ and their respective standard deviations and variances.

SIRparameterEstimator.java

This class estimates the parameters for a SIR model.

The estimate() method estimates parameters for a SIR model using the method provided above and returns values for β, α, and ε and their standard deviations and variances.


SIparameterEstimator.java

This class estimates the parameters for a SI model.

The estimate() method estimates parameters for a SI model using the method provided above and returns values for β and α and their standard deviations and variances.


ScenarioParameterEstimator

Back to the top