DSAMbayes Documentation

Documentation for DSAMbayes v1.2.2 — a Bayesian marketing mix modelling toolkit for R, built on Stan.

DSAMbayes provides a unified interface for building, fitting, and interpreting MMM models. It supports single-market regression (BLM), multi-market hierarchical models with partial pooling, and pooled models with structured media coefficients. All model types share the same post-fit interface for posterior extraction, diagnostics, decomposition, and budget optimisation.

Where to start

You want to… Start here
Install and run your first model Install and Setup → Your First BLM Model
Understand the modelling framework Concepts → Model Classes
Run a reproducible YAML-driven pipeline Quickstart → CLI Usage
Interpret run outputs and plots Plot Catalogue → Interpret Diagnostics
Configure priors, boundaries, or optimisation Config Schema
Compare models and select a candidate Compare Runs

What changed in v1.2.2

Key changes since v1.2.0 (see CHANGELOG.md for full details):

  • KPI back-transform correction — log-response models now default to the conditional-mean estimator exp(mu + sigma²/2) rather than the median exp(mu). Use log_response = "median" to retain the old behaviour. See Response Scale Semantics.
  • Composite hierarchy keys — hierarchical models now support composite grouping keys (e.g. market:brand).
  • Pooled lognormal_ms support — pooled models accept noise_sd ~ lognormal_ms(...) priors.
  • Strict pre-flight validation — runner-driven fits now abort on structural data-quality failures instead of warning silently.
  • Stan cache hardening — stale compiled models are recompiled automatically.