
---
title: "Model Equations Reference"
output: rmarkdown::html_vignette
vignette: >
  %\VignetteIndexEntry{Model Equations Reference}
  %\VignetteEngine{knitr::rmarkdown}
  \usepackage[utf8]{inputenc}
---

```{r, include = FALSE}
knitr::opts_chunk$set(
  collapse = TRUE,
  comment = "#>"
)
```

# Introduction

rumenGP implements a collection of nonlinear models for
describing cumulative gas production during in vitro rumen
fermentation.

This vignette summarizes:

- Model equations
- Parameter definitions
- Biological interpretation
- Advantages
- Limitations
- Typical applications

Throughout this vignette:

\[
V(t)
\]

represents cumulative gas production at time:

\[
t
\]

---

# Single-Pool Models

## Brody

### Equation

\[
V(t)
=
A
\left(
1
-
b
e^{-kt}
\right)
\]

### Parameters

| Parameter | Description |
|------------|------------|
| A | Asymptotic gas production |
| b | Integration constant |
| k | Fractional rate constant |

### Advantages

- Simple and robust
- Stable convergence
- Easy interpretation

### Limitations

- No lag parameter
- Limited flexibility

---

## Ørskov and McDonald

### Equation

\[
V(t)
=
VF
+
b
\left(
1-e^{-kt}
\right)
\]

### Parameters

| Parameter | Description |
|------------|------------|
| VF | Initial gas volume (intercept) |
| b | Fermentable fraction |
| k | Fractional rate constant |

### Advantages

- Widely used in ruminant nutrition
- Simple biological interpretation

### Limitations

- No explicit lag phase

---

## EXP0

### Equation

\[
V(t)
=
V_f
\left(
1-e^{-kt}
\right)
\]

### Parameters

| Parameter | Description |
|------------|------------|
| Vf | Asymptotic gas production |
| k | Fractional rate constant |

### Advantages

- Very simple
- Fast convergence

### Limitations

- No lag phase
- Limited flexibility

---

## EXPL

### Equation

\[
V(t)
=
V_f
\left(
1-e^{-k(t-\lambda)}
\right)
\]

### Parameters

| Parameter | Description |
|------------|------------|
| Vf | Asymptotic gas production |
| k | Fractional rate constant |
| \(\lambda\) | Lag time |

### Advantages

- Explicit lag parameter
- Easy interpretation

### Limitations

- Less flexible than sigmoidal models

---

## Gompertz

### Equation

\[
V(t)
=
A
\exp
\left[
-
\exp
\left(
\frac{\mu e}{A}
(\lambda-t)
+
1
\right)
\right]
\]

### Parameters

| Parameter | Description |
|------------|------------|
| A | Asymptotic gas production |
| \(\mu\) | Maximum gas production rate |
| \(\lambda\) | Lag time |

### Advantages

- Explicit lag and growth-rate parameters
- Excellent flexibility
- Widely used in gas production studies

### Limitations

- More complex than exponential models

---

## Logistic

### Equation

\[
V(t)
=
\frac{A}
{
1+\exp
\left[
2+
4k(\lambda-t)
\right]
}
\]

### Parameters

| Parameter | Description |
|------------|------------|
| A | Asymptotic gas production |
| k | Fractional rate constant |
| \(\lambda\) | Lag time |

### Advantages

- Sigmoidal behavior
- Stable convergence

### Limitations

- Assumes symmetric sigmoid shape

---

## Mitscherlich

### Equation

\[
V(t)
=
A
\left[
1
-
\exp
\left(
-k(t-\lambda)
-
d
\left(
\sqrt{t+0.001}
-
\sqrt{\lambda+0.001}
\right)
\right)
\right]
\]

### Parameters

| Parameter | Description |
|------------|------------|
| A | Asymptotic gas production |
| k | Fractional rate constant |
| d | Shape parameter |
| \(\lambda\) | Lag time |

### Advantages

- Flexible curve shape
- Explicit lag phase

### Limitations

- More parameters
- Increased parameter correlation

---

## LE0 (Logistic-Exponential Without Lag)

### Equation

