This function converts a phase-type distribution into an igraph graph object.

phase_type_to_network(phase_type, t = NULL)

Arguments

phase_type

an object of class disc_phase_type or cont_phase_type

t

NULL or numeric. Sampling time for the continuous phase-type distribution.

Value

An igraph graph object of the phase-type distribution.

Examples

if (FALSE) {
cont_phase_type <- matrix(c(-3, 0, 1,
                            2, -3, 1,
                            1, 1, -2), ncol = 3)
Y <- PH(cont_phase_type)
Y_network <- phase_type_to_network(Y)
set.seed(28)
plot(Y_network, layout = layout_with_fr(Y_network,  weights = rep(1, length(E(Y_network)))))
}