mat_gen: Transition matrix generator

Description Usage Arguments Note Examples

View source: R/mat_gen.R

Description

Generate a transition matrix (square matrix whose rows sum 1), given its dimension and a probability of non-connection.

Usage

1
mat_gen(n, p)

Arguments

n

The dimension (nrow = ncol) of the matrix to be created

p

The probability that one generic element of the matrix will be set to 0.

Note

Entering a probability of non-connection overcomes the problem that, when generating a continuosly and uniformly distributed sequence, the probability to obtain 0 is 0.

Examples

1
mat_gen(4,0.2)

unimi-dse/5547f4ce documentation built on Feb. 17, 2020, 4:03 a.m.