R/transition-matrix-to-function.R
trans_mat_to_D_fxn.Rd
Take a character formula transition matrix and turn it into a function
trans_mat_to_D_fxn(D_mat, K, n_pars)
D_mat | a KxK matrix of character transitions. See details |
---|---|
K | number of states |
n_pars | number of parameters |
a list of length \(K^2\) where entry K(i-1) + j for i, j <= K is a function. See 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\).