Skip to contents

This function returns a random, squared matrix of dimension dim that fulfills the properties of a transition probability matrix.

Usage

sample_transition_probability_matrix(dim, state_persistent = TRUE)

Arguments

dim

[integer(1)]
The dimension.

state_persistent

[logical(1)]
Put more probability on the diagonal?

Value

A transition probability matrix.

Examples

sample_transition_probability_matrix(dim = 3)
#>           [,1]      [,2]      [,3]
#> [1,] 0.4588393 0.3305745 0.2105862
#> [2,] 0.1767017 0.5234784 0.2998199
#> [3,] 0.2050253 0.3337357 0.4612390