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.7784312 0.2194651 0.002103714
#> [2,] 0.3269005 0.4177187 0.255380796
#> [3,] 0.3213141 0.2850573 0.393628640