Hi,
I create a deterministic variable in my model, for which I want to display the distribution. Unfortunately, I don’t know how to access it. I tried this:
import numpy as np
import pymc3 as pm
import matplotlib.pyplot as plt
import theano.tensor as tt
import theano
with pm.Model() as model:
log_y=pm.Normal('log_y',0,sigma=1,shape=(M,1))
y=pm.Deterministic('y',np.exp(log_y))
_, ax=plt.subplots(1,1,figsize=(5,5))
y=np.linspace(0,5,100)
prior_y=np.exp(model.named_vars['y'].distribution.logp(x).eval())
ax[0].plot(y,prior_y )
ay=ax[0].get_ylim()
ax[0].set_ylim([0,ay[1]*1.05])
ax[0].set_xlabel('Y')
ax[0].set_title('Prior on Y')
I know that I could do that following the example in the api_quickstart notebook.
However, I would like to know if there is a way to do it using Determinitic
?
The reason behind that is that in my project, I have two variables that are transformed using \log and logit function, and I have a multivariate Gaussian prior on those transformed parameter. I would like to display the prior corresonding to the untransformed parameters.
Thanks!