int_vanloan module

itrails.int_vanloan.instant_mat(tup_0, tup_1, trans_mat)[source]

This function returns the same transition rate matrix as supplied, except only the entries from tup_0 to tup_1 are kept, and all of the others are zeroed. This function is useful to calculate the instantaneous transition rate matrix for the van Loan method, as well as for the integrals when the time interval goes to infinity.

Parameters:
  • tup_0 (list of integers) – These are the indices of the transition rate matrix corresponding to the starting states.

  • tup_1 (list of integers) – These are the indices of the transition rate matrix corresponding to the end states.

  • trans_mat (numeric numpy matrix) – Transition rate matrix.

itrails.int_vanloan.vanloan_1(trans_mat, tup, omega_start, omega_end, time)[source]

This function performs the van Loan (1978) method for finding the integral of a series of 2 multiplying matrix exponentials.

Parameters:
  • trans_mat (numeric numpy matrix) – Transition rate matrix.

  • tup (tupple) – Tupple of size 2, where the first and second entries are lists with the indices of the transition rate matrix to go from and to in the first instantaneous transition.

  • omega_start (list of integers) – List of starting states of the transition rate matrix.

  • omega_end (list of integers) – List of ending states of the transition rate matrix.

  • time (float) – Upper boundary of the definite integral.

itrails.int_vanloan.vanloan_2(trans_mat, tup, omega_start, omega_end, time)[source]

This function performs the van Loan (1978) method for finding the integral of a series of 3 multiplying matrix exponentials.

Parameters:
  • trans_mat (numeric numpy matrix) – Transition rate matrix.

  • tup (tupple) – Tupple of size 3, where the first and second entries are lists with the indices of the transition rate matrix to go from and to in the first instantaneous transition. Similarly, the third entry is the indices to go to from the indices of the second entry.

  • omega_start (list of integers) – List of starting states of the transition rate matrix.

  • omega_end (list of integers) – List of ending states of the transition rate matrix.

  • time (float) – Upper boundary of the definite integral.

itrails.int_vanloan.vanloan_3(trans_mat, tup, omega_start, omega_end, time)[source]

This function performs the van Loan (1978) method for finding the integral of a series of 4 multiplying matrix exponentials.

Parameters:
  • trans_mat (numeric numpy matrix) – Transition rate matrix.

  • tup (tupple) – Tupple of size 4, where the first and second entries are lists with the indices of the transition rate matrix to go from and to in the first instantaneous transition. Similarly, the third entry is the indices to go to from the indices of the second entry and so on.

  • omega_start (list of integers) – List of starting states of the transition rate matrix.

  • omega_end (list of integers) – List of ending states of the transition rate matrix.

  • time (float) – Upper boundary of the definite integral.