Class DelayDistribution

java.lang.Object
io.github.ai4ci.util.DelayDistribution
All Implemented Interfaces:
Serializable
Direct Known Subclasses:
ImmutableDelayDistribution

@Immutable public abstract class DelayDistribution extends Object implements Serializable
The delay distribution is a probability distribution in time conditional on an event happening. It is useful to generate a per day conditional hazard. Relationships are discrete versions of https://grodri.github.io/glms/notes/c7s1
See Also:
  • Constructor Details

    • DelayDistribution

      public DelayDistribution()
  • Method Details

    • getProfile

      public abstract double[] getProfile()
    • total

      @Derived public double total()
    • getPAffected

      @Default public double getPAffected()
      The probability of being affected at time infinity (1-survival_Inf)
    • density

      @Derived public double[] density()
      the improper probability density - which will sum to pAffected
    • condDensity

      @Derived public double[] condDensity()
      the conditional probability density - which will sum to 1
    • survival

      @Derived public double[] survival()
      the unconditional survival function
    • hazard

      @Derived public double[] hazard()
      the unconditional hazard function. If the affected total (i.e. the hazard at time=infinity) is known then what is the hazard on each day and this is the density on that day divided by the number that survived to that day.
    • profile

      public double profile(int x)
    • density

      public double density(int x)
    • condDensity

      public double condDensity(int x)
    • cumulative

      public double cumulative(int x)
    • hazard

      public double hazard(int x)
    • expected

      public double expected()
    • expected

      public double expected(double sampleSize)
    • conditionedOn

      public DelayDistribution conditionedOn(double pAffected)
    • size

      public long size()
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • affected

      public double affected(int intValue)
      What proportion of individuals expected to have been affected by day X. (i.e. 1-prob(survived to day X))
    • convolveProfile

      public double[] convolveProfile(double[] input)
    • convolveDensity

      public double[] convolveDensity(double[] input)
    • unnormalised

      public static ImmutableDelayDistribution unnormalised(double... profile)
    • empty

      public static DelayDistribution empty()
    • discretisedGamma

      public static DelayDistribution discretisedGamma(double mean, double sd)
    • discretisedGamma

      public static DelayDistribution discretisedGamma(double mean, double sd, int length)
    • totalHazard

      public double totalHazard(double pEvent)
      The probability that a repeated event that occurs with pEvent on each day happens at some point over the delay distribution, given that the conditional probabilities on each day add to one, the result will be less than or equal to pEvent. This is a way of calculating the total affected when the probability of the event is on a per day basis.
      Parameters:
      pEvent -
      Returns:
    • getQuantile

      public int getQuantile(double d)