新しく開設された
Discord コミュニティに参加して、リアルタイムのディスカッション、ユーザー同士のサポート、メリディアン チームとの直接の交流をお楽しみください。
複数の分布族を組み合わせてカスタムの事前分布を設定
コレクションでコンテンツを整理
必要に応じて、コンテンツの保存と分類を行います。
メリディアンには、複数の分布族を 1 つの事前分布に結合できるカスタムの分布オブジェクト(prior_distribution.IndependentMultivariateDistribution
)が用意されています。たとえば LogNormal 分布を使用して、3 つのメディア チャネルの ROI 事前分布、および 4 つ目のチャネルの HalfNormal 事前分布を定義したい場合などです。
import tensorflow_probability as tfp
from meridian.model import prior_distribution
distributions = [
tfp.distributions.LogNormal([0.2, 0.2, 0.2], [0.9, 0.9, 0.9]),
tfp.distributions.HalfNormal(5),
]
roi_m_prior = prior_distribution.IndependentMultivariateDistribution(distributions)
prior = PriorDistribution(roi_m=roi_m_prior)
model_spec = ModelSpec(prior=prior)
meridian_model = Meridian(
input_data = # an `InputData` object
model_spec=model_spec,
)
IndependentMultivariateDistribution
は内部でテンソルを分割して子分布に委任するため、実行時間が若干長くなることがあります。IndependentMultivariateDistribution
を使用する前に、チャネル間でパラメータを変更して(同じ分布族内)機能するかどうか、または別の分布族を使用する方がよいかどうかを検討してください。
特に記載のない限り、このページのコンテンツはクリエイティブ・コモンズの表示 4.0 ライセンスにより使用許諾されます。コードサンプルは Apache 2.0 ライセンスにより使用許諾されます。詳しくは、Google Developers サイトのポリシーをご覧ください。Java は Oracle および関連会社の登録商標です。
最終更新日 2025-09-01 UTC。
[null,null,["最終更新日 2025-09-01 UTC。"],[],[],null,["Meridian offers a custom distribution object\n([`prior_distribution.IndependentMultivariateDistribution`](/meridian/reference/api/meridian/model/prior_distribution/IndependentMultivariateDistribution))\nthat lets you combine\ndistributions from multiple families into one prior distribution. For example,\nyou might want to use LogNormal distributions to define an ROI prior for three\nmedia channels and a HalfNormal prior for a fourth: \n\n import tensorflow_probability as tfp\n from meridian.model import prior_distribution\n\n distributions = [\n tfp.distributions.LogNormal([0.2, 0.2, 0.2], [0.9, 0.9, 0.9]),\n tfp.distributions.HalfNormal(5),\n ]\n\n roi_m_prior = prior_distribution.IndependentMultivariateDistribution(distributions)\n prior = PriorDistribution(roi_m=roi_m_prior)\n model_spec = ModelSpec(prior=prior)\n\n meridian_model = Meridian(\n input_data = # an `InputData` object\n model_spec=model_spec,\n )\n\nYou might see slightly longer runtimes because\n`IndependentMultivariateDistribution` splits and delegates tensors under the\nhood to its child distributions. Before you use\n`IndependentMultivariateDistribution`, consider if varying the parameters\nbetween channels, but within the same distribution family, would help, or if\nusing a different distribution family is better."]]