View source: R/auxiliary_functions.R
form_Y | R Documentation |
Constructs the binary vector of state transitions given a vector x
.
form_Y(x)
x |
vector of length M containing realisations of a two-state (binary) discrete-time Markov chain. |
vector of state-transitions (changes).
X <- c(0, 1, 0, 1, 1, 0, 1)
Y <- form_Y(X)
sum(Y) # number of state-transitions (changes)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.