Compute the Negative Log-Likelihood for a Given Data Set and Transition Model
Source:R/estimateParams.R
negLogLik.Rd
Compute the Negative Log-Likelihood for a Given Data Set and Transition Model
Arguments
- transition
(
ExponentialTransition
orWeibullTransition
)
seeexponential_transition()
orweibull_transition()
for details.- data
(
data.frame
)
in the format created byprepareData()
.
Details
Calculates the negative log-likelihood for a given data set and transition model. It uses the hazard and survival functions specific to the transition model.
Examples
transition <- exponential_transition(h01 = 1.2, h02 = 1.5, h12 = 1.6)
simData <- getOneClinicalTrial(
nPat = c(30), transitionByArm = list(transition),
dropout = list(rate = 0.8, time = 12),
accrual = list(param = "time", value = 1)
)
negLogLik(transition, prepareData(simData))
#> [1] 24.68872