Take a character formula transition matrix and turn it into a function

trans_mat_to_D_fxn(D_mat, K, n_pars)

Arguments

D_mat

a KxK matrix of character transitions. See details

K

number of states

n_pars

number of parameters

Value

a list of length \(K^2\) where entry K(i-1) + j for i, j <= K is a function. See details.

Details

This function dynamically creates a list of functions that turn the character transition formulas provided by the user in D_mat into \(K^2\) functions which take in arguments X0, ..., XK-1), par1, par2, ..., parn_pars, N, and t and output the numeric transition rate of an individual currently in state \(i\) to move to state \(j\).