Fits a dual-pool logistic model representing rapidly and slowly degradable fractions.
Value
A dual_logistic_fit object containing:
Parameter estimates
Model diagnostics
Predicted values
Residuals
Rapid and slow pool estimates
Details
Equation
$$ V(t)= \frac{V1F} { 1+\exp\left[2-4k1(t-\lambda)\right] } + \frac{V2F} { 1+\exp\left[2-4k2(t-\lambda)\right] } $$
where:
\(V(t)\) is cumulative gas production at time \(t\)
\(V1F\) is the final gas volume from the rapidly fermentable fraction
\(V2F\) is the final gas volume from the slowly fermentable fraction
\(k1\) is the fractional rate constant of the rapid fraction
\(k2\) is the fractional rate constant of the slow fraction
\(\lambda\) is lag time
Interpretation
The Dual Logistic model assumes that gas production originates from two independent fermentation pools:
A rapidly degradable fraction (\(V1F\))
A slowly degradable fraction (\(V2F\))
Each fraction follows a logistic fermentation pattern with its own rate constant.
Examples
files <- example_data()
raw_data <- read_ankom(
files$ankom
)
metadata <- read_metadata(
files$metadata
)
gp <- process_ankom(
raw_data,
metadata,
headspace_ml = 210,
temperature_c = 39
)
gp_clean <- exclude_heads(
gp,
heads = c(
"1",
"2",
"4",
"20"
),
reason = c(
"Abnormal gas profile",
"Abnormal gas profile",
"Abnormal gas profile",
"Abnormal gas profile"
)
)
# Fit using package default starting values
fit_default <- fit_dual_logistic(
gp_clean
)
#> Minor negative pressure values detected. Minimum PSI = -0.255 . These may reflect normal sensor variation.
#> rumenGP data validation passed.
#> Observations: 3038
#> Heads: 21
#> Treatments: 5
summary(fit_default)
#>
#> Dual-pool Logistic model summary
#> --------------------------------
#> Total bottles: 21
#> Successful fits: 21
#> Failed fits: 0
#> Low R-squared (< 0.90): 0
#> Lambda at boundary: 0
#>
# Fit using custom starting values
fit_custom_start <- fit_dual_logistic(
gp_clean,
start = list(
V1F = 30,
V2F = 70,
k1 = 0.20,
k2 = 0.05,
lambda = 0.50
)
)
#> Minor negative pressure values detected. Minimum PSI = -0.255 . These may reflect normal sensor variation.
#> rumenGP data validation passed.
#> Observations: 3038
#> Heads: 21
#> Treatments: 5
summary(fit_custom_start)
#>
#> Dual-pool Logistic model summary
#> --------------------------------
#> Total bottles: 21
#> Successful fits: 21
#> Failed fits: 0
#> Low R-squared (< 0.90): 0
#> Lambda at boundary: 0
#>