Skip to content

Commit

Permalink
Merge pull request #200 from lea-hagen/likelihood_sampling
Browse files Browse the repository at this point in the history
updating the sparse likelihood sampling
  • Loading branch information
karllark authored Apr 28, 2018
2 parents a39057a + 40e5dfb commit 4cecfb2
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion beast/fitting/fit.py
Original file line number Diff line number Diff line change
Expand Up @@ -475,7 +475,10 @@ def Q_all_memory(prev_result, obs, sedgrid, ast, qnames_in, p=[16., 50., 84.],
# save the current set of lnps
if lnp_outname is not None:
if lnp_npts is not None:
rindx = np.random.choice(indx,size=lnp_npts,p=weights)
if lnp_npts < len(indx):
rindx = np.random.choice(indx, size=lnp_npts, replace=False)
if lnp_npts >= len(indx):
rindx = indx
else:
rindx = indx
save_lnp_vals.append([e,
Expand Down

0 comments on commit 4cecfb2

Please sign in to comment.