draw_nevents_conditional: Draw the number of events conditioning on the start and end...

View source: R/posteriorpredictive_functions.R

draw_nevents_conditionalR Documentation

Draw the number of events conditioning on the start and end state given the underlying CTMC (implementing equation 2.9 from Hobolth and Stone, 2009)

Description

Draw the number of events conditioning on the start and end state given the underlying CTMC (implementing equation 2.9 from Hobolth and Stone, 2009)

Usage

draw_nevents_conditional(node_ages, Q, Q_ages = NULL, node_state_indices, Pab)

Arguments

node_ages

A vector containing the start (first element) and end ages (second element) of this duration

Q

An instantaneous-rate matrix (or a list of matrices for a piecewise constant discrete-geographic model) characterizes the CTMC

Q_ages

A vector containing boundaries of time intervals for a piecewise constant geographic model (NULL means a constant model); the length of this vector should be one shorter than the Q-matrix list, sorted from oldest to youngest.

node_state_indices

State indices (i.e., the indices to use to fecth the states from the states vector) pf the start and end nodes

Pab

The transition probability between the start and end states

Value

An integer that is the sampled number of events


jsigao/prioritree documentation built on Jan. 9, 2023, 5:35 a.m.