selectState | R Documentation |
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.
selectState(uni, wt)
uni |
Uniform random number between 0 and 1. |
wt |
Cumulative probability vector of states. |
Returns an object containing the transition state(s) based on the given cumulative probability vector and random numbers.
rand = runif(1)
print(rand)
selectState(uni = rand, wt = c(0.25, .55, 0.85, 1))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.