Skip to content

File distributions.hpp

FileList > epiworld > math > distributions.hpp

Go to the source code of this file

Public Functions

Type Name
double dgenint (int g, double S, double p_c, double p_i, double p_r, double & p_0_approx, double & normalizing, int max_contacts=200, int max_days=200)
Compute the probability of the generation interval.
double dpois (int k, double lambda, int max_n=100, bool as_log=false)
Compute the Poisson probability.
double gen_int_mean (double S, double p_c, double p_i, double p_r, int max_days=200, int max_n=200)
Compute the mean of the generation interval.
double log_factorial (int n)
Compute the log of the factorial.

Public Functions Documentation

function dgenint

Compute the probability of the generation interval.

inline double dgenint (
    int g,
    double S,
    double p_c,
    double p_i,
    double p_r,
    double & p_0_approx,
    double & normalizing,
    int max_contacts=200,
    int max_days=200
) 

If p_0_approx is negative, it will be computed using the Poisson distribution. If normalizing is negative, it will be computed on the fly

Parameters:

  • g Generation interval
  • S Population size
  • p_c Probability of contact
  • p_i Probability of infection
  • p_r Probability of recovery
  • p_0_approx Approximation of the probability of not being infected
  • normalizing Normalizing constant
  • max_contacts Maximum number of contacts
  • max_days Maximum number of days

Returns:

The probability of the generation interval


function dpois

Compute the Poisson probability.

inline double dpois (
    int k,
    double lambda,
    int max_n=100,
    bool as_log=false
) 

Parameters:

  • k Number of events
  • lambda Rate
  • max_n Maximum number of events
  • as_log Return the log of the probability

Returns:

The Poisson probability


function gen_int_mean

Compute the mean of the generation interval.

inline double gen_int_mean (
    double S,
    double p_c,
    double p_i,
    double p_r,
    int max_days=200,
    int max_n=200
) 

Parameters:

  • S Population size.
  • p_c Probability of contact.
  • p_i Probability of infection.
  • p_r Probability of recovery.
  • max_days Maximum number of days.
  • max_n Maximum number of contacts.

Returns:

The mean of the generation interval


function log_factorial

Compute the log of the factorial.

inline double log_factorial (
    int n
) 

Parameters:

  • n Number

Returns:

The log of the factorial



The documentation for this class was generated from the following file epiworld-src/include/epiworld/math/distributions.hpp