Add hyper-parameter likelihood
See #69 (closed)
Merge request reports
Activity
mentioned in issue #69 (closed)
added 1 commit
- c5b4e903 - Rewrite hyperparameter likelihood with logged priors
added 1 commit
- cef702bd - Add an example showing how to use the hyper parameter likelihood
This is a nice start. Can I recommend that we use the
DataFrame
from the initial inference, this will make it much easier to handle arbitrary posteriors and keep track of large numbers of parameters in the likelihood. It may seem like overkill in the very simple case here but havinghyper_prior = np.exp(- (posterior['mu'] - mu_m)**2 / (2 * sigma_m)) / (2 * np.pi * sigma_m**2)**0.5
will make it much simpler going forward.
added 17 commits
-
452f593b...a313d514 - 16 commits from branch
master
- fa9df0ba - Merge branch 'master' into adding-hyperparameter-likelihood
-
452f593b...a313d514 - 16 commits from branch
added 6 commits
-
79b52b78 - 1 commit from branch
master
- 468835a0 - Rename objects in the likelihood
- f065ba49 - Add lnprob for PowerLaw, Uniform, and Gaussian
- 0fa784e5 - Use the lnprob method in the HierarchicalLikelihood
- cb1b11af - Update example to work with changes in the HierarchicalLikelihood
- 35d9ddb9 - Merge branch 'master' into adding-hyperparameter-likelihood
Toggle commit list-
79b52b78 - 1 commit from branch
added 2 commits
added 109 commits
-
10ac7392...8d52c679 - 107 commits from branch
master
- bb5144f9 - Use either lnprobs or probs
- bc39b899 - Merge branch 'master' into adding-hyperparameter-likelihood
-
10ac7392...8d52c679 - 107 commits from branch
added 2 commits
This is now working and ready to be merged. It uses
tupak
priors rather than getting the user to write them out themselves. This is advantageous for most cases where we will use a well defined prior, but adds a little complexity if you want to do something non-standard (you have to define aPrior
).@colm.talbot , I like your idea to use the
posterior
, but we don't really need that now that it uses thePrior
There are thing that are a little ugly
-
We are forced to use the parameter names defined in the standard
Prior
classes (i.e.mu
andsigma
for a normal distribution). You can circumvent this by writing your ownPrior
class though. -
You have to pass the parameters into the likelihood in order to figure out which parameters to sample over (i.e
mu=None, sigma=None
). It's good as it is explicit, but notationwise looks a bit weird.
-
changed milestone to %0.2
assigned to @colm.talbot
It uses
tupak
priors rather than getting the user to write them out themselves. This is advantageous for most cases where we will use a well defined prior, but adds a little complexity if you want to do something non-standard (you have to define aPrior
).This is nice, I like that it makes that it's a prior ratio super explicit. It may require a little more sophistication in the interpolated priors, something with properties maybe, I'll have a think. I'm personally happy with building new
Prior
classes, it's similar to what I've been doing.I like your idea to use the
posterior
, but we don't really need that now that it uses thePrior
I'm not sure these are related. The
posterior
would take the place ofsamples
, although I guess there's nothing to stop individual users from doing this on their.You have to pass the parameters into the likelihood in order to figure out which parameters to sample over (i.e
mu=None, sigma=None
). It's good as it is explicit, but notationwise looks a bit weird.Can we not just pass a list of parameter names? Actually, this would probably work with a
Priors
class. Then you just check which names appear in both the new prior and the old prior and use that as your keys.added 12 commits
-
d3ea8b1d...eeb99606 - 11 commits from branch
master
- ef6e9286 - Merge branch 'master' into adding-hyperparameter-likelihood
-
d3ea8b1d...eeb99606 - 11 commits from branch
added 1 commit
- 20f0eb40 - Remove parameters argument from HLikelihood and set from hyper_prior