13.2 Distribution Functions

Distributions can be referenced in two different ways: by name (if an optional name is defined in the distribution properties) or by index. The following functions employ the argument index to reference a distribution defined for the tree.

Function

Description

 

Dist(dist_index) During expected value calculations, this function returns the indexed distribution’s mean. During Monte Carlo simulations, this function returns the most current random sample for the distribution (unless the distribution is flagged to not sample).
Dist(dist_index; column) For a multi-variate distribution (i.e., a Dirichlet, Multivariate Normal or multi-column table distribution), returns the sample value (or mean, if not sampling) from the designated value column.
Dist(dist_index; 1) For a univariate distribution (i.e., not Dirichlet, Multivariate Normal or multi-column table), forces a sample from the distribution, even during non-sampling analyses. It is recommended that you use the DistForce function rather than this function (see below). For a table distribution, use the first value column for probabilities.
Dist(dist_index; 2) For a univariate distribution (i.e., not Dirichlet, Multivariate Normal or multi-column table), returns the stored sample value for a virtual branch. For a table distribution, use the second value column for probabilities.
DistForce(dist_index) DistForce("dist_name") DistForce(dist_index; column) DistForce("dist_name"; column) Unlike the Dist function, DistForce() always samples a value, even during non-sampling analyses such as roll back. DistForce(index; column) also works for multi-variate distributions. Note that DistForce(index; 1) must be called first in order to trigger a new set of sample values for all columns; then the stored sample values for the other columns can be referenced.

DistProb(dist_index; val)

DistProb("dist_name"; val)

For the specified distribution, provide a specific value for the distribution and return the approximate cumulative probability.

For example, if you ask for the cumulative probability for the distribution median, it will return 0.5.

Value --> Cumulative Prob

DistValue(dist_index; val)

DistValue("dist_name"; val)

For the specified distribution, provide the cumulative probability and return the value.

For example, if you ask for the value associated with cumulative probability 0.5, it will return the median value.

Cumulative Prob --> Value

DistSampleCond(dist_index; lower_bound; upper_bound)

DistSampleCond("dist_name"; lower_bound; upper_bound)

Draw a sample from the appropriate distribution that is bounded by the lower_bound and upper_bound values provided. The upper_bound argument is optional.

DistTransProb(dist_index; time_cycle_start ; time_cycle_length)

DistTransProb("dist_name"; time_cycle_start ; time_cycle_length)

Calculate transition probabilities from a time-to-event distribution.

For further details are available in the Markov Modeling Tools and Techniques Chapter.

DistTrim(dist_index; min; max)

DistTrim("dist_name"; min; max)

Same as the Dist() function, except it will resample (up to a maximum of 10 times) until a sample is returned that falls between the specified minimum and maximum values.

DistSurv(“dist_name”)

DistSurv(“dist_name”; _time)

DistSurv(dist_index)

DistSurv(dist_index; _time)

Used with time-to-event distributions, particularly in Partitioned Survival Analysis models. Returns the complement of the cumulative probability that an event has occurred over time or at any given time. If a distribution represents progression, then DistSurv returns the probability that the progression has not yet occurred.

DistSurv("DistributionName") = 1-DistProb("DistributionName";_time)

The first argument refers to the distribution by name within quotes (recommended) or by index without quotes.

The second argument allows you to specify the probability at a specific time.

DistSurv(“dist_name”; 5)

The second argument can also convert the time units for the appropriate units within a model. For example monthly distribution to annual model: DistSurv(“dist_name”;_time/12)

DistHazard(“dist_name”)

DistHazard(“dist_name”; _time)

DistHazard(dist_index)

DistHazard(dist_index; _time)

Used with time-to-event distributions, particularly in Partitioned Survival Analysis models. Returns the risk of an event occurring over time or at any given time. If a distribution represents progression, then DistHazard returns the risk of progression.

The first argument refers to the distribution by name within quotes (recommended) or by index without quotes.

The second argument allows you to specify the risk at a specific time.

DistHazard(“dist_name”; 5)

The second argument can also convert the time units for the appropriate units within a model. For example monthly distribution to annual model: DistHazard(“dist_name”;_time/12)

A note in regards to DistTrim: It will usually generate a value between the min and max arguments. However, it is possible for 10 consecutive samples to fall outside this range. This function can be used in conjunction with the Min and Max functions to guarantee a value within the range. The function you would use in place is: Min(maxValue; Max(minValue; DistTrim(distIndex; minValue; maxValue)))