What is '@' for
fl
rxjwg98 at gmail.com
Fri Nov 13 18:04:20 EST 2015
Hi,
I read the following code snippet. A question is here about '@'.
I don't find the answer online yet.
What function is it here?
BTW, below is for printing out?
"""theta = logit^{-1}(a+b)"""
but I don't see it is printed when the following could have been called.
Are you sure it would be printed out?
Thanks,
.................
import pymc
import numpy as np
n = 5*np.ones(4,dtype=int)
x = np.array([-.86,-.3,-.05,.73])
alpha = pymc.Normal('alpha',mu=0,tau=.01)
beta = pymc.Normal('beta',mu=0,tau=.01)
@pymc.deterministic
def theta(a=alpha, b=beta):
"""theta = logit^{-1}(a+b)"""
return pymc.invlogit(a+b*x)
d = pymc.Binomial('d', n=n, p=theta, value=np.array([0.,1.,3.,5.]),\
observed=True)
More information about the Python-list
mailing list