efficacySquaredError: Optimization objective function: efficacy squared error

Description Usage Arguments Details Value Examples

View source: R/FunctionsPoDParameters.R

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

1
2
3
4
5
6
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 PoD function

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

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
## 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)

PoDBAY documentation built on Sept. 21, 2021, 5:08 p.m.