selectState {wxgenR} | R Documentation |
Select transition state
Description
Function selects and returns the transition state given a uniform random number between 0 and 1 and the cumulative probability vector of the state sequence.
Usage
selectState(uni, wt)
Arguments
uni |
Uniform random number between 0 and 1. |
wt |
Cumulative probability vector of states. |
Value
Returns an object containing the transition state(s) based on the given cumulative probability vector and random numbers.
Examples
rand = runif(1)
print(rand)
selectState(uni = rand, wt = c(0.25, .55, 0.85, 1))
[Package wxgenR version 1.4.1 Index]