sample_path: Sample path from the distribution of an endpoint-conditioned...

Description Usage Arguments Value Examples

View source: R/sample_path.R

Description

Sample path from the distribution of an endpoint-conditioned CTMC.

Usage

1
2
sample_path(a, b, t0, t1, Q, method = "mr", npaths = 1, eigen_vals = NULL,
  eigen_vecs = NULL, inverse_vecs = NULL, P = NULL)

Arguments

a, b

States at the left and right endpoints of the interval, given as row numbers of the CTMC rate matrix

t0, t1

Times for the left and right endpoints of the interval.

Q

CTMC rate matrix.

method

Either "mr" corresponding to modified rejection sampling, or "unif" for uniformization.

npaths

optional argument for the number of sample paths to simulate.

eigen_vals

optional vector of eigen values of Q (assumes all eigen values are real).

eigen_vecs

optional matrix of eigen vectors of Q.

inverse_vecs

optional inverse of the eigen vector matrix.

P

optional transition probability matrix over the interval

Value

sample_path returns either a matrix with a sample path or a list of matrices of sample paths.

Examples

1
sample_path(1, 2, 0, 5, matrix(c(-0.49, 0.49, 0.51, -0.51), nrow = 2, byrow = TRUE))

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