gillespie: The Gillespie algorithm for simulating continuous time Markov...

Description Usage Arguments Value

View source: R/RcppExports.R

Description

This function is called by Simulate.EventSim

Usage

1
2
gillespie(start_states, start_times, n_state, rates, patientEndTimes,
  calendarEndTimes, shape, resetEdges, duration)

Arguments

start_states

an integer vector giving the start states for each patient

start_times

a numeric vector containing the calendar time at which each patient is recruited

n_state

an integer, the number of states on the underlying DAG

rates

A list of n_state * n_state * length(patientEndTime) transition rates

patientEndTimes

The ith n_state*n_state block of rates represents the transition rate matrix until patient time patientEndTimes[i]

calendarEndTimes

The ith n_state*n_state block of rates represents the transition rate matrix until calendar time calendarEndTimes[i]

shape

The shape parameter for the edges in the DAG. A matrix where shape[i,j] is the Weibull shape parameter for the edge from node i to node j. If there is no edge between i and j then shape[i,j] = 0.

resetEdges

A vector (from1,to1,from2,to2,...) of edges for which if a subject traverses one of these edges then patient time switches are reset. See SetIsResetEdge.ProgressionGraph for further details

duration

The total (patient) time each subject is to be simulated

Value

A data frame with columns "id", "state" and "patient_transition_time" listing the (patient) time at which patients transition into new states. For example

id state patient_transition_time 1 1 0.0 1 2 1.4

patient 1 transitions to state 1 at time 0 (w.r.t. patient time) and then at time 1.4 transitions to state 2


scientific-computing-solutions/badminton documentation built on May 29, 2019, 3:43 p.m.