Fits the Zwietering-modified Gompertz model to each bottle in a rumen_gp dataset.
Value
A gompertz_fit object containing:
Parameter estimates
Model diagnostics
Predicted values
Residuals
Details
Equation
$$ V(t)= A \exp \left[ - \exp \left( \frac{\mu e}{A} (\lambda-t) + 1 \right) \right] $$
where:
\(V(t)\) is cumulative gas production at time \(t\)
\(A\) is asymptotic gas production
\(\mu\) is the maximum gas production rate
\(\lambda\) is lag time
\(e\) is Euler's number
Interpretation
The modified Gompertz model is one of the most commonly used models for gas production kinetics.
It explicitly estimates:
Final gas production potential (\(A\))
Maximum gas production rate (\(\mu\))
Lag time (\(\lambda\))
making it biologically informative and easy to interpret.
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_gompertz(
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)
#>
#> Gompertz model summary
#> ----------------------
#> Total bottles: 21
#> Successful fits: 21
#> Failed fits: 0
#> Low R-squared (< 0.90): 0
#> Lambda at boundary: 21
#>
# Fit using custom starting values
fit_custom_start <- fit_gompertz(
gp_clean,
start = list(
A = 120,
mu = 5,
lambda = 1
)
)
#> 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)
#>
#> Gompertz model summary
#> ----------------------
#> Total bottles: 21
#> Successful fits: 21
#> Failed fits: 0
#> Low R-squared (< 0.90): 0
#> Lambda at boundary: 21
#>