Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bugfix draw_from_gwb_log_uniform_distribution #221

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 11 additions & 2 deletions enterprise_extensions/sampler.py
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,15 @@ def __init__(self, pta, snames=None, empirical_distr=None, f_stat_file=None, sav
self.ndim = sum(p.size or 1 for p in pta.params)
self.plist = [p.name for p in pta.params]

# parameter dictionary
self.params_dict = {}
for p in self.params:
if p.size:
for ii in range(0, p.size):
self.params_dict.update({p.name + "_{}".format(ii): p})
else:
self.params_dict.update({p.name: p})

# parameter map
self.pmap = {}
ct = 0
Expand Down Expand Up @@ -530,8 +539,8 @@ def draw_from_gwb_log_uniform_distribution(self, x, iter, beta):
# draw parameter from signal model
signal_name = [par for par in self.pnames
if ('gw' in par and 'log10_A' in par)][0]
idx = list(self.pnames).index(signal_name)
param = self.params[idx]

param = self.params_dict[signal_name]

q[self.pmap[str(param)]] = np.random.uniform(param.prior._defaults['pmin'], param.prior._defaults['pmax'])

Expand Down