You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Art Poon edited this page Jun 15, 2015
·
1 revision
Specifying prior distributions
kamphir uses the statistical distribution objects in SciPy.stats to specify prior distributions. The continuous distributions are all derived from a base object that takes two standard arguments, loc and scale. For example, a uniform distribution over (100, 200) can be specified as uniform(loc=100, scale=100). Specifically, this is the string that would be passed to the prior keyword in a kamphir settings JSON file. All distribution specifications become prefixed by scipy.stats in kamphir.
A good way to check a prior distribution is to compute the mean, standard deviation, and draw a number of random deviates in Python:
>>> from scipy.stats import uniform
>>> f = uniform(loc=100, scale=100)
>>> f.mean()
150.0
>>> f.std()
28.867513459481287
>>> [f.rvs() for i in range(10)]
[115.5179616986701, 191.5066287995557, 199.25118264899623, 187.45248482228178, 184.82615419309076, 154.14140984337394, 195.20574006635417, 190.9157583695232, 115.86909627658044, 188.8181812366821]
The random variates can then be passed into R to generate a histogram.