\[
V(t)
=
\frac{
A
\left(
1-e^{-kt}
\right)
}
{
1+\exp
\left[
\ln\left(\frac{1}{d}\right)-kt
\right]
}
\]

### Parameters

| Parameter | Description |
|------------|------------|
| A | Asymptotic gas production |
| k | Fractional rate constant |
| d | Shape parameter |

### Advantages

- Flexible shape
- No lag parameter required

### Limitations

- More complex than simple exponential models

---

## LEL (Logistic-Exponential With Lag)

### Equation

\[
V(t)
=
\frac{
A
\left(
1-e^{-k(t-\lambda)}
\right)
}
{
1+\exp
\left[
\ln\left(\frac{1}{d}\right)
-
k(t-\lambda)
\right]
}
\]

### Parameters

| Parameter | Description |
|------------|------------|
| A | Asymptotic gas production |
| k | Fractional rate constant |
| d | Shape parameter |
| \(\lambda\) | Lag time |

### Advantages

- Flexible shape
- Explicit lag phase

### Limitations

- Additional complexity may affect convergence

---

## Generalized Michaelis-Menten

### Equation

\[
V(t)
=
A
\frac{t^{c}}
{
t^{c}+K^{c}
}
\]

### Parameters

| Parameter | Description |
|------------|------------|
| A | Asymptotic gas production |
| K | Half-time parameter |
| c | Shape parameter |

### Advantages

- Flexible sigmoidal behavior
- Strong biological interpretation
- Widely applicable across fermentation studies

### Limitations

- Shape parameter may be difficult to interpret biologically

---

## Groot

### Equation

\[
V(t)
=
\frac{VF}
{
1+\left(\frac{b}{t}\right)^k
}
\]

### Parameters

| Parameter | Description |
|------------|------------|
| VF | Asymptotic gas production |
| b | Half-time parameter |
| k | Shape parameter |

### Advantages

- Excellent flexibility
- Widely used in rumen gas production studies

### Limitations

- Requires positive incubation times

---

## Burr XII

### Equation

\[
V(t)
=
VF
\left[
1
-
\left(
1+(rt)^a
\right)^{-p}
\right]
\]

### Parameters

| Parameter | Description |
|------------|------------|
| VF | Asymptotic gas production |
| r | Rate parameter |
| a | Shape parameter |
| p | Shape parameter |

### Parameter Constraints

\[
a > 1
\]

\[
p > 0
\]

### Interpretation

The Burr XII model is a highly flexible sigmoidal
model capable of describing a broad range of
fermentation profiles.

The parameter \(r\) controls gas-production rate,
while \(a\) and \(p\) jointly influence curve shape,
asymmetry, and inflection behavior.

### Advantages

- Highly flexible curve shape
- Accommodates diverse fermentation profiles
- Often provides excellent goodness of fit
- Useful for broad model comparison studies

### Limitations

- More parameters than simpler models
- Greater risk of overfitting
- Parameter interpretation may be less intuitive

### Typical Applications

- Diverse feed datasets
- Comparative model-selection studies
- Sigmoidal fermentation profiles

### Literature Context

Recent comparative studies have identified
Burr XII among the strongest-performing
models across diverse feed categories when
evaluated using information-criterion-based
selection methods.

---

## Inverse Paralogistic

### Equation

\[
V(t)
=
VF
\left[
1
+
(rt)^{-a}
\right]^{-a}
\]

### Parameters

| Parameter | Description |
|------------|------------|
| VF | Asymptotic gas production |
| r | Rate parameter |
| a | Shape parameter |

### Parameter Constraints

\[
a > 1
\]

### Interpretation

The Inverse Paralogistic model is a flexible
sigmoidal model capable of describing a wide
range of cumulative gas-production curves.

The parameter \(r\) controls production speed,
while \(a\) controls curve shape and steepness.

### Advantages

- Flexible sigmoidal behavior
- Relatively simple parameterization
- Performs well across diverse gas-production datasets

### Limitations

- Less common in rumen literature
- Shape parameter can be difficult to interpret biologically
- Requires strictly positive incubation times

### Typical Applications

- Flexible nonlinear gas-production modeling
- Comparative model-selection studies
- Curves exhibiting sigmoidal behavior

