class BirthDeathChain

class deeptime.data.BirthDeathChain(q, p, sparse: bool = False)

Birth and death chain.

A general birth and death chain on a d-dimensional state space has the following transition matrix

\[p_{ij} = \begin{cases} q_i &\text{, if } j=i-1 \text{ and } i>0,\\ r_i &\text{, if } j=i,\\ p_i &\text{, if } j=i+1 \text{ and } i < d-1 \end{cases}\]
Parameters:
  • q (array_like) – Annihilation probabilities for transition from i to i-1.

  • p (array-like) – Creation probabilities for transition from i to i+1.

  • sparse (bool, optional, default=False) – Whether sparse matrices are used.

Attributes

msm

MarkovStateModel for this birth death chain

stationary_distribution

The stationary distribution of the birth-death chain.

transition_matrix

Transition matrix for birth and death chain with given creation and anhilation probabilities.

Methods

committor_backward(a, b)

Backward committor for birth-and-death-chain.

committor_forward(a, b)

Forward committor for birth-and-death-chain.

flux(a, b)

The flux network for the reaction from A=[0,...,a] => B=[b,...,M].

netflux(a, b)

The netflux network for the reaction from A=[0,...,a] => B=[b,...,M].

rate(a, b)

Yields the total transition rate between state sets A=[0,...,a] and B=[0,...,b].

totalflux(a, b)

The tiotal flux for the reaction A=[0,...,a] => B=[b,...,M].

committor_backward(a, b)

Backward committor for birth-and-death-chain.

The backward committor is the probability for a chain in state x chain to originate from state a instead of coming from state b \(w_x=P_x(t_a<t_b)\), \(t_i\) is the last exit time of the chain from state i, \(t_i = \inf ( t>0 \mid X_{-t} = i )\).

Parameters:
  • a (int) – State index

  • b (int) – State index

Returns:

w – Vector of committor probabilities.

Return type:

(M,) ndarray

Notes

The birth-death chain is time-reversible

\[P(t_a < t_b) = P(T_a < T_b) = 1-P(T_b

therefore we can express the backward comittor probabilities in terms of the forward committor probabilities \(w=1-u\).

committor_forward(a, b)

Forward committor for birth-and-death-chain.

The forward committor is the probability to hit state b before hitting state a starting in state x,

\[u_x = P_x(T_b

\(T_i\) is the first arrival time of the chain to state i,

\[T_i = \inf ( t>0 \mid X_t=i ).\]
Parameters:
  • a (int) – State index

  • b (int) – State index

Returns:

u – Vector of committor probabilities.

Return type:

(M,) ndarray

flux(a, b)

The flux network for the reaction from A=[0,…,a] => B=[b,…,M].

Parameters:
  • a (int) – State index

  • b (int) – State index

Returns:

flux – Matrix of flux values between pairs of states.

Return type:

(M, M) ndarray

netflux(a, b)

The netflux network for the reaction from A=[0,…,a] => B=[b,…,M].

Parameters:
  • a (int) – State index

  • b (int) – State index

Returns:

netflux – Matrix of flux values between pairs of states.

Return type:

(M, M) ndarray

rate(a, b)

Yields the total transition rate between state sets A=[0,…,a] and B=[0,…,b].

Parameters:
  • a (int) – State index.

  • b (int) – State index.

Returns:

kAB – Total transition rate.

Return type:

float

totalflux(a, b)

The tiotal flux for the reaction A=[0,…,a] => B=[b,…,M].

Parameters:
  • a (int) – State index

  • b (int) – State index

Returns:

F – The total flux between reactant and product

Return type:

float

property msm

MarkovStateModel for this birth death chain

Getter:

Yields the MSM.

Type:

deeptime.markov.msm.MarkovStateModel

property stationary_distribution

The stationary distribution of the birth-death chain.

property transition_matrix

Transition matrix for birth and death chain with given creation and anhilation probabilities.

Getter:

Yields the transition matrix.

Type:

(N,N) ndarray