Calculation of additional parameters of interest
Umut Caglar, Claus O. Wilke
2025-10-03
Source:vignettes/additional_parameters.Rmd
additional_parameters.Rmd
After we have successfully fitted either a sigmoidal or
double-sigmoidal model to input data, we may want to extract additional
information of interest about the fitted curves, such as the midpoint of
the curve and the slope at the midpoint. This information can be
calculated with the function parameterCalculation()
. It is
called automatically by the top-level interface
fitAndCategorize()
, but it needs to be called manually if
we fit curves with multipleFitFunction()
. The default
functions assume that the lower asymptote,
,
(when x is at negative infinity) is zero. If the data are better fit
using a model that estimates the lower asymptote,
parameterCalculation_h0()
and
multipleFitFunction_h0()
functions can be used.
Assume we have fitted a sigmoidal or double-sigmoidal model using
sicegar::multipleFitFunction()
:
sigmoidalModel <- multipleFitFunction(dataInput=normalizedSigmoidalInput,
model="sigmoidal")
We can then apply sicegar::parameterCalculation()
to the
generated model objects:
sigmoidalModelAugmented <- parameterCalculation(sigmoidalModel)
Compare the contents of the fitted model before and after parameter calculation:
# before parameter calculation
t(sigmoidalModel)
## [,1]
## maximum_N_Estimate "0.9892762"
## maximum_Std_Error "0.00172638"
## maximum_t_value "573.035"
## maximum_Pr_t "6.473172e-80"
## slopeParam_N_Estimate "24.91311"
## slopeParam_Std_Error "0.3550744"
## slopeParam_t_value "70.16306"
## slopeParam_Pr_t "1.684367e-43"
## midPoint_N_Estimate "0.3352606"
## midPoint_Std_Error "0.0006568671"
## midPoint_t_value "510.3933"
## midPoint_Pr_t "6.635847e-78"
## residual_Sum_of_Squares "0.003021868"
## log_likelihood "144.5919"
## AIC_value "-281.1837"
## BIC_value "-274.1389"
## isThisaFit "TRUE"
## startVector.maximum "0.7550929"
## startVector.slopeParam "101.1569"
## startVector.midPoint "0.1894987"
## dataScalingParameters.timeRange "24"
## dataScalingParameters.intensityMin "0.1065867"
## dataScalingParameters.intensityMax "4.09696"
## dataScalingParameters.intensityRange "3.990373"
## model "sigmoidal"
## additionalParameters "FALSE"
## maximum_Estimate "4.054168"
## slopeParam_Estimate "1.038046"
## midPoint_Estimate "8.046253"
## dataInputName "sigmoidalSample"
## betterFit "3"
## correctFit "20"
## totalFit "25"
# after parameter calculation
t(sigmoidalModelAugmented)
## [,1]
## maximum_N_Estimate "0.9892762"
## maximum_Std_Error "0.00172638"
## maximum_t_value "573.035"
## maximum_Pr_t "6.473172e-80"
## slopeParam_N_Estimate "24.91311"
## slopeParam_Std_Error "0.3550744"
## slopeParam_t_value "70.16306"
## slopeParam_Pr_t "1.684367e-43"
## midPoint_N_Estimate "0.3352606"
## midPoint_Std_Error "0.0006568671"
## midPoint_t_value "510.3933"
## midPoint_Pr_t "6.635847e-78"
## residual_Sum_of_Squares "0.003021868"
## log_likelihood "144.5919"
## AIC_value "-281.1837"
## BIC_value "-274.1389"
## isThisaFit "TRUE"
## startVector.maximum "0.7550929"
## startVector.slopeParam "101.1569"
## startVector.midPoint "0.1894987"
## dataScalingParameters.timeRange "24"
## dataScalingParameters.intensityMin "0.1065867"
## dataScalingParameters.intensityMax "4.09696"
## dataScalingParameters.intensityRange "3.990373"
## model "sigmoidal"
## additionalParameters "TRUE"
## maximum_Estimate "4.054168"
## slopeParam_Estimate "1.038046"
## midPoint_Estimate "8.046253"
## dataInputName "sigmoidalSample"
## betterFit "3"
## correctFit "20"
## totalFit "25"
## maximum_x NA
## maximum_y "4.054168"
## midPoint_x "8.046253"
## midPoint_y "2.027084"
## slope "1.052103"
## incrementTime "3.853393"
## startPoint_x "6.119557"
## startPoint_y "0"
## reachMaximum_x "9.97295"
## reachMaximum_y "4.054168"
We see that the variable additionalParameters
has
switched from FALSE
to TRUE
, and further,
there are numerous additional quantities listed now, starting with
maximum_x
. Below, we describe the meaning of these
additional parameters for the sigmoidal and double-sigmoidal models.
Additional parameters for the sigmoidal model
The following parameters are calculated by
parameterCalculation()
for the sigmoidal model.
1. Maximum of the fitted curve.
-
maximum_x
: The x value (i.e., time) at which the fitted curve reaches its maximum value. Because of the nature of the sigmoidal function this value is always equal to infinity, so the output is alwaysNA
for the sigmoidal model. -
maximum_y
: The maximum intensity the fitted curve reaches at infinity. The value is equal tomaximum_Estimate
.
2. Midpoint of the fitted curve. This is the point where the slope is maximal and the intensity half of the maximum intensity.
-
midPoint_x
: The x value (i.e., time) at which the fitted curve reaches the midpoint. The value is equal tomidPoint_Estimate
. -
midPoint_y
: The intensity at the midpoint. The value is equal tomaximum_y / 2
.
3. Slope of the fitted curve.
-
slope
: The maximum slope of the fitted curve. This is the slope at the midpoint. The value is equal toslopeParam_Estimate * maximum_y / 4
.
4. Parameters related to the slope tangent, which is the tangent line that passes through the midpoint of the curve.
incrementTime
: The time interval from when the slope tangent intersects with the horizontal line defined byy = 0
until it intersects with the horizontal line defined byy = maximum_y
. Its value is equal tomaximum_y / slope
.startPoint_x
: The x value (i.e., time) of the start point. The start point is defined as the point where the slope tangent intersects withy = 0
. It approximately represents the moment in time when the intensity signal first appears. Its value is equal tomidPoint_x - (incrementTime/2)
.startPoint_y
: The intensity of the start point. Equals to zero by definition.reachMaximum_x
: The x value (i.e., time) of the reach maximum point. The reach maximum point is defined as the point where the slope tangent intersects withy = maximum_y
. It approximately represents the moment in time when the intensity signal reaches its maximum. Its value is equal tomidPoint_x + (incrementTime/2)
.reachMaximum_y
: The intensity of reach maximum point. Equals tomaximum_y
by definition.
Additional parameters for the double-sigmoidal model
1. Maximum of the fitted curve.
-
maximum_x
: The x value (i.e., time) at which the fitted curve reaches its maximum value. Umut, how is the value calculated? -
maximum_y
: The maximum intensity the fitted curve reaches at infinity. The value is equal tomaximum_Estimate
. Umut, correct?
2. Final asymptote intensity of the fitted model
-
finalAsymptoteIntensity
: The intensity the fitted curve reaches asymptotically at infinite time. The value is equal tofinalAsymptoteIntensityRatio_Estimate * maximum_y
.
3. First midpoint of the fitted curve. This is the point where the intensity first reaches half of its maximum.
-
midPoint1_x
: The x value (i.e., time) at which the fitted curve reaches the first midpoint. The value is calculated numerically and is different frommidPoint1Param_Estimate
. -
midPoint1_y
: The intensity at the first midpoint. The value is equal tomaximum_y / 2
.
4. Second midpoint of the fitted curve. This is the point at which the intensity decreases halfway from its maximum to its final asymptotic value.
-
midPoint2_x
: The x value (i.e., time) at which the fitted curve reaches the second midpoint. The value is calculated numerically and is different frommidPoint2Param_Estimate
. -
midPoint2_y
: The intensity at the second midpoint. The value is equal tofinalAsymptoteIntensity + (maximum_y - finalAsymptoteIntensity) / 2
.
5. Slopes of the fitted curve.
-
slope1
: The slope of the fitted curve at the first midpoint. The value is calculated numerically and is different fromslope1Param_Estimate
. -
slope2
: The slope of the fitted model at the second midpoint. The value is calculated numerically and is different fromslope2Param_Estimate
.
6. Parameters related to the first slope tangent, which is the tangent line that passes through the first midpoint of the curve.
-
incrementTime
: The time interval from when the first slope tangent intersects with the horizontal line defined byy = 0
until it intersects with the horizontal line defined byy = maximum_y
. Its value is equal tomaximum_y / slope
. -
startPoint_x
: The x value (i.e., time) of the start point. The start point is defined as the point where the first slope tangent intersects withy = 0
. It approximately represents the moment in time when the intensity signal first appears. Its value is equal tomidPoint1_x - (incrementTime/2)
. -
startPoint_y
: The intensity of the start point. Equals to zero by definition. -
reachMaximum_x
: The x value (i.e., time) of the reach maximum point. The reach maximum point is defined as the point where the fist slope tangent intersects withy = maximum_y
. It approximately represents the moment in time when the intensity signal reaches its maximum. Its value is equal tomidPoint_x + (incrementTime/2)
. -
reachMaximum_y
: The intensity of the reach maximum point. Equals tomaximum_y
by definition.
7. Parameters related to the second slope tangent, which is the tangent line that passes through the second midpoint of the curve.
-
decrementTime
: The time interval from when the second slope tangent intersects with the horizontal line defined byy = maximum_y
until it intersects with the horizontal line defined byy = finalAsymptoteIntensity
. Its value is equal to- (maximum_y -finalAsymptoteIntensity)/ slope2
. -
startDeclinePoint_x
: The x value (i.e., time) of the start decline point. The start decline point is defined as the point where the second slope tangent intersects withy = maximum_y
. It approximately represents the moment in time when the intensity signal starts to drop from its maximum value. The value is equal tomidPoint2_x - (decrementTime/2)
. -
startDeclinePoint_y
: The intensity of the start decline point. Equals tomaximum_y
by definition. -
endDeclinePoint_x
: The x value (i.e., time) of the end decline point. The end decline point is defined as the point where the second slope tangent intersects withy = finalAsymptoteIntensity
. It approximately represents the moment in time when the intensity signal reaches its final asymptotic intensity. The value is equal tomidPoint2_x + (decrementTime/2)
. -
endDeclinePoint_y
: The intensity of the end decline point. Equals tofinalAsymptoteIntensity
by definition.