Create a function of time that calculates (1-exp(-lambda_ij*time))/lambda_ij for every element lambda_ij of the input matrix Lambda_ij.

PCMPExpxMeanExp(
  Lambda_ij,
  threshold.Lambda_ij = getOption("PCMBase.Threshold.Lambda_ij", 1e-08)
)

Arguments

Lambda_ij

a squared numerical matrix of dimension k x k

threshold.Lambda_ij

a 0-threshold for abs(Lambda_i + Lambda_j), where Lambda_i and Lambda_j are eigenvalues of the parameter matrix H. This threshold-value is used as a condition to take the limit time of the expression `(1-exp(-Lambda_ij*time))/Lambda_ij` as `(Lambda_i+Lambda_j) --> 0`. You can control this value by the global option "PCMBase.Threshold.Lambda_ij". The default value (1e-8) is suitable for branch lengths bigger than 1e-6. For smaller branch lengths, you may want to increase the threshold value using, e.g. `options(PCMBase.Threshold.Lambda_ij=1e-6)`.

Value

a function of time returning a matrix with entries formed from the above function or the limit, time, if |Lambda_ij|<=trehshold0.

Details

the function (1-exp(-lambda_ij*time))/lambda_ij corresponds to the product of the CDF of an exponential distribution with rate Lambda_ij multiplied by its mean value (mean waiting time).