Set custom priors from a combination of distribution families

Meridian offers a custom distribution object (prior_distribution.IndependentMultivariateDistribution) that lets you combine distributions from multiple families into one prior distribution. For example, you might want to use LogNormal distributions to define an ROI prior for three media channels and a HalfNormal prior for a fourth:

import tensorflow_probability as tfp

distributions = [
  tfp.distributions.LogNormal([0.2, 0.2, 0.2], [0.9, 0.9, 0.9]),
  tfp.distributions.HalfNormal(5),
]

roi_m_prior = 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,
)

You might see slightly longer runtimes because IndependentMultivariateDistribution splits and delegates tensors under the hood to its child distributions. Before you use IndependentMultivariateDistribution, consider if varying the parameters between channels, but within the same distribution family, would help, or if using a different distribution family is better.