Rev Language Reference


fnBSPInterval - Expand a vector of values for Bayesian skyline method input

A Bayesian skyline approach, as suggested by Drummond et al. (2005) and Billenstein & Höhna (2024), requires as an input a vector of values. These values can be the same for several consecutive entries. For example, if the total number of intervals is 4, and we have the two values, 0.2 and 0.5, where the first value is used once and the second used three times, we could create a Bayesian skyline vector as `[0.2, 0.5, 0.5, 0.5]`. To construct such a vector, we use the function `fnBSPInterval`.

Usage

fnBSPInterval(RealPos[] x, Natural[] n)

Arguments

x : RealPos[] (pass by reference)
The values that we replicate.
n : Natural[] (pass by value)
How often we replicate each value.

Return Type

Details

The function `fnBSPInterval` takes in two arguments: `x`, the values; and `n`, the number of times each value is replicated. Currently, the function assumes that all values are positive real numbers, as `fnBSPInterval` is used for population sizes in coalescent methods.

Example

a <- [0.1, 0.2, 0.3]
b <- [2, 1, 4]
fnBSPInterval( a, b )

See Also