Skip to content

Module: TimeSample

Niema Moshiri edited this page Oct 27, 2022 · 24 revisions

The TimeSample module chooses times at which a given individual in the ContactNetwork was sampled (i.e., sequenced). See the source code to see what is defined by the abstract class.

List of Implementations

  • All individuals who are infected at the end of the transmission simulation are sampled (i.e., sequenced) once exactly at the end
  • Requirements:
  • Config Parameters:
    • None
  • Implements the TimeSample_File module such that the sample times are read from file
  • Requirements:
  • Config Parameters:
  • Each sampling time of a given individual is chosen from a Gamma distribution of the individual's infection time window
    • If the individual has multiple infection time windows (i.e., from recovery and reinfection), a single time window is chosen randomly with equal probability
  • Requirements:
  • Config Parameters:
    • ts_gamma_shape: The desired shape parameter of the Gamma distribution
    • ts_gamma_scale : The desired scale parameter of the Gamma distribution
  • All individuals are sampled (i.e., sequenced) once exactly at the moment they are first infected
  • Requirements:
  • Config Parameters:
    • None
  • Each sampling time of a given individual is chosen from a Truncated Exponential distribution of the individual's infection time window
    • If the individual has multiple infection time windows (i.e., from recovery and reinfection), a single time window is chosen randomly with equal probability
  • Requirements:
  • Config Parameters:
    • None
  • Each sampling time of a given individual is chosen from a Truncated Normal distribution of the individual's infection time window
    • If the individual has multiple infection time windows (i.e., from recovery and reinfection), a single time window is chosen randomly with equal probability
    • The Truncated Normal distribution is in the window [0,1], and the user can move the mode of the underlying Normal distribution via the ts_truncnorm_loc parameter, and the user can scale the underlying Normal distribution via the ts_truncnorm_scale parameter (larger scale = longer tails)
  • Requirements:
  • Config Parameters:
    • ts_truncnorm_loc: The desired mode of the underlying Normal distribution
      • Note that the window is enforced at [0,1], so centering the underlying Normal distribution in the center of the window will require setting ts_truncnorm_loc to 0.5; centering the underlying Normal distribution at the far right of the window will require setting ts_truncnorm_loc to 1; etc.
    • ts_truncnorm_scale: The desired scaling factor of the underlying Normal distribution
      • Larger values of ts_truncnorm_scale result in longer tails (equivalent of zooming out the distribution)
  • Each sampling time of a given individual is chosen from a Uniform distribution of the individual's infection time window(s)
  • Requirements:
    • None
  • Config Parameters:
    • None