Hello,
I’m unable to recover the parameters of a model whenever I have a non-unity exponent of a random variable. Following is the code
gamma = 5.
beta=np.sqrt(1-1/gamma**2)
angles = np.random.normal(np.pi/4,np.pi/6,100)
alpha=1.
delta = (1/gamma * 1/(1-beta*np.cos(angles)))**alpha + np.random.normal(0,0.1,100)
with pm.Model() as model:
BoundedNormal = pm.Bound(pm.Normal, lower=1.25)
gamma_prior=BoundedNormal('gama',3,5)
alpha_prior=pm.Uniform('alpha',0,2)
s=pm.Normal('noise',0,1)
beta_val=np.sqrt(1-1/gamma_prior**2)
obs_val=np.power(1/gamma_prior * 1/(1-beta_val*np.cos(angles)),alpha)
obs = pm.Normal('observation',mu=obs_val+s, observed=delta,testval=0.1)
trace = pm.sample(5000,return_inferencedata=True,tune=5000)
When I set alpha=1, I’m able to recover the parameters with high accuracy. However, when I set alpha to, for example, 0.4, all I get is a wide and flat posterior on gamma. Should I be using a different sampler? Please help me with this issue.
Thanks,
Karthik