Skip to content

Commit

Permalink
supply log prior functions to mcmc_lc, not pdfs
Browse files Browse the repository at this point in the history
  • Loading branch information
dannygoldstein committed Jul 14, 2016
1 parent afce4f3 commit 9ee53d5
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions sncosmo/fitting.py
Original file line number Diff line number Diff line change
Expand Up @@ -784,9 +784,9 @@ def mcmc_lc(data, model, vparam_names, bounds=None, priors=None,
the maximum bound is such that the earliest phase of the model
lines up with the latest data point.
priors : `dict`, optional
Prior probability functions. Keys are parameter names, values are
functions that return probability given the parameter value.
The default prior is a flat distribution.
Prior probability functions. Keys are parameter names, values
are functions that return the log probability given the
parameter value. The default prior is a flat distribution.
guess_amplitude : bool, optional
Whether or not to guess the amplitude from the data. If false, the
current model amplitude is taken as the initial value. Only has an
Expand Down Expand Up @@ -922,7 +922,7 @@ def lnprob(parameters):
logp = -0.5 * _chisq(data, model, modelcov=modelcov)

for i, func in idxpriors:
logp += math.log(func(parameters[i]))
logp += func(parameters[i])

return logp

Expand Down

0 comments on commit 9ee53d5

Please sign in to comment.