Fits the Log-logistic gas production model to each bottle in a rumen_gp dataset.
Value
A loglogistic_fit object containing:
Parameter estimates
Model diagnostics
Predicted values
Residuals
Details
Equation
$$ V(t) = \frac{ VF(rt)^a } { 1 + (rt)^a } $$
where:
\(V(t)\) is cumulative gas production at time \(t\)
\(VF\) is asymptotic gas production
\(r\) is the rate parameter
\(a\) is the shape parameter
Interpretation
The Log-logistic model is a flexible sigmoidal model capable of describing a wide range of gas production profiles.
The parameter \(r\) controls the speed of gas production, while \(a\) controls curve shape, steepness, and inflection behavior.
Advantages
Excellent flexibility
Biologically interpretable parameters
Often produces excellent fits
Common in nonlinear growth and fermentation modeling
Limitations
Requires positive incubation times
Shape parameter may be less intuitive than simple exponential models
Notes
The Log-logistic model is mathematically
equivalent to both the Groot model
implemented in fit_groot() and the
generalized Michaelis-Menten model
implemented in fit_mm().
Parameter correspondence:
VF = Aa = c = k1/r = K = b
Both formulations produce identical fitted values, residuals, diagnostics, AIC, BIC, RMSE, and R-squared when convergence is achieved.
Researchers may choose either formulation according to the terminology commonly used in their field.
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_loglogistic(
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)
#>
#> Log-logistic model summary
#> --------------------------
#> Total bottles: 21
#> Successful fits: 21
#> Failed fits: 0
#> Low R-squared (< 0.90): 0
#>
# Fit using custom starting values
fit_custom_start <- fit_loglogistic(
gp_clean,
start = list(
VF = 120,
r = 0.10,
a = 2
)
)
#> 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)
#>
#> Log-logistic model summary
#> --------------------------
#> Total bottles: 21
#> Successful fits: 21
#> Failed fits: 0
#> Low R-squared (< 0.90): 0
#>