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.5058948 0.2630701 0.2310351
#> [2,] 0.1742433 0.6794891 0.1462677
#> [3,] 0.3134871 0.1129721 0.5735409