加入新推出的
Discord 社区,展开实时讨论,获得同行支持,并直接与 Meridian 团队互动!
默认先验形参化
使用集合让一切井井有条
根据您的偏好保存内容并对其进行分类。
Meridian 提供了多种方法来对每个处理变量对 KPI 产生的因果效应进行形参化。我们将每种可供选择的方法称为不同的“模型形参化”。在贝叶斯推理中,必须为模型的形参设置先验。因此,模型形参化决定了具体要为哪个形参设置先验。
可以为每种处理变量类型指定先验类型。ModelSpec
包含 media_prior_type
、rf_prior_type
、organic_media_prior_type
、organic_rf_prior_type
和 non_media_treatments_prior_type
实参,可让您指定是否要为投资回报率、边际投资回报率、贡献率或系数平均值设置先验。(投资回报率先验和边际投资回报率先验仅适用于付费媒体。)
PriorDistribution
对象针对每种处理变量类型和先验类型组合都有一个实参。对于每种处理变量类型,系统只会使用与所选先验类型对应的实参。其他实参会被忽略。例如,与非 R&F 付费媒体对应的实参为 roi_m
、mroi_m
、contribution_m
和 beta_m
。如果 media_prior_type
为 'roi'
,则使用 roi_m
,而忽略其他实参。
每种模型形参化都有不同的默认先验分布。下表汇总了每种模型形参化下的默认先验。
下表汇总了付费媒体对 KPI 的因果效应的模型形参化和默认先验。具体情况因 ModelSpec
中的 media_prior_type
和 rf_prior_type
实参而异。模型形参化和默认先验也取决于结果是否是收入。如果 KPI 是收入或者向 InputData
传递的是 revenue_per_kpi
,则结果是收入。如果 KPI 不是收入并且向 InputData
传递的不是 revenue_per_kpi
,则结果不是收入(“非收入”)。该表还包含一个列,用于指示 PriorDistribution
容器中用于自定义先验的相应形参。
模型类型 |
默认先验 |
media_prior_type/rf_prior_type |
结果 |
先验类型 |
PriorDistribution 中的形参 |
'roi' (默认) |
收入 |
投资回报率 |
roi_m 、roi_rf |
'roi' (默认) |
非收入 |
付费媒体总贡献率 |
roi_m 、roi_rf |
'mroi' |
收入 |
边际投资回报率 |
mroi_m 、mroi_rf |
'mroi' |
非收入 |
无默认值,必须设置自定义值 |
mroi_m 、mroi_rf |
'contribution' |
收入 |
贡献率 |
contribution_m 、contribution_rf |
'contribution' |
非收入 |
贡献率 |
contribution_m 、contribution_rf |
'coefficient' |
收入 |
系数 |
beta_m 、beta_rf |
'coefficient' |
非收入 |
系数 |
beta_m 、beta_rf |
默认先验分布中汇总了对于每种模型形参化用作默认先验的分布。
在上表中所列的每种情形中,应使用表中指明的相应 PriorDistribution
形参设置自定义先验。在设置自定义先验时,一定要了解您是为什么对象设置自定义先验。如需详细了解投资回报率、边际投资回报率和贡献率的定义,请参阅投资回报率、边际投资回报率和贡献率形参化。如需详细了解系数的定义,请参阅模型规范。如需详细了解付费媒体总贡献率先验,请参阅自定义付费媒体总贡献率先验。
自然媒体处理效应的默认先验由 organic_media_prior_type
和 organic_rf_prior_type
实参指定。选项包括 'contribution'
和 'coefficient'
,其中 'contribution'
是默认选项。如果使用贡献率先验,则会针对 contribution_om
和 contribution_orf
形参指定先验分布。如果使用系数先验,则会针对 beta_om
和 beta_orf
形参指定先验分布。
非媒体处理变量的处理效应默认先验由 non_media_treatments_prior_type
实参指定。选项包括 'contribution'
和 'coefficient'
,无论结果是否是收入,'contribution'
都是默认选项。如果使用贡献率先验,则会针对 contribution_n
形参指定先验分布。如果使用系数先验,则会针对 gamma_n
形参指定先验分布。
如未另行说明,那么本页面中的内容已根据知识共享署名 4.0 许可获得了许可,并且代码示例已根据 Apache 2.0 许可获得了许可。有关详情,请参阅 Google 开发者网站政策。Java 是 Oracle 和/或其关联公司的注册商标。
最后更新时间 (UTC):2025-08-17。
[null,null,["最后更新时间 (UTC):2025-08-17。"],[[["\u003cp\u003eMeridian allows for different model parameterizations to analyze the causal effect of treatment variables on the KPI, influencing the prior settings in Bayesian inference.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003epaid_media_prior_type\u003c/code\u003e argument in \u003ccode\u003eModelSpec\u003c/code\u003e determines whether the prior is set on ROI, mROI, or the coefficient (\u003ccode\u003ebeta_m\u003c/code\u003e), impacting the active parameters in \u003ccode\u003ePriorDistribution\u003c/code\u003e.\u003c/p\u003e\n"],["\u003cp\u003eDefault priors for paid media's causal effect vary based on the \u003ccode\u003epaid_media_prior_type\u003c/code\u003e and whether the outcome is in terms of revenue or not, while specific \u003ccode\u003ePriorDistribution\u003c/code\u003e parameters (\u003ccode\u003eroi_m\u003c/code\u003e, \u003ccode\u003emroi_m\u003c/code\u003e, \u003ccode\u003ebeta_m\u003c/code\u003e, etc.) allow customization.\u003c/p\u003e\n"],["\u003cp\u003eOrganic media and non-media treatment prior parameters (\u003ccode\u003ebeta_om\u003c/code\u003e, \u003ccode\u003ebeta_orf\u003c/code\u003e, and \u003ccode\u003egamma_n\u003c/code\u003e) are independent of the \u003ccode\u003epaid_media_prior_type\u003c/code\u003e setting and the revenue status of the KPI.\u003c/p\u003e\n"],["\u003cp\u003eThe table indicates the relationship between the \u003ccode\u003epaid_media_prior_type\u003c/code\u003e, the type of outcome, the Prior Type, and the corresponding parameter that must be customized in \u003ccode\u003ePriorDistribution\u003c/code\u003e.\u003c/p\u003e\n"]]],["Meridian allows setting priors for causal effects using `ModelSpec`'s `paid_media_prior_type`, choosing between ROI, mROI, or coefficient (beta_m). The `PriorDistribution` object defines these priors via `roi_m`, `mroi_m`, `beta_m` (for paid media), or `beta_om`/`beta_orf`(organic) or `gamma_n` (non-media). Default priors depend on `paid_media_prior_type` and whether the outcome is revenue-based, for example, 'roi' type for revenue default to ROI. Users can set custom priors with the corresponding parameters in `PriorDistribution`.\n"],null,["# Default prior parameterizations\n\nMeridian offers multiple ways to parameterize the causal effect of each\ntreatment variable on the KPI. We refer to each option as different\n*model parameterizations*. In Bayesian inference, a prior must be set on the\nparameters of the model. So the model parameterization determines what precisely\none is setting a prior on.\n\nThe prior type can be specified for each treatment type. The\n[`ModelSpec`](/meridian/reference/api/meridian/model/spec/ModelSpec) contains\narguments `media_prior_type`, `rf_prior_type`, `organic_media_prior_type`,\n`organic_rf_prior_type`, and `non_media_treatments_prior_type`, which allow\nyou to specify whether a prior is placed on ROI, mROI, contribution, or the\ncoefficient mean. (ROI and mROI priors are only available for paid media.)\n\nThe\n[`PriorDistribution`](/meridian/reference/api/meridian/model/prior_distribution/PriorDistribution)\nobject has an argument for each combination of treatment type and prior type.\nFor each treatment type, only the argument corresponding to the selected prior\ntype is used. The others are ignored. For example, the arguments corresponding\nto non-R\\&F paid media are `roi_m`, `mroi_m`, `contribution_m`, and `beta_m`. If\n`media_prior_type` is `'roi'`, then `roi_m` is used and the others are ignored.\n\nEach model parameterization has a different default prior distribution. The\nfollowing tables summarize the default priors under each model parameterization.\n\nPaid media\n----------\n\nThe following table summarizes the model parameterization and default priors for\nthe causal effect of paid media on the KPI. These vary based on the\n`media_prior_type` and `rf_prior_type` arguments in `ModelSpec`. The model\nparameterization and default priors also depend on whether\n[outcome](/meridian/docs/basics/glossary) is revenue. Outcome is revenue when\neither the KPI is revenue or when `revenue_per_kpi` is passed to `InputData`.\nOutcome is not revenue (\"non-revenue\") when the KPI is not revenue and\n`revenue_per_kpi` is not passed to `InputData`. The table also includes a column\nindicating the corresponding parameter in the `PriorDistribution` container that\nallows one to customize the prior.\n\n| Model Type || Default Prior ||\n| `media_prior_type/rf_prior_type` | Outcome | Prior Type | Parameter in `PriorDistribution` |\n|----------------------------------|-------------|-------------------------------|-------------------------------------|\n| `'roi'` (default) | Revenue | ROI | `roi_m`, `roi_rf` |\n| `'roi'` (default) | Non-revenue | Total paid media contribution | `roi_m`, `roi_rf` |\n| `'mroi'` | Revenue | mROI | `mroi_m`, `mroi_rf` |\n| `'mroi'` | Non-revenue | No default, must set custom | `mroi_m`, `mroi_rf` |\n| `'contribution'` | Revenue | Contribution | `contribution_m`, `contribution_rf` |\n| `'contribution'` | Non-revenue | Contribution | `contribution_m`, `contribution_rf` |\n| `'coefficient'` | Revenue | Coefficient | `beta_m`, `beta_rf` |\n| `'coefficient'` | Non-revenue | Coefficient | `beta_m`, `beta_rf` |\n\nThe distribution used as the default prior for each model parameterization is\nsummarized in\n[Default prior distributions](/meridian/docs/advanced-modeling/default-prior-distributions).\n\nUnder each scenario listed in the table, set a custom prior using the\nappropriate `PriorDistribution` parameter indicated in the table. When setting a\ncustom prior, it's important to understand what you are setting a custom prior\non. For more on the definition of ROI, mROI, and Contribution see [ROI, mROI,\nand Contribution parameterizations](/meridian/docs/basics/roi-mroi-contribution-parameterizations).\nFor more on the definition of a coefficient, see the [model\nspecification](/meridian/docs/basics/model-spec). For more on the total paid\nmedia contribution prior, see [Custom total paid media contribution\nprior](/meridian/docs/advanced-modeling/unknown-revenue-kpi-default#default-total-paid-media-contribution-prior).\n\nOrganic media\n-------------\n\nThe default prior for treatment effects of organic media is specified by the\n`organic_media_prior_type` and `organic_rf_prior_type` arguments. The options\nare `'contribution'` and `'coefficient'`, with `'contribution'` being the\ndefault. If contribution priors are used, then a prior distribution is specified\non the\n[`contribution_om` and `contribution_orf`](/meridian/docs/advanced-modeling/default-prior-distributions#contribution_m_contribution_rf_contribution_om_and_contribution_orf)\nparameters. If coefficient priors are used, then a prior distribution is\nspecified on the\n[`beta_om` and `beta_orf`](/meridian/docs/advanced-modeling/default-prior-distributions#beta_m_beta_rf_beta_om_and_beta_orf)\nparameters.\n\nNon-media treatments\n--------------------\n\nThe default prior for treatment effects of non-media_treatments is specified by\nthe `non_media_treatments_prior_type` argument. The options are `'contribution'`\nand `'coefficient'`, with `'contribution'` being the default regardless of\nwhether the outcome is revenue. If contribution priors are used, then a prior\ndistribution is specified on the\n[`contribution_n`](/meridian/docs/advanced-modeling/default-prior-distributions#contribution_n)\nparameter. If coefficient priors are used, then a prior distribution is\nspecified on the\n[`gamma_n`](/meridian/docs/advanced-modeling/default-prior-distributions#gamma_c_and_gamma_n)\nparameter."]]