Non-Markovian Accumulators, Transition States, and Backwards Conversion
params =
list(
t_names = c("natural_history"), # Strategy names.
n_treatments = 1, # Number of treatments
s_names = c("Healthy", "CVD", "Dead"), # State names
n_states = 3, # Number of states
n_cohort = 1, # Cohort size
n_cycles = 100, # Number of cycles in model.
cycle = 1, # Cycle length
initial_age = 55, # Cohort starting age
r_H_CVD = 0.15, # Rate of healthy -> CVD
hr_CVD = 10, # Hazard Ratio: CVD Death
r_H_D = 0.01 # Rate of healthy -> dead
)
params$mR <-
with(params,{
r_CVD_D <- hr_CVD * r_H_D
R_ <-
array(data = c(0, 0, 0,
r_H_CVD,0, 0,
r_H_D,r_H_D + r_CVD_D,0,
r_H_D, 0,0),
dim = c(n_states, n_states, n_treatments),
dimnames = list(from = s_names,
to = s_names,
t_names))
R <- apply(R_,3, simplify=FALSE,function(x) {
diag(x) = -rowSums(x)
x * cycle
})
R
})
Augmenting the transition matrix with non-markovian elements can address each question:
Healthy | CVD | Dead | |
---|---|---|---|
Healthy | 0.852 | 0.131 | 0.017 |
CVD | 0.000 | 0.896 | 0.104 |
Dead | 0.000 | 0.000 | 1.000 |
Healthy | CVD | Dead | trCVD | accCVD | |
---|---|---|---|---|---|
Healthy | 0.852 | 0.131 | 0.017 | . | . |
CVD | 0 | 0.896 | 0.104 | . | . |
Dead | 0 | 0 | 1 | . | . |
trCVD | . | . | . | . | . |
accCVD | . | . | . | . | . |
Healthy | CVD | Dead | |
---|---|---|---|
Healthy | -0.16 | 0.15 | 0.01 |
CVD | 0.00 | -0.11 | 0.11 |
Dead | 0.00 | 0.00 | 0.00 |
We’ll start with the original transition rate matrix:
Next, we will add both a column and a row for the accumulator that tracks movement into the CVD health state.
For now, just include zeros.
Healthy | CVD | Dead | accCVD | |
---|---|---|---|---|
Healthy | 0.852 | 0.131 | 0.017 | 0.139 |
CVD | 0 | 0.896 | 0.104 | 0 |
Dead | 0 | 0 | 1 | 0 |
accCVD | 0 | 0 | 0 | 1 |
cycle | Healthy | CVD | Dead | accCVD |
---|---|---|---|---|
0 | 100000 | 0 | 0.0 | 0 |
1 | 85214 | 13107 | 1678.5 | 13862 |
cycle | Healthy | CVD | Dead | accCVD |
---|---|---|---|---|
0 | 100000 | 0 | 0.0 | 0 |
1 | 85214 | 13107 | 1678.5 | 13862 |
CVD
CVD Death
as well as death from background causes.accCVD
accCVD
transition probability.We’ll start with the original transition rate matrix:
Healthy | CVD | Dead | trCVDDeath | |
---|---|---|---|---|
Healthy | 0.852 | 0.131 | 0.017 | 0.007 |
CVD | 0.000 | 0.896 | 0.104 | 0.095 |
Dead | 0.000 | 0.000 | 1.000 | 0.000 |
trCVDDeath | 0.000 | 0.000 | 0.000 | 0.000 |
Healthy
state (compound transitions) and the CVD
state!cycle | Healthy | CVD | Dead | trCVDDeath |
---|---|---|---|---|
0 | 100000 | 0 | 0.0 | 0.00 |
1 | 85214 | 13107 | 1678.5 | 685.83 |
trCVDDeath
and apply as usual to calculate accumulated costs from a one-time CVD death cost.# Define the cost vector
cost_payoff = c("Healthy" = 0, "CVD" = 500, "Dead" = 0, "trCVDDeath" = 2000)
# Sum up total costs in each cycle
costs_cycle = trace[["natural_history"]][-1,] %*% cost_payoff
# Function for cycle correction (alternative Simpson's method)
alt_simp_coef <- function(i) c(17, 59, 43, 49, rep(48, i-8), 49, 43, 59, 17) / 48
cycle_adj <- function(x) sum(alt_simp_coef(length(x)) * x)
total_costs = cycle_adj(costs_cycle)
total_costs
[1] 5926.6
We’ll start with the original transition rate matrix:
R <-
cbind(R_,"tunCVDy1" = c(0,0,0), "tunCVDy2" = c(0,0,0),"NULL" = c(0,0,0)) %>%
rbind(.,"tunCVDy1" = c(0,0,0,0,0,0), "tunCVDy2" = c(0,0,0,0,0,0), "NULL" = c(0,0,0,0,0,0))
R
Healthy CVD Dead tunCVDy1 tunCVDy2 NULL
Healthy -0.16 0.15 0.01 0 0 0
CVD 0.00 -0.11 0.11 0 0 0
Dead 0.00 0.00 0.00 0 0 0
tunCVDy1 0.00 0.00 0.00 0 0 0
tunCVDy2 0.00 0.00 0.00 0 0 0
NULL 0.00 0.00 0.00 0 0 0
Healthy | tunCVDy1 | tunCVDy2 | CVD | Dead | |
---|---|---|---|---|---|
Healthy | 0.852 | 0.139 | 0 | 0 | 0.009 |
tunCVDy1 | 0 | 1 | 0 | 0 | 0 |
tunCVDy2 | 0 | 0 | 1 | 0 | 0 |
CVD | 0 | 0 | 0 | 0.896 | 0.104 |
Dead | 0 | 0 | 0 | 0 | 1 |
Healthy | tunCVDy1 | tunCVDy2 | CVD | Dead | |
---|---|---|---|---|---|
Healthy | 0.852 | 0.139 | 0 | 0 | 0.009 |
tunCVDy1 | 0 | 1 | 0 | 0 | 0.104 |
tunCVDy2 | 0 | 0 | 1 | 0 | 0 |
CVD | 0 | 0 | 0 | 0.896 | 0.104 |
Dead | 0 | 0 | 0 | 0 | 1 |
Healthy | tunCVDy1 | tunCVDy2 | CVD | Dead | |
---|---|---|---|---|---|
Healthy | 0.852 | 0.139 | 0 | 0 | 0.009 |
tunCVDy1 | 0 | 0 | 0.896 | 0 | 0.104 |
tunCVDy2 | 0 | 0 | 1 | 0 | 0 |
CVD | 0 | 0 | 0 | 0.896 | 0.104 |
Dead | 0 | 0 | 0 | 0 | 1 |
Healthy | tunCVDy1 | tunCVDy2 | CVD | Dead | |
---|---|---|---|---|---|
Healthy | 0.852 | 0.139 | 0 | 0 | 0.009 |
tunCVDy1 | 0 | 0 | 0.896 | 0 | 0.104 |
tunCVDy2 | 0 | 0 | 0 | 0.896 | 0.104 |
CVD | 0 | 0 | 0 | 0.896 | 0.104 |
Dead | 0 | 0 | 0 | 0 | 1 |
Source: Green et al. (2023)
TK