needed_posterior_names#

pymc_marketing.pytensor_utils.needed_posterior_names(pymc_model, response_vars, frozen_deterministics=())[source]#

Return the posterior variables response_vars read.

The free RVs and the frozen deterministics are the blockers of the traversal: an extraction substitutes their posterior draws instead of traversing their subgraphs. The order is the graph traversal’s, so it is stable for a given response but says nothing about the posterior layout.

Parameters:
  • pymc_model (Model) – The model response_vars belong to.

  • response_vars (Sequence[Variable]) – The response graphs to traverse.

  • frozen_deterministics (Sequence[str]) – Deterministics held at their posterior values; a name the model does not have is ignored.

Return type:

list of str

Returns:

The names of the free RVs and frozen deterministics the responses depend on, each once.