Create a list containing predicted transition probabilities at discrete times. Since the transition probabilities have presumably already been predicted based on covariate values, no input data is required for simulation. The class can be instantiated from either an array, a data.table, a data.frame, or a tpmatrix.

tparams_transprobs(object, ...)

# S3 method for array
tparams_transprobs(
object,
tpmatrix_id = NULL,
times = NULL,
grp_id = NULL,
patient_wt = NULL,
...
)

# S3 method for data.table
tparams_transprobs(object, ...)

# S3 method for data.frame
tparams_transprobs(object, ...)

# S3 method for tpmatrix
tparams_transprobs(object, tpmatrix_id, ...)

## Arguments

object An object of the appropriate class. Further arguments passed to or from other methods. Currently unused. An object of class tpmatrix_id (or an equivalent data.table with the same ID columns as returned by tpmatrix_id()). An optional numeric vector of distinct times to pass to time_intervals representing time intervals indexed by the 4th dimension of the array. May either be the start or the end of intervals. This argument is not required if there is only one time interval. An optional numeric vector of integers denoting the subgroups. Must be the same length as the 3rd dimension of the array. An optional numeric vector denoting the weight to apply to each patient within a subgroup. Must be the same length as the 3rd dimension of the array.

## Value

An object of class tparams_transprobs, which is a list containing value and relevant ID attributes. The element value is an array of predicted transition probability matrices from the probability distribution of the underlying statistical model. Each matrix in value is a prediction for a sample, strategy_id, patient_id, and optionally time_id combination.

## Details

The format of object depends on its class:

array

Either a 3D or a 6D array is possible.

• If a 3D array, then each slice is a square transition probability matrix. In this case tpmatrix_id is required and each matrix slice corresponds to the same numbered row in tpmatrix_id. The number of matrix slices must equal the number of rows in tpmatrix_id.

• If a 6D array, then the dimensions of the array should be indexed as follows: 1st (sample), 2nd (strategy_id), 3rd (patient_id), 4th (time_id), 5th (rows of transition matrix), and 6th (columns of transition matrix). In other words, an index of [s, k, i, t] represents the transition matrix for the sth sample, kth treatment strategy, ith patient, and tth time interval.

data.table

Must contain the following:

• ID columns for the parameter sample (sample), treatment strategy (strategy_id), and patient (patient_id). If the number of time intervals is greater than 1 it must also contain the column time_start denoting the starting time of a time interval. A column patient_wt may also be used to denote the weight to apply to each patient.

• Columns for each element of the transition probability matrix. They should be prefixed with "prob_" and ordered rowwise. For example, the following columns would be used for a 2x2 transition probability matrix: prob_1 (1st row, 1st column), prob_2 (1st row, 2nd column), prob_3 (2nd row, 1st column), and prob_4 (2nd row, 2nd column).

data.frame

Same as data.table.

tpmatrix

An object of class tpmatrix.

A tparams_transprobs object is also instantiated when creating a cohort discrete time state transition model using define_model().

define_model(), create_CohortDtstm(), tpmatrix()