I am getting this warning:
\venv\lib\site-packages\pymc\pytensorf.py:1055: UserWarning: RNG Variable RandomGeneratorSharedVariable(<Generator(PCG64) at [...]>) has warnings.py:109 multiple clients. This is likely an inconsistent random graph.
I see in the code it has to do with some variable “clients” but I am unfamiliar with the internals of PyMC.
The model trains fine, so it doesn’t seem to be something which breaks the analysis.
What is an inconsistent graph? What are the consequences for an analysis if I have one? How do I ensure consistency?
It means you have a random state that is not updated across calls or is updated incorrectly. This would lead to wrong prior and posterior predictive sampling, but would likely not affect posterior sampling.
Can you share your model code? I imagine you have a CustomDist or a Scan in your model?
That definitely sounds like a substantial issue. I don’t have a CustomDist, and I am not explicitly using anything called Scan. Maybe seeing the model code will give you some ideas.
params = {}
coords = {"health_authority": data["HA"]}
with pm.Model(coords=coords) as model:
scanners = pm.Geometric("scanners", p=0.9, observed=data["count_scanners"])
params["β[fte|pop,scanners]"] = pm.Exponential("β[fte|pop,scanners]", lam=1)
fte = pm.Exponential(
"fte",
lam=1 / (params["β[fte|pop,scanners]"] * norm_lha_pop_size * scanners),
observed=data["current_fte"],
)
params["β[vol|pop]"] = pm.Exponential(
"β[vol|pop]", lam=1, dims="health_authority"
)
params["γ[vol|pop]"] = pm.Exponential(
"γ[vol|pop]", lam=1
)
params["β[vol]"] = pm.Exponential("β[vol]", lam=1)
volume = pm.Poisson(
"volume",
mu=np.abs((params["γ[vol|pop]"] + params["β[vol|pop]"]) * norm_lha_pop_size + params["β[vol]"]),
observed=data["annual_exam_volume"],
)
Only thing that comes to mind off the top of my head, although I don’t know how relevant it is, is that one of the health authorities in coords
has only a single observation. Maybe the slope will be poorly-identified.
Hmm, can you provide the smallest fully reproducible example that still yields the warning? Also can you confirm you are using the most recent version of PyMC?
I will look into what I can do to make a minimum reproducible example. I am using PyMC version 5.8.1.