Why do the deterministic variables in the following models have such high dimentionalities?
I’m modelling the correlation between two probabilities. Since the probabilities are bound between 0 and 1, I assume Beta distribution, and test whether the alpha
and beta
parameters of the distribution of y
depend on the value of x
.
This is what I do:
with pm.Model() as model:
a1 = pm.Normal(name='a1')
a2 = pm.Normal(name='a2')
b1 = pm.Normal(name='b1')
b2 = pm.Normal(name='b2')
alpha = pm.Deterministic('alpha', pm.math.invlogit(a1 * x + a2))
beta = pm.Deterministic('beta', pm.math.invlogit(b1 * x + b2))
y_hat = pm.Beta(name='est', alpha=alpha, beta=beta, observed=y)
train_trace = pm.sample()
pm.traceplot(train_trace)
When I plot the trace, I get a result that looks like this (this is a truncated version):
As we can see, the traces of the computed variables alpha
and beta
have very high dimensionality. Why is that? Is there a way to plot the distribution of alpha
and beta
as a single curve?