Fits the Brody gas production model to each bottle in a rumen_gp dataset.
Value
A brody_fit object containing:
Parameter estimates
Model diagnostics
Predicted values
Residuals
Details
Equation
$$ V(t) = A \left(1 - b e^{-kt}\right) $$
where:
\(V(t)\) is cumulative gas production at time \(t\)
\(A\) is asymptotic gas production
\(b\) is an integration constant
\(k\) is the fractional rate constant
Interpretation
The Brody model describes gas production as a monotonic increase toward an asymptotic value. The parameter \(k\) controls the speed of fermentation, while \(b\) controls the initial position of the curve.
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
)
# Fit using package default starting values
fit_default <- fit_brody(
gp
)
#> Warning: Large negative pressure values detected. Minimum PSI = -1.274 . Please inspect the affected bottles.
#> rumenGP data validation passed.
#> Observations: 1752
#> Heads: 24
#> Treatments: 5
summary(fit_default)
#>
#> Brody model summary
#> -------------------
#> Total bottles: 24
#> Successful fits: 23
#> Failed fits: 1
#> Low R-squared (< 0.90): 3
#>
# Fit using custom starting values
fit_custom_start <- fit_brody(
gp,
start = list(
A = 120,
b = 0.9,
k = 0.05
)
)
#> Warning: Large negative pressure values detected. Minimum PSI = -1.274 . Please inspect the affected bottles.
#> rumenGP data validation passed.
#> Observations: 1752
#> Heads: 24
#> Treatments: 5
summary(fit_custom_start)
#>
#> Brody model summary
#> -------------------
#> Total bottles: 24
#> Successful fits: 23
#> Failed fits: 1
#> Low R-squared (< 0.90): 3
#>