This guide is a reference of the mathematical notation used
in Meridian.

It is designed to help you interpret and understand the equations that estimate
the causal impact of your [treatment variables](https://developers.google.com/meridian/docs/basics/glossary#treatment-variables),
and perform budget optimization.

> [!NOTE]
> **Note:** For new users, you don't need to start here immediately to get started with Meridian. This guide is intended to help you build deeper intuition with the core mathematical mechanics backing up Meridian.

## Table of contents

- [Base variables and input data](https://developers.google.com/meridian/docs/basics/math-notation#base-variables-and-input-data)
- [Data state and transformation notation](https://developers.google.com/meridian/docs/basics/math-notation#data-state-and-transformation-notation)
- [Index variables (subscripts)](https://developers.google.com/meridian/docs/basics/math-notation#index-variables-subscripts)
- [Model parameters](https://developers.google.com/meridian/docs/basics/math-notation#model-parameters)
- [Hyperparameters](https://developers.google.com/meridian/docs/basics/math-notation#hyperparameters)
- [Time-varying parameters](https://developers.google.com/meridian/docs/basics/math-notation#time-varying-parameters)
- [Model specification](https://developers.google.com/meridian/docs/basics/math-notation#model-specification)
- [Conditionals \& logic](https://developers.google.com/meridian/docs/basics/math-notation#conditionals-logic)
- [Causal \& optimization notation](https://developers.google.com/meridian/docs/basics/math-notation#causal-optimization-notation)

*** ** * ** ***

## Base variables and input data

These symbols represent the inputs used in Meridian's model equations,
representing fully scaled and transformed data. The letter indicates the
metric, and the bracketed superscript defines the specific *type* or *category*
of data.

> [!NOTE]
> **Note:** These variables can sometimes be annotated with double dots ($\\ddot{y}$) or daggers ($y\^\\dagger$) to indicate their state in the scaling pipeline. For details, see [Data state and transformation notation](https://developers.google.com/meridian/docs/basics/math-notation#data-state-and-transformation-notation).

| Symbol | Description |
|---|---|
| $y$ | **[KPI](https://developers.google.com/meridian/docs/basics/glossary#kpi)** : The response (target, dependent) variable of the model. It can be [revenue](https://developers.google.com/meridian/docs/basics/glossary#revenue), sales units, conversions, or anything else that the treatment variables may have a causal effect upon. |
| $z\^{\[C\]}$ | **[Control variables](https://developers.google.com/meridian/docs/basics/glossary#control-variables)**: Variables in the model that aren't treatment variables (for example, weather or price). These are used to estimate the baseline outcome. |
| $x\^{\[M\]}$ | **[Paid media variables](https://developers.google.com/meridian/docs/basics/glossary#paid-media-variables)** : The [media execution](https://developers.google.com/meridian/docs/basics/glossary#media-execution) level (for example, clicks or spend) for paid media channels. |
| $r\^{\[RF\]}$ | **Paid reach**: The number of unique individuals exposed to paid media. |
| $f\^{\[RF\]}$ | **Paid frequency**: The number of paid impressions per unique viewer. |
| $x\^{\[OM\]}$ | **[Organic media variables](https://developers.google.com/meridian/docs/basics/glossary#organic-media-variables)** : The [media execution](https://developers.google.com/meridian/docs/basics/glossary#media-execution) level (for example, newsletter opens) for organic media channels. |
| $r\^{\[ORF\]}$ | **Organic reach**: The number of unique individuals exposed to organic media. |
| $f\^{\[ORF\]}$ | **Organic frequency**: The number of organic impressions per unique viewer. |
| $x\^{\[N\]}$ | **[Non-media treatment variables](https://developers.google.com/meridian/docs/basics/glossary#non-media-treatment-variables)**: The execution level for non-media interventions (for example, promotions or pricing). |
| $p$ | **Population**: The population size of each geo, used to scale data so small and large regions are comparable. |
| $u$ | **Unit values** : Currency values used to convert raw units into spend for [ROI](https://developers.google.com/meridian/docs/basics/glossary#return-on-investment-roi) calculations. |

#### Related links

- [Input data](https://developers.google.com/meridian/docs/advanced-modeling/input-data): Defines the exact data structures and dimension requirements for base variables like $y$, $z\^{\[C\]}$, and $x\^{\[M\]}$.
- [Reach and frequency](https://developers.google.com/meridian/docs/advanced-modeling/reach-frequency): Explains how reach ($r\^{\[RF\]}$) and frequency ($f\^{\[RF\]}$) substitute for standard execution metrics to model saturation more accurately.
- [Organic media and non-media treatment variables](https://developers.google.com/meridian/docs/advanced-modeling/organic-and-non-media-variables): Details the differences between paid media, organic media ($x\^{\[OM\]}$), and non-media treatments ($x\^{\[N\]}$), including cost structures and variable behaviors.
- [Control variables](https://developers.google.com/meridian/docs/advanced-modeling/control-variables): Explains the causal rationale for selecting confounders ($z\^{\[C\]}$) to debias your estimates.

## Data state and transformation notation

In the Meridian framework, variables go through a transformation function before
entering the model. Special markers (like dots and daggers) indicate which
stage of the transformation the data is in.

| Symbol | Description | Example |
|---|---|---|
| $\\ddot{(\\cdot)}$ | **Raw input data (double-dot)**: The "as-is" data provided by the user before any scaling occurs. | $\\ddot{y}$ represents the raw [KPI](https://developers.google.com/meridian/docs/basics/glossary#kpi) count for a region. |
| $(\\cdot)\^\\dagger$ | **Population scaled (dagger)**: The intermediate data state. This is the raw data divided by the geo's population ($p_ {g}$). | $y\^\\dagger_ {g,t} = \\ddot{y}_ {g,t} / p_ {g}$ |
| $(\\cdot)$ | **Fully transformed variable** : The final transformed data used in the model equations. For a [KPI](https://developers.google.com/meridian/docs/basics/glossary#kpi), this is the dagger variable centered to mean zero and scaled to standard deviation one. | $y$ is the final sales value the model learns from. |
| $L(\\cdot)$ | **Transformation function** : The specific linear transformation function applied to convert the raw units into the fully scaled units. Specific details for each transformation performed in Meridian can be found in the [Input data](https://developers.google.com/meridian/docs/advanced-modeling/input-data) section. | $y = L\^{\[Y\]}(\\ddot{y})$ |

#### Related links

- [Input data](https://developers.google.com/meridian/docs/advanced-modeling/input-data): Contains the exact linear scaling functions $L(\\cdot)$ applied to each variable type to convert raw inputs into fully scaled units.
- [Model specification](https://developers.google.com/meridian/docs/advanced-modeling/model-spec): Shows how the fully scaled variables are ultimately used in the regression equation.

## Index variables (subscripts)

Indexes are the "coordinates" for data arrays, telling you exactly which slice
of data is being referenced. Meridian attaches subscripts to the base variables
to specify dimensions like geo and time (for example, $x\^{\[M\]}_ {g,t,i}$).

| Symbol | Description | Example |
|---|---|---|
| $g$ | **Geography:** Indexes specific geographical units ($1, \\dots, G$). | $g$ = New York or London. |
| $t$ | **Time:** Indexes specific time periods ($1, \\dots, T$). | $t$ = Week 10 of the time period used to train the MMM. |
| $i$ | **Variable index:** A universal index used to specify a particular channel or treatment within a category. | $i = 3$ refers to the 3rd [paid media](https://developers.google.com/meridian/docs/basics/glossary#paid-media-variables) channel. |
| $G$ | **Total geographies:** Total number of geographical units. | $G = 50$ for a US state-level model. |
| $T$ | **Total time periods:** Total number of time periods. | $T = 104$ for two years of weekly data. |
| $N_ {C}$ | **Total controls:** Total number of [control variables](https://developers.google.com/meridian/docs/basics/glossary#control-variables). | $N_ {C} = 3$ (for example, price, weather, holidays). |
| $N_ {M}$ | **Total paid media:** Total number of [paid media variables](https://developers.google.com/meridian/docs/basics/glossary#paid-media-variables) *without* R\&F. | $N_ {M} = 4$ (for example, TV, Radio, Print, Search). |
| $N_ {RF}$ | **Total paid R\&F:** Total number of [paid media variables](https://developers.google.com/meridian/docs/basics/glossary#paid-media-variables) *with* R\&F. | $N_ {RF} = 2$ (for example, Facebook, YouTube). |
| $N_ {OM}$ | **Total organic media:** Total number of [organic media variables](https://developers.google.com/meridian/docs/basics/glossary#organic-media-variables) *without* R\&F. | $N_ {OM} = 2$ (for example, SEO, Social posts). |
| $N_ {ORF}$ | **Total organic R\&F:** Total number of [organic media variables](https://developers.google.com/meridian/docs/basics/glossary#organic-media-variables) *with* R\&F. | $N_ {ORF} = 1$ (for example, Organic Newsletter). |
| $N_ {N}$ | **Total non-media treatments:** Total number of [non-media treatment variables](https://developers.google.com/meridian/docs/basics/glossary#non-media-treatment-variables). | $N_ {N} = 2$ (for example, in-store promotions, coupons). |

#### Related links

- [Geo-level modeling](https://developers.google.com/meridian/docs/pre-modeling/geo-selection-national-data): Discusses the statistical advantages of indexing data by geo ($g$) versus aggregating data nationally.
- [Holdout observations](https://developers.google.com/meridian/docs/advanced-modeling/holdout-observations): Shows how specific time ($t$) and geo ($g$) coordinates are excluded during model training to calculate out-of-sample fit.
- [National-level modeling](https://developers.google.com/meridian/docs/advanced-modeling/national-models): Details the parameter restrictions Meridian automatically applies when modeling a single geography ($G=1$).

## Model parameters

These are the "learned" parameters and coefficients (denoted by Greek letters)
that the model estimates from the data.

| Symbol | Description |
|---|---|
| $\\theta$ | **Theta:** General term for any unobservable parameter the model is estimating. |
| $\\tau_ {g}$ | **Tau (Geo intercepts):** Geo effects, which represent the average [KPI](https://developers.google.com/meridian/docs/basics/glossary#kpi) of each geo relative to the baseline geo. |
| $\\mu_ {t}$ | **Mu (Time-varying intercepts):** Time effects derived from the knot values. |
| $b_ {k}$ | **Knot parameter**: The estimated knot value at knot $k$. |
| $\\beta\^{\[M\]}_ {i}, \\beta\^{\[RF\]}_ {i},$ $\\beta\^{\[OM\]}_ {i}, \\beta\^{\[ORF\]}_ {i}$ | **Beta (Hierarchical media effects):** A parameter for the hierarchical distribution of geo-level media effects. When the media effects distribution is set to normal, it is the hierarchical mean. When set to log-normal, it is the hierarchical parameter for the mean of the underlying, log-transformed normal distribution. |
| $\\beta\^{\[M\]}_ {g,i}, \\beta\^{\[RF\]}_ {g,i},$ $\\beta\^{\[OM\]}_ {g,i}, \\beta\^{\[ORF\]}_ {g,i}$ | **Beta (Geo-level media effects):** The specific media effect coefficient for a channel $i$ within geo $g$, drawn from the hierarchical distribution. |
| $\\gamma\^{\[C\]}_ {i}, \\gamma\^{\[N\]}_ {i}$ | **Gamma (Hierarchical control mean):** The hierarchical mean of the coefficient on a [control](https://developers.google.com/meridian/docs/basics/glossary#control-variables) or [non-media channel](https://developers.google.com/meridian/docs/basics/glossary#non-media-treatment-variables). Hierarchy is defined over geos. |
| $\\sigma$ | **Sigma (Residual standard deviation):** The standard deviation of noise. |
| $\\eta$ | **Eta (Media hierarchical variance):** A parameter for the hierarchical distribution of geo-level media effects. When the media effects distribution is set to normal, it is the hierarchical standard deviation. When set to log-normal, it is the hierarchical parameter for the standard deviation of the underlying, log-transformed normal distribution. |
| $\\xi$ | **Xi (Control \& non-media hierarchical variance):** The hierarchical standard deviation of the coefficient on a [control](https://developers.google.com/meridian/docs/basics/glossary#control-variables) or [non-media channel](https://developers.google.com/meridian/docs/basics/glossary#non-media-treatment-variables). Hierarchy is defined over geos. |
| $\\alpha$ | **Alpha (Adstock decay rate):** A value between 0 and 1. |
| $\\mathtt{ec}$ | **Half-saturation:** The "saturation point" where you achieve 50% of the maximum possible sales lift. |
| $\\mathtt{slope}$ | **Slope:** Controls the shape of the [response curve](https://developers.google.com/meridian/docs/basics/glossary#response-curve). $slope\\leq1$ creates a strictly concave curve; $slope \> 1$ creates an "S-curve". |

> [!NOTE]
> **Note:** $\\epsilon_ {g,t}$ is the residual error (noise) in the data for a given geo and time period used in the [Model specification](https://developers.google.com/meridian/docs/advanced-modeling/model-spec), but it is not itself a learned parameter.

#### Related links

- [Model specification](https://developers.google.com/meridian/docs/advanced-modeling/model-spec): Provides the full regression equation showing how unobservable parameters like $\\beta$, $\\gamma$, and $\\tau$ interact to estimate the outcome.
- [Default prior distributions](https://developers.google.com/meridian/docs/advanced-modeling/default-prior-distributions): Lists the default statistical distributions and rationale assigned to learned parameters like $\\tau_g$, $\\beta_i$, and $\\sigma$.
- [Bayesian inference](https://developers.google.com/meridian/docs/causal-inference/bayesian-inference): Explains how MCMC sampling jointly estimates these unobservable parameters ($\\theta$) and their uncertainty from the observed data.

## Hyperparameters

These are fixed parameters set before the model is trained, acting as structural
inputs rather than learned coefficients.

| Symbol | Description |
|---|---|
| $L$ | **Maximum lag duration:** A fixed hyperparameter representing the maximum number of weeks an ad is assumed to affect sales. |
| $K$ | **Total knots**: The total number of knots used to model the time-varying time effect. |
| $s_ {k}$ | **Knot location**: The specific time period where the $k$-th knot is located. |

## Time-varying parameters

Meridian uses knots to model [time effects](https://developers.google.com/meridian/docs/basics/glossary#time-effects).
Rather than estimating a unique time effect for every single time period, the
model estimates values at specific anchor points (knots) and interpolates the
values for the periods in between.

These symbols represent the notation mechanics used to calculate that
interpolation.

| Symbol | Description |
|---|---|
| $b_ {k}$ | **Knot parameter**: The estimated knot value at knot $k$. |
| $\\ell(t)$ | **Lower knot index**: The index of the nearest preceding knot for a given time $t$. |
| $u(t)$ | **Upper knot index**: The index of the nearest succeeding knot for a given time $t$. |
| $w(t)$ | **Time weight**: The interpolation weight for time $t$, calculated based on its distance between the neighboring knot locations ($s_ {\\ell(t)}$ and $s_ {u(t)}$). |
| $\\mu_ {t}$ | **Time-varying intercept**: The resulting time effect for time $t$, calculated as the weighted average: $\\mu_ {t} = w(t)b_ {\\ell(t)} + (1-w(t))b_ {u(t)}$. |

#### Related links

- [Set knots](https://developers.google.com/meridian/docs/advanced-modeling/setting-knots): Explains how to select the total number of knots $K$ and balance the bias-variance trade-off for estimating time effects.
- [Model specification](https://developers.google.com/meridian/docs/advanced-modeling/model-spec): Details the exact distance-based weight calculation $w(t)$ used to interpolate $\\mu_t$ between adjacent knot locations.

## Model specification

For the full mathematical equation that combines these inputs and
parameters into the Meridian model, refer to the
[Model specification](https://developers.google.com/meridian/docs/advanced-modeling/model-spec) page.

## Conditionals \& logic

These symbols represent dependencies, mathematical logic, or statistical
relationships.

| Symbol | Description | Example |
|---|---|---|
| $\\mid$ | **The pipe**: Read as "Given that." Indicates conditional probability or expectation. | $P(\\theta \\mid data)$ means the probability of the parameters *given* the observed data. |
| $I_ {\\lbrace \\dots \\rbrace}$ | **Indicator function** : A logical switch. It equals **1** if the condition inside is `true`, and **0** otherwise. | $I_ {i}\^{\[C\]} = 1$ if population scaling is used for control variable $i$, and 0 otherwise. |
| $\\sim$ | **Tilde operator** : Read as "is distributed as." Links a parameter to its statistical prior distribution. *(Note: This operator is distinct from the tilde accent $\\overset \\sim Y$ used to denote potential outcomes).* | $\\gamma\^{\[C\]}_ {i} \\sim \\text{Normal}(0, 5)$ means the parameter follows a normal distribution with mean 0 and standard deviation 5. |
| $\\lbrace \\dots \\rbrace$ | **Braces**: Denotes a set, vector, or multi-dimensional array of variables. | ${x_ {g,t,i}}$ represents the entire array of observed media execution, and ${q_ {t-s}}\^L_ {s=0}$ represents a sequence over a time lag. |
| $\\forall$ | **For all**: The universal quantifier. It means the equation or condition applies to every value in a specific set. | $\\forall g,t$ means the condition applies to all geographic regions and all time periods. |

#### Related links

- [Input data](https://developers.google.com/meridian/docs/advanced-modeling/input-data): Uses set notation (${\\dots}$) to define the full arrays of control and treatment variables required for modeling.
- [Bayesian inference](https://developers.google.com/meridian/docs/causal-inference/bayesian-inference): Explains the conditional probability $P(\\theta \\mid data)$ at the heart of Meridian's MCMC sampling.
- [Required assumptions](https://developers.google.com/meridian/docs/causal-inference/required-assumptions): Details the conditional exchangeability assumption ($E(\\overset \\sim Y \\mid z)$) required to safely estimate causal effects.

## Causal inference \& budget optimization

These symbols are used to define counterfactual scenarios, generate response
curves, and calculate optimal budget allocations.

| Symbol | Description |
|---|---|
| $\\overset \\sim Y\^{(\\lbrace x\^{(1)} \\rbrace)}$ | **Potential outcome:** The hypothetical [outcome](https://developers.google.com/meridian/docs/basics/glossary#outcome) (e.g., sales) that *would* occur under a specific scenario. The tilde ($\\overset \\sim Y$) denotes it is a potential outcome, and the superscript ($\\lbrace x\^{(1)} \\rbrace$) denotes the specific media execution scenario being tested. |
| $x\^{(1)}, x\^{(0)}$ | **Counterfactual scenarios:** Used to compare different [media execution](https://developers.google.com/meridian/docs/basics/glossary#media-execution) realities. Typically, $x\^{(1)}$ represents historical execution, and $x\^{(0)}$ represents a baseline (e.g., zero spend on a specific channel). |
| $b_ {i}$ | **Budget:** The total budget allocated to a specific channel $i$ during budget optimization. |
| $\\omega$ | **Spend scaling factor:** A multiplier used to scale historical spend up or down. Used mathematically to generate response curves or calculate marginal ROI. |
| $f\^\*$ | **Target/optimal frequency:** The optimal average ad frequency solved for during reach and frequency optimization. |
| $(j)$ | **MCMC draw superscript:** Denotes a specific simulation "draw" (one of thousands of possible answers generated by the model) used to calculate the posterior mean of the expected outcome. |

#### Related links

- [Incremental Outcome, ROI, mROI \& Response Curves](https://developers.google.com/meridian/docs/post-modeling/roi-mroi-response-curves): Defines business metrics like ROI mathematically using potential outcomes ($\\overset \\sim Y$).
- [Estimating incremental outcome using regression](https://developers.google.com/meridian/docs/causal-inference/estimating-incremental-outcome): Shows the mathematical proof connecting expected outcomes ($\\hat{Y}$) to counterfactual scenario comparisons ($x\^{(1)}$ versus $x\^{(0)}$).
- [Optimization for media channels without reach and frequency data](https://developers.google.com/meridian/docs/post-modeling/optimization-without-reach-frequency): Details the objective function used to solve for optimal budget vectors $b_i$.
- [Optimization for media channels with reach and frequency data](https://developers.google.com/meridian/docs/post-modeling/optimization-with-reach-frequency): Extends budget optimization to include solving for target optimal frequencies ($f\^\*$).
- [ROI, mROI, and Contribution parameterizations](https://developers.google.com/meridian/docs/advanced-modeling/roi-mroi-contribution-parameterizations): Explains how prior distributions are mathematically parameterized using these exact business metrics.
- [Bayesian inference](https://developers.google.com/meridian/docs/causal-inference/bayesian-inference): Connects the model's simulated posterior draws ($(j)$) to the calculation of expected outcomes and uncertainty intervals.