DSAMbayes Documentation

Documentation for DSAMbayes v1.2.3 — 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

Documentation sections

  • Getting Started — installation, environment setup, concepts, and first model tutorials
  • Runner — CLI usage, YAML config schema, and output artefacts
  • Modelling — model classes, priors, boundaries, diagnostics, and optimisation
  • Plots — catalogue of every plot the runner produces, with interpretation guidance
  • How-To Guides — task-oriented recipes for common workflows
  • FAQ — answers to common questions
  • Appendices — glossary, module index, and traceability map

What changed in v1.2.3

Key changes in this release (see CHANGELOG.md for full details):

  • Slim fitted objects — slim() can strip stored training data from fitted models and runner_result objects before serialisation while preserving posterior-based helpers.
  • Runner-result separation — run_from_yaml() now returns a dedicated runner_result container so runner metadata is no longer forced onto fitted model objects.
  • Safer validation flow — pre-flight checks now run before optional Stan compilation, which avoids wasting compile time on invalid model/data contracts.
  • More robust transform sensitivity — alternate scenarios rebuild through the shared runner model-prep path so CRE/runtime wiring is preserved.
  • Maintainability refactors — diagnostics, hierarchical posterior extraction, and budget-optimisation internals were split into focused modules with added regression coverage.

Author

Charles Shaw — charles.shaw@wppmedia.com