Skip to contents

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

Usage

sample_tpm(dim)

Arguments

dim

The matrix dimension.

Value

A transition probability matrix.

Examples

fHMM:::sample_tpm(dim = 3)
#>           [,1]      [,2]       [,3]
#> [1,] 0.2112719 0.5214209 0.26730722
#> [2,] 0.1131107 0.8670315 0.01985775
#> [3,] 0.4738486 0.1693692 0.35678224