fitPoD {PoDBAY} | R Documentation |
PoD curve: fitting function
Description
Function calculates the root mean squared error (RMSE) between provided PoD values and calculated PoD values. The latter are calculated using for provided titers and provided PoD curve parameters.
By using the input titers PoDParamPointEstimation
function and median of the estimated set of PoD curve parameters (output of PoDParamEstimation
function), the point estimate of PoD curve can be obtained (for details see PoDParamPointEstimation
function).
Usage
fitPoD(params, TitersInput, CurveTitersMedian)
Arguments
params |
named data frame ("pmax", "slope", "et50"): provided PoD curve parameters |
TitersInput |
numeric vector: provided titers |
CurveTitersMedian |
numeric vector: provided PoD values |
Details
RMSE = \sqrt{\frac{\sum_{i}^{N} (PoD_{median}(titers) - PoD_{optimized}(titers))^2}{N}}
Value
negative RMSE
Examples
## Data preparation
data(estimatedParameters)
data(PoDParams)
## Example 1
# grid of titers
TitersInput <- seq(from = 0, to = 20, by = 0.01)
# for each estimated PoD curve calculate functional values
functionValues <-
matrix(NA,
nrow = nrow(estimatedParameters$resultsPriorReset),
ncol = length(TitersInput))
for (i in 1:nrow(estimatedParameters$resultsPriorReset)) {
functionValues[i,] <- PoD(TitersInput,
pmax = estimatedParameters$resultsPriorReset[i,1],
et50 = estimatedParameters$resultsPriorReset[i,3],
slope = estimatedParameters$resultsPriorReset[i,2], adjustTiters = FALSE)
}
# functional values corresponding to the median of the estimated PoD curve parameters
CurveTitersMedian <- apply(functionValues, 2, median)
# squared error of CurveTitersMedian and functional values of "params" curve
fitPoD(PoDParams, TitersInput, CurveTitersMedian)
[Package PoDBAY version 1.4.3 Index]