### Literature Context

Recent comparative studies have identified
Inverse Paralogistic among the strongest-performing
models across diverse feed categories.

---

# Multi-Pool Models

## Dual Logistic

### Equation

\[
V(t)
=
\frac{V_{1F}}
{
1+\exp
\left[
2-4k_1(t-\lambda)
\right]
}
+
\frac{V_{2F}}
{
1+\exp
\left[
2-4k_2(t-\lambda)
\right]
}
\]

### Parameters

| Parameter | Description |
|------------|------------|
| \(V_{1F}\) | Gas volume from rapidly fermentable fraction |
| \(V_{2F}\) | Gas volume from slowly fermentable fraction |
| \(k_1\) | Rate constant of rapid fraction |
| \(k_2\) | Rate constant of slow fraction |
| \(\lambda\) | Lag time |

### Advantages

- Represents multiple fermentation pools
- Biologically meaningful decomposition

### Limitations

- More parameters
- Greater convergence challenges

---

# Model Equivalence

## Groot, Generalized Michaelis-Menten, and Log-logistic

Several gas-production models commonly used in
rumen fermentation research and nonlinear modeling
are mathematically equivalent.

### Groot

\[
V(t)
=
\frac{VF}
{
1+\left(\frac{b}{t}\right)^k
}
\]

### Generalized Michaelis-Menten

\[
V(t)
=
A
\frac{t^{c}}
{
t^{c}+K^{c}
}
\]

### Log-logistic

\[
V(t)
=
VF
\frac{(rt)^a}
{
1+(rt)^a
}
\]

The Log-logistic formulation can be rewritten as:

\[
V(t)
=
VF
\frac{t^a}
{
t^a+(1/r)^a
}
\]

which is identical to the generalized
Michaelis-Menten formulation.

### Parameter Correspondence

| Groot | Generalized Michaelis-Menten | Log-logistic |
|---------|---------|---------|
| VF | A | VF |
| b | K | 1/r |
| k | c | a |

Therefore:

\[
\text{Groot}
\equiv
\text{Generalized Michaelis-Menten}
\equiv
\text{Log-logistic}
\]

These formulations produce identical:

- Fitted values
- Residuals
- RSS
- RMSE
- R-squared
- AIC
- BIC

when equivalent parameter transformations are used.

Researchers may therefore choose the
parameterization most commonly used within
their field while obtaining identical fitted
curves.

For this reason, rumenGP does not currently
implement a separate Log-logistic fitting
routine. The Log-logistic formulation is
already represented through the existing
Groot and generalized Michaelis-Menten
parameterizations.

---

# Choosing a Model

A practical progression is:

## Simple Models

- EXP0
- Brody
- Ørskov and McDonald

Use when:

- Data show monotonic behavior
- Lag is negligible
- Simplicity is preferred

---

## Lag Models

- EXPL
- Logistic
- Gompertz
- Mitscherlich

Use when:

- A lag phase is biologically expected
- Initial microbial adaptation is important

---

## Flexible Sigmoidal Models

- LE0
- LEL
- Groot
- Generalized Michaelis-Menten
- Burr XII
- Inverse Paralogistic

Use when:

- Fermentation profiles display sigmoidal behavior
- Greater flexibility is needed
- Multiple biologically plausible models are being compared
- Information-criterion-based selection (AIC or BIC) is desired

---

## Multi-Pool Models

- Dual Logistic

Use when:

- Fast and slow fermenting fractions are expected
- Substrate heterogeneity is important

---

## Custom Models

Researchers can also define their own equations using:

```r
fit_custom()
```

See:

```r
vignette("custom-models")
```

for additional details.

---

# Model Selection Guidance

No single gas-production model should be
considered universally superior.

Model performance depends on:

- Feed type
- Experimental design
- Data quality
- Fermentation profile characteristics
- Model-selection criteria

A practical workflow is:

1. Fit several biologically plausible candidate models.
2. Verify convergence.
3. Examine fitted curves visually.
4. Examine residual patterns.
5. Compare RMSE.
6. Compare AIC and BIC.
7. Evaluate parameter plausibility.
8. Select the model most appropriate
