A computational framework for Bayesian parameter estimation in lipid monolayer compression isotherms, providing robust alternatives to classical Langmuir trough analysis.
This repository implements a Bayesian nonlinear regression model to estimate thermodynamic parameters from Langmuir monolayer compression isotherms. The methodology addresses key limitations of classical point-based analysis by leveraging complete experimental datasets and providing comprehensive uncertainty quantification.
Traditional analysis of Langmuir isotherms relies on single point at maximum compression to estimate molecular surface area (A_mol). This approach discards most experimental data and provides no inherent uncertainty quantification. The Bayesian implementation uses the complete compression trajectory to simultaneously estimate A_mol and maximum surface pressure (π_max), while naturally propagating experimental uncertainty through posterior distributions.
- Probability model specifying likelihood and priors
- Hamiltonian Monte Carlo sampling via Stan for posterior inference
- Comparison against classical point-estimate method
- Utilization of complete experimental data rather than single-point extrapolation
- Natural uncertainty quantification through posterior distributions
- Propagation of measurement error through the statistical model
- Ability to incorporate prior knowledge from related experimental systems
The compression isotherm data used in this analysis were collected through experimental work conducted at the University of Sofia, Faculty of Biology. The measurements were performed by myself and my colleagues The detailed experimental protocols, including Langmuir trough instrumentation specifications, sample preparation methods, and measurement procedures, are documented in our laboratory records. Unfortunately, this comprehensive documentation is currently available only in Bulgarian.
The analysis implements a reproducible workflow using the targets package:
- Data preprocessing and quality control of raw compression isotherms
- Classical Langmuir analysis for benchmark comparisons
- Prior Simulations for priors quality and logic
- Bayesian model specification and prior predictive checks
- Posterior sampling and convergence diagnostics
- Results insights and comparative visualization
The Bayesian model assumes that the observed surface pressure measurements are normally distributed around the theoretical value given by the Langmuir equation:
where
In this equation:
-
$\pi_{\max}$ is the maximum surface pressure the system reaches at saturation -
$A_{\text{mol}}$ is the characteristic molecular area, describing the degree of surface coverage -
$\sigma$ denotes the standard deviation of the measurement error
Within the Bayesian framework, the parameters
where
The following weakly informative prior distributions were selected for the model:
$\pi_{\max} \sim \text{Normal}(50, 20)$ $A_{\text{mol}} \sim \text{Normal}(10, 5)$ $\sigma \sim \text{Exponential}(1)$
These priors encode the assumptions that the maximum surface pressure is centered around 50 mN/m with substantial uncertainty, the characteristic molecular area is around 10 Ų, and the measurement standard deviation is positive and likely small.
The complete model can be equivalently expressed as:
This section extends the classical Bayesian Langmuir model to a hierarchical framework, allowing the estimation of molecular surface area (Aₘₒₗ) and maximum surface pressure (πₘₐₓ) across multiple independent experimental replicates.
Such a model captures both within-experiment variability (measurement noise) and between-experiment variability (differences in system behavior across replicates).
For each measurement i within experiment j:
The expected value of surface pressure is modeled through the Langmuir equation:
where:
-
$\pi_{ij}$ — measured surface pressure (mN/m) -
$A_{ij}$ — molecular area (Ų) at measurement i -
$\pi_{\max, j}$ — maximum achievable surface pressure for experiment j -
$A_{\text{mol}, j}$ — molecular surface area estimated for experiment j -
$\sigma$ — measurement error (shared across all experiments)
The experiment-level parameters are assumed to arise from population-level (hyper)distributions:
where:
-
$\pi_{\max, \text{pop}}$ and$A_{\text{mol}, \text{pop}}$ are global mean parameters representing the overall system tendency. -
$\tau_{\pi}$ and$\tau_{A}$ capture between-experiment variability (population-level standard deviations).
Weakly informative priors are chosen for stability and interpretability:
This hierarchical Bayesian formulation enables:
- Estimation of individual experiment parameters while borrowing strength across replicates
- Quantification of uncertainty at both experiment and population levels
- Improved robustness compared to fitting each curve independently
Such structure is particularly valuable when the experimental conditions are nominally identical but exhibit biological or instrumental variability.
- R (≥ 4.1.0)
- Stan computational framework
- Key R packages:
targets,cmdstanr,posterior,tidyverse,brms,bayesplot
# Execute complete analysis pipeline
tar_make()