R/RcppExports.R

Defines functions sample_path_mr sample_path_unif sample_path_unif2 sample_path_unif3 comp_expmat

Documented in comp_expmat sample_path_mr sample_path_unif sample_path_unif2 sample_path_unif3

# Generated by using Rcpp::compileAttributes() -> do not edit by hand
# Generator token: 10BE3573-1514-4C36-9D1C-5A225CD40393

#' Simulate a sample path from an endpoint conditioned CTMC by modified
#' rejection sampling.
#'
#' @param a,b States at the interval endpoints, provided as integers
#'    corresponding to rows of the CTMC rate matrix.
#' @param t0,t1 times of the interval endpoints
#' @param Q CTMC rate matrix
#'
#' @return matrix whose first column is the sequence of transition times
#' bookended by interval endpoints, and whose second column is the sequence of
#' states
sample_path_mr <- function(a, b, t0, t1, Q) {
    .Call(`_ECctmc_sample_path_mr`, a, b, t0, t1, Q)
}

#' Simulate a sample path from an endpoint conditioned CTMC by uniformization.
#'
#' @param a,b States at the interval endpoints, provided as integers
#'    corresponding to rows of the CTMC rate matrix.
#' @param t0,t1 times of the interval endpoints
#' @param Q CTMC rate matrix
#'
#' @return matrix whose first column is the sequence of transition times
#' bookended by interval endpoints, and whose second column is the sequence of
#' states
sample_path_unif <- function(a, b, t0, t1, Q) {
    .Call(`_ECctmc_sample_path_unif`, a, b, t0, t1, Q)
}

#' Simulate a sample path from an endpoint conditioned CTMC by uniformization
#' using pre-computed eigen-values (assumes that all eigenvalues are real).
#'
#' @param a,b States at the interval endpoints, provided as integers
#'    corresponding to rows of the CTMC rate matrix.
#' @param t0,t1 times of the interval endpoints
#' @param Q CTMC rate matrix
#' @param eigen_vals vector of eigen values of Q.
#' @param eigen_vecs matrix of eigen vectors of Q.
#' @param inverse_vecs inverse of the eigen vector matrix.
#'
#' @return matrix whose first column is the sequence of transition times
#' bookended by interval endpoints, and whose second column is the sequence of
#' states
sample_path_unif2 <- function(a, b, t0, t1, Q, eigen_vals, eigen_vecs, inverse_vecs) {
    .Call(`_ECctmc_sample_path_unif2`, a, b, t0, t1, Q, eigen_vals, eigen_vecs, inverse_vecs)
}

#' Simulate a sample path from an endpoint conditioned CTMC by uniformization
#' using a pre-computed transition probability matrix.
#'
#' @param a,b States at the interval endpoints, provided as integers
#'    corresponding to rows of the CTMC rate matrix.
#' @param t0,t1 times of the interval endpoints
#' @param Q CTMC rate matrix
#' @param P CTMC transition probability matrix over the interval.
#'
#' @return matrix whose first column is the sequence of transition times
#' bookended by interval endpoints, and whose second column is the sequence of
#' states
sample_path_unif3 <- function(a, b, t0, t1, Q, P) {
    .Call(`_ECctmc_sample_path_unif3`, a, b, t0, t1, Q, P)
}

#' Compute the matrix exponential.
#'
#' @param Q matrix
#'
#' @return Matrix exponential of Q
comp_expmat <- function(Q) {
    .Call(`_ECctmc_comp_expmat`, Q)
}

# Register entry points for exported C++ functions
methods::setLoadAction(function(ns) {
    .Call('_ECctmc_RcppExport_registerCCallable', PACKAGE = 'ECctmc')
})

Try the ECctmc package in your browser

Any scripts or data that you put into this service are public.

ECctmc documentation built on May 2, 2019, 6:48 a.m.