getTarget {simIDM}R Documentation

Generate the Target Function for Optimization

Description

Generate the Target Function for Optimization

Usage

getTarget(transition)

## S3 method for class 'ExponentialTransition'
getTarget(transition)

## S3 method for class 'WeibullTransition'
getTarget(transition)

Arguments

transition

(TransitionParameters)
specifying the distribution family. See exponential_transition() or weibull_transition() for details.

Details

This function creates a target function for optimization, computing the negative log-likelihood for given parameters, data, and transition model type.

Value

Function that calculates the negative log-likelihood for the given parameters.

Methods (by class)

Examples

transition <- exponential_transition(2, 1.3, 0.8)
simData <- getOneClinicalTrial(
  nPat = c(30), transitionByArm = list(transition),
  dropout = list(rate = 0.8, time = 12),
  accrual = list(param = "time", value = 1)
)
params <- c(1.2, 1.5, 1.6) # For ExponentialTransition
data <- prepareData(simData)
transition <- exponential_transition()
fun <- getTarget(transition)
fun(params, data)
transition <- exponential_transition(2, 1.3, 0.8)
simData <- getOneClinicalTrial(
  nPat = c(30), transitionByArm = list(transition),
  dropout = list(rate = 0.8, time = 12),
  accrual = list(param = "time", value = 1)
)
params <- c(1.2, 1.5, 1.6)
data <- prepareData(simData)
transition <- exponential_transition()
target <- getTarget(transition)
target(params, data)
transition <- weibull_transition(h01 = 1.2, h02 = 1.5, h12 = 1.6, p01 = 2, p02 = 2.5, p12 = 3)
simData <- getOneClinicalTrial(
  nPat = c(30), transitionByArm = list(transition),
  dropout = list(rate = 0.8, time = 12),
  accrual = list(param = "time", value = 1)
)
params <- c(1.2, 1.5, 1.6, 0.8, 1.3, 1.1)
data <- prepareData(simData)
transition <- weibull_transition()
target <- getTarget(transition)
target(params, data)

[Package simIDM version 0.1.0 Index]