File tree Expand file tree Collapse file tree 1 file changed +12
-1
lines changed Expand file tree Collapse file tree 1 file changed +12
-1
lines changed Original file line number Diff line number Diff line change @@ -68,7 +68,7 @@ def logp(value):
68
68
return locals ()
69
69
70
70
@tensordist (continuous )
71
- def Normal (mu = 0.0 , tau = 1.0 ):
71
+ def Normal (mu = 0.0 , tau = None , sd = None ):
72
72
"""
73
73
Normal log-likelihood.
74
74
@@ -82,13 +82,24 @@ def Normal(mu=0.0, tau=1.0):
82
82
tau : float
83
83
Precision of the distribution, which corresponds to
84
84
:math:`1/\sigma^2` (tau > 0).
85
+ sd : float
86
+ Standard deviation of the distribution. Alternative parameterization.
85
87
86
88
.. note::
87
89
- :math:`E(X) = \mu`
88
90
- :math:`Var(X) = 1/\t au`
89
91
90
92
"""
91
93
94
+ if tau is None :
95
+ if sd is None :
96
+ tau = 1.
97
+ else :
98
+ tau = sd ** - 2
99
+ else :
100
+ if sd is not None :
101
+ raise ValueError ("Can't pass both tau and sd" )
102
+
92
103
def logp (value ):
93
104
94
105
return bound (
You can’t perform that action at this time.
0 commit comments