新しく開設された
Discord コミュニティに参加して、リアルタイムのディスカッション、ユーザー同士のサポート、メリディアン チームとの直接の交流をお楽しみください。
ベイズ推定
コレクションでコンテンツを整理
必要に応じて、コンテンツの保存と分類を行います。
メリディアンが使用するベイズ回帰モデルは、データから学習したシグナルと事前の知識を結び付けて、メディア効果の推定と不確実性の定量化を行います。事前の知識は、事前分布を使用してモデルに取り込まれます。事前分布には、テストデータ、業界での経験、過去のメディア ミックス モデルを反映させることができます。
ベイズのマルコフ連鎖モンテカルロ(MCMC)サンプリング手法を使って、すべてのモデル係数とパラメータが同時に推定されます。これには、非線形メディア変換関数のパラメータ(Adstock や収穫逓減曲線など)も含まれます。ROI などの主なインサイトでは、点推定と信頼区間を計算する際に、すべてのパラメータとそれに対応する不確実性が考慮されます。
ベイズの定理
ベイズの定理は、観測可能なデータを使って観測不能なパラメータを推論する方法を示しています。この定理は、次の式で表せます。
$$
P(\theta|data)\ =\ \dfrac{
P(data|\theta)P(\theta)
}{
\int \! P(data|\theta)P(\theta) \, \mathrm{d}\theta
}
$$
ここで
- \(\theta\) は、注目すべき観測不能なパラメータ
- \(P(\theta|data)\) は事後分布(ベイズ方程式の出力)
- \(P(data|\theta)\) は尤度
- \(P(\theta)\) は事前分布
事後分布について推論を行うには、尤度と事前分布を指定する必要があります。
尤度、事前分布、事後分布
尤度はモデル仕様であり、モデルのパラメータ値が\(\theta\)だと仮定した場合のデータ値の確率を指定する分布です。ベイズ分析が実施された後、パラメータ \(\theta\)について推論と推定が行われます。尤度の複雑さはさまざまです。メリディアンの尤度は、階層的回帰モデルに基づきます。メリディアンの尤度について詳しくは、モデル仕様をご確認ください。
事前分布は、データが考慮される前のパラメータの確率分布に関する信念を表します。不確実性を定量化するベイズ的アプローチでは、事前知識を組み込む必要があります。メリディアンにおいて事前分布は、マーケティング チャネルの効果に関する信念(データが観測される前の信念)を表します。情報を含む事前分布は、 \(\theta\)の確実性の高さを表します。この信念を覆すには、大量のデータによる証拠が必要です。無情報の事前分布は、 \(\theta\) の値がほとんどわからないことを表すため、ほとんど影響を与えません。メリディアン モデルは、しっかりした根拠がある事前分布とデフォルト値を提供します。ROI を調整する場合などは、事前分布をカスタマイズできます。
事後分布は、 \(\theta\) が取り得るさまざまな値に対する信念(データが考慮された後の信念)の強さを表す分布です。事後分布は、ベイズの定理に即した事前分布、データ、尤度に基づきます。データに情報がほとんどない場合、事後分布は事前分布に向かって偏ります。データに大量の情報が含まれている場合、事後分布はデータに向かって偏ります。
メリディアン モデルは、推定されるすべての指標(ROI、mROI など)だけでなく、すべてのモデル パラメータの同時事後分布と応答曲線を生成します。事後分布は、観測されたデータに基づいて更新された、マーケティング チャネルの効果に関する信念を表します。
MCMC の収束
マルコフ連鎖モンテカルロ法(MCMC)を使用すると、事後分布のサンプリングが目標分布に向かって収束します。モデルの収束は、複数の MCMC チェーンを実行し、すべてのチェーンが同じ目標分布に到達することを確かめることで評価できます。
メリディアンは、MCMC の No U-Turn Sampler(NUTS)サンプリング手法を使用します。現在の値の分布が前の反復の値に依存する確率分布から、パラメータ値が抽出されます。それらの値がチェーンを形成しますが、その過程における毎回の反復で、すべてのモデル パラメータ値がセットで更新されます。収束を評価するため、複数のチェーンが独立して実行されます。収束に達したチェーンはそれぞれが、目標の事後分布のサンプルを表します。それらのチェーンを統合すると、事後推論に使用できます。
MCMC の収束を評価するには、R-hat 値を調べることが不可欠です。R-hat 値は、モデル出力の一部として提供されます。すべてのパラメータで、1.2 未満の R-hat を取得することをおすすめします。ただし、これは厳密な基準ではありません。R-hat 値が 1.2 よりわずかに大きい場合、通常はチェーンを長めに実行することで収束に至ります。R-hat 値がかなり大きい場合(2.0 以上など)は、チェーンを長めに実行することで収束が得られる可能性があります。ただし、計算時間とメモリの制約が厳しい場合は、収束を得るためにモデルを調整することが必要な場合があります。
特に記載のない限り、このページのコンテンツはクリエイティブ・コモンズの表示 4.0 ライセンスにより使用許諾されます。コードサンプルは Apache 2.0 ライセンスにより使用許諾されます。詳しくは、Google Developers サイトのポリシーをご覧ください。Java は Oracle および関連会社の登録商標です。
最終更新日 2025-08-05 UTC。
[null,null,["最終更新日 2025-08-05 UTC。"],[[["\u003cp\u003eMeridian employs a Bayesian regression model that integrates prior knowledge and data signals to estimate media effects and quantify uncertainty.\u003c/p\u003e\n"],["\u003cp\u003eBayesian Markov Chain Monte Carlo (MCMC) methods are utilized to estimate model parameters, including those of nonlinear media transformation functions, enabling calculation of point estimates and credible intervals for ROI.\u003c/p\u003e\n"],["\u003cp\u003eThe model incorporates prior distributions, likelihood, and posterior distributions, allowing for the integration of prior knowledge and updating of beliefs based on observed data.\u003c/p\u003e\n"],["\u003cp\u003eModel convergence is assessed using MCMC chains and R-hat values, ensuring the reliability and accuracy of the results.\u003c/p\u003e\n"]]],[],null,["# Bayesian inference\n\nMeridian uses a Bayesian regression model, which combines prior\nknowledge with signals learned from data to estimate media effects and quantify\nuncertainty. Prior knowledge is incorporated into the model using prior\ndistributions, which can be informed by experiment data, industry experience, or\nprevious media mix models.\n\nBayesian Markov Chain Monte Carlo (MCMC) sampling methods are used to jointly\nestimate all model coefficients and parameters. This includes parameters of the\nnonlinear media transformation functions, such as Adstock and diminishing\nreturns curves. All parameters and corresponding uncertainty are taken into\nconsideration when calculating point estimates and credible intervals for ROI\nand other key insights.\n\nBayes' theorem\n--------------\n\nBayes' theorem tells how you can use observable data to make inferences about\nunobservable parameters, which can be expressed as the following equation: \n$$ P(\\\\theta\\|data)\\\\ =\\\\ \\\\dfrac{ P(data\\|\\\\theta)P(\\\\theta) }{ \\\\int \\\\! P(data\\|\\\\theta)P(\\\\theta) \\\\, \\\\mathrm{d}\\\\theta } $$\n\nWhere:\n\n- \\\\(\\\\theta\\\\) is the unobservable parameter of interest\n- \\\\(P(\\\\theta\\|data)\\\\) is the posterior, and is the output of the Bayesian equation\n- \\\\(P(data\\|\\\\theta)\\\\) is the likelihood\n- \\\\(P(\\\\theta)\\\\) is the prior\n\nThe likelihood and prior must be specified to perform inference on the\nposterior.\n\nLikelihood, priors, and posteriors\n----------------------------------\n\nThe likelihood is the model specification. It is a distribution that specifies\nthe probability of the data values given the model's parameter values\n\\\\(\\\\theta\\\\). After the Bayesian analysis is performed, inferences and estimates\nare made on the parameters \\\\(\\\\theta\\\\). Likelihoods can have a wide range of\ncomplexity. Meridian's likelihood is based on a hierarchical regression\nmodel. For more information about Meridian likelihood, see [Model\nspecification](/meridian/docs/basics/model-spec).\n\nA prior represents the belief about the probability distribution of a parameter\nbefore data has been taken into account. Incorporating prior knowledge is\nrequired for the Bayesian approach of quantifying uncertainty. In\nMeridian, the prior distribution represents the beliefs about the\neffects of marketing channels before the data is seen. Informative priors\nexpress a high certainty in \\\\(\\\\theta\\\\), which requires a large amount of data\nevidence to overcome the belief. An uninformative prior is an expression of very\nlittle idea of what the value of \\\\(\\\\theta\\\\) is, and so the prior has little\ninfluence. The Meridian model provides well-reasoned [priors with\ndefault values](/meridian/docs/advanced-modeling/default-prior-distributions).\nYou can customize the priors, such as for ROI calibration.\n\nThe posterior is a distribution that represents the strength of the belief in\nthe different possible values of \\\\(\\\\theta\\\\) after the data has been taken into\naccount. The posterior is based on the prior, the data, and the likelihood\naccording to Bayes' Theorem. If there is little information in the data, the\nposterior is weighted more towards the priors. If there is extensive information\nin the data, the posterior is weighted more towards the data.\n\nThe Meridian model generates the joint posterior distribution for all\nmodel parameters, as well as every metric that is estimated, such as ROI, mROI,\nand response curves. The posterior distribution represents the updated beliefs\nabout the effects of marketing channels, given the observed data.\n\nMCMC convergence\n----------------\n\nUsing Markov Chain Monte Carlo (MCMC), the posterior sampling converges to a\ntarget distribution. Model convergence can be assessed by running multiple MCMC\nchains and checking that all chains reach the same target distribution.\n\nMeridian uses the MCMC [No U-Turn Sampler\n(NUTS)](https://www.tensorflow.org/probability/api_docs/python/tfp/experimental/mcmc/NoUTurnSampler)\nsampling method. Parameter values are drawn from a probability distribution\nwhere the distribution of the current value depends on the values of the\nprevious iteration. The values form a chain, where each iteration is a complete\nset of model parameter values. Multiple chains are run independently to assess\nconvergence. When convergence is reached, each chain represents a sample from\nthe target posterior distribution. The chains can then be merged for posterior\ninference.\n\nIt is critical that you examine R-hat values to assess MCMC convergence. These\nvalues are provided as part of the model output. We recommend obtaining an R-hat\nless than 1.2 for all parameters, although this is not a strict threshold. If\nR-hat values are slightly larger than 1.2, convergence is usually achievable by\nrunning longer chains. If R-hat values are much larger (such as 2.0 or greater),\nit might be possible to obtain convergence by running longer chains. However,\ncomputational time and memory constraints can be prohibitive, so it might be\nnecessary to adjust the model to obtain convergence."]]