efficacySquaredError {PoDBAY} | R Documentation |
Optimization objective function: efficacy squared error
Description
Function calculates squared difference between input (reference value, or for example true in the simulation setup) efficacy and efficacy calculated based on input parameters of PoD curve and input titer distributions of vaccinated and control groups.
Usage
efficacySquaredError(params,
TrueEfficacy,
titerFun,
adjustTiters = FALSE,
adjustFrom = 0,
adjustTo = 0)
Arguments
params |
numeric vector: vector of et50 and slope; efficacy calculation is independent of Pmax and thus Pmax is excluded |
TrueEfficacy |
numeric value: input efficacy value |
titerFun |
list: list of probability density functions for vaccinated and control groups |
adjustTiters |
boolean: set to TRUE if titer values should be adjusted, for details see |
adjustFrom |
numeric: value specifying the detection limit, all values below the detection limit will be adjusted to adjustTo value |
adjustTo |
numeric: value to which titers below the detection limit will be adjusted |
Details
Function is used inside the PoDEfficacySquaredError
function for calculation of the PoD parameters.
Value
Squared difference between calculated and reference efficacy
Examples
## Example 1
data(vaccinated)
data(control)
data(PoDParams)
# Choosing et50 and slope as the inputs
params <- list("et50" = 4, "slope" = 6)
# Using probability density function from the populations
titerFun <-
list(
function(x) {dnorm(x, mean = vaccinated$mean, sd = vaccinated$stdDev)},
function(x) {dnorm(x, mean = control$mean, sd = control$stdDev)}
)
# Assigning true efficacy
TrueEfficacy <- 0.53
# Sqaured difference between true and calcuated efficacy
efficacySquaredError(params, TrueEfficacy, titerFun)