@@ -269,9 +269,17 @@ class Normal(Continuous):
269
269
mu : float
270
270
Mean.
271
271
sd : float
272
- Standard deviation (sd > 0).
272
+ Standard deviation (sd > 0) (only required if tau is not specified) .
273
273
tau : float
274
- Precision (tau > 0).
274
+ Precision (tau > 0) (only required if sd is not specified).
275
+
276
+ Examples
277
+ --------
278
+ with pm.Model():
279
+ x = pm.Normal('x', mu=0, sd=10)
280
+
281
+ with pm.Model():
282
+ x = pm.Normal('x', mu=0, tau=1/23)
275
283
"""
276
284
277
285
def __init__ (self , mu = 0 , sd = None , tau = None , ** kwargs ):
@@ -348,9 +356,17 @@ class HalfNormal(PositiveContinuous):
348
356
Parameters
349
357
----------
350
358
sd : float
351
- Standard deviation (sd > 0).
359
+ Standard deviation (sd > 0) (only required if tau is not specified) .
352
360
tau : float
353
- Precision (tau > 0).
361
+ Precision (tau > 0) (only required if sd is not specified).
362
+
363
+ Examples
364
+ --------
365
+ with pm.Model():
366
+ x = pm.HalfNormal('x', sd=10)
367
+
368
+ with pm.Model():
369
+ x = pm.HalfNormal('x', tau=1/15)
354
370
"""
355
371
356
372
def __init__ (self , sd = None , tau = None , * args , ** kwargs ):
@@ -838,8 +854,19 @@ class Lognormal(PositiveContinuous):
838
854
----------
839
855
mu : float
840
856
Location parameter.
857
+ sd : float
858
+ Standard deviation. (sd > 0). (only required if tau is not specified).
841
859
tau : float
842
- Scale parameter (tau > 0).
860
+ Scale parameter (tau > 0). (only required if sd is not specified).
861
+
862
+ Example
863
+ -------
864
+ # Example to show that we pass in only `sd` or `tau` but not both.
865
+ with pm.Model():
866
+ x = pm.Lognormal('x', mu=2, sd=30)
867
+
868
+ with pm.Model():
869
+ x = pm.Lognormal('x', mu=2, tau=1/100)
843
870
"""
844
871
845
872
def __init__ (self , mu = 0 , sd = None , tau = None , * args , ** kwargs ):
@@ -930,8 +957,18 @@ class StudentT(Continuous):
930
957
Degrees of freedom, also known as normality parameter (nu > 0).
931
958
mu : float
932
959
Location parameter.
960
+ sd : float
961
+ Standard deviation (sd > 0) (only required if lam is not specified)
933
962
lam : float
934
- Scale parameter (lam > 0).
963
+ Precision (lam > 0) (only required if sd is not specified)
964
+
965
+ Examples
966
+ --------
967
+ with pm.Model():
968
+ x = pm.StudentT('x', nu=15, mu=0, sd=10)
969
+
970
+ with pm.Model():
971
+ x = pm.StudentT('x', nu=15, mu=0, lam=1/23)
935
972
"""
936
973
937
974
def __init__ (self , nu , mu = 0 , lam = None , sd = None , * args , ** kwargs ):
@@ -1589,9 +1626,19 @@ class HalfStudentT(PositiveContinuous):
1589
1626
Degrees of freedom, also known as normality parameter (nu > 0).
1590
1627
sd : float
1591
1628
Scale parameter (sd > 0). Converges to the standard deviation as nu
1592
- increases
1629
+ increases. (only required if lam is not specified)
1593
1630
lam : float
1594
- Scale parameter (lam > 0). Converges to the precision as nu increases
1631
+ Scale parameter (lam > 0). Converges to the precision as nu
1632
+ increases. (only required if sd is not specified)
1633
+
1634
+ Examples
1635
+ --------
1636
+ # Only pass in one of lam or sd, but not both.
1637
+ with pm.Model():
1638
+ x = pm.HalfStudentT('x', sd=10, nu=10)
1639
+
1640
+ with pm.Model():
1641
+ x = pm.HalfStudentT('x', lam=4, nu=10)
1595
1642
"""
1596
1643
def __init__ (self , nu = 1 , sd = None , lam = None , * args , ** kwargs ):
1597
1644
super (HalfStudentT , self ).__init__ (* args , ** kwargs )
0 commit comments