ContinuousTimeMarkov.CompetingPoisson
— MethodCompetingPoisson(rates; events)
The first arrival from competing Poisson point processes with the given rates
.
rand
returns a NamedTuple{(:duration,:event)}
, where duration
is the duration until the first event and event
is drawn from events
.
Varios properties are supported, see propertynames
.
Note
The distribution of duration
is Exponential(1/sum(rates))
, so this process can also be thought of as competing exponentials.
ContinuousTimeMarkov.TransitionRateMatrix
— MethodTransitionRateMatrix(Q)
Create a transition rate matrix from the argument. This makes a copy, checks that off-diagonal elements are nonnegative, and sets the diagonal so that rows sum to 0
, striving to preserve sparsity and structure.
ContinuousTimeMarkov.TransitionRateMatrix!
— MethodTransitionRateMatrix!(Q)
Create a TransitionRateMatrix
from a matrix Q
. Modifies the argument (to normalize the diagonal).
ContinuousTimeMarkov._off_diagonal_checked_row_sum!
— Method_off_diagonal_checked_row_sum!(d, A)
Accumulate the sum of off-diagonal elements into d
by row. Return d
.
Internal, not part of the API. Works with generalized indexing.
ContinuousTimeMarkov.checked_square_axis
— Methodchecked_square_axis(A)
Assert that both axes are the same, and return a single one.
Internal, not part of the API. Works with generalized indexing.
ContinuousTimeMarkov.normalize_diagonal!
— Methodnormalize_diagonal!(A)
Set the diagonal of the argument (which is modified) so that rows sum to 0
.
Internal, not part of the API. Works with generalized indexing.
ContinuousTimeMarkov.off_diagonal_checked_row_sum
— Methodoff_diagonal_checked_row_sum(A)
Check that off-diagonal elements are nonnegative, and return their sum by row.
Internal, not part of the API. Works with generalized indexing.
ContinuousTimeMarkov.stationary_distribution
— Methodstationary_distribution(m)
Return the stationary distribution of a transition rate matrix as a vector.