Skip to content
Snippets Groups Projects
Commit 6e0b510a authored by Gregory Ashton's avatar Gregory Ashton
Browse files

Renames log10temperature_min to log10beta_min

The variable name was misleading and hence renamed
parent 4e796984
Branches
Tags
No related merge requests found
......@@ -19,7 +19,7 @@ theta_prior = {'F0': {'type': 'unif', 'lower': F0*(1-1e-6), 'upper': F0*(1+1e-6)
}
ntemps = 20
log10temperature_min = -2
log10beta_min = -2
nwalkers = 100
nsteps = [500, 500]
......@@ -27,7 +27,7 @@ mcmc = MCMCSearch(label='computing_the_Bayes_factor', outdir='data',
sftfilepattern='data/*basic*sft', theta_prior=theta_prior,
tref=tref, tstart=tstart, tend=tend, nsteps=nsteps,
nwalkers=nwalkers, ntemps=ntemps,
log10temperature_min=log10temperature_min)
log10beta_min=log10beta_min)
mcmc.run()
mcmc.plot_corner(add_prior=True)
mcmc.print_summary()
......
......@@ -19,7 +19,7 @@ theta_prior = {'F0': {'type': 'unif', 'lower': F0*(1-1e-6), 'upper': F0*(1+1e-5)
}
ntemps = 1
log10temperature_min = -1
log10beta_min = -1
nwalkers = 100
run_setup = [(1000, 50), (1000, 25), (1000, 1, False),
((500, 500), 1, True)]
......@@ -28,7 +28,7 @@ mcmc = pyfstat.MCMCFollowUpSearch(
label='follow_up', outdir='data',
sftfilepattern='data/*basic*sft', theta_prior=theta_prior, tref=tref,
minStartTime=tstart, maxStartTime=tend, nwalkers=nwalkers,
ntemps=ntemps, log10temperature_min=log10temperature_min)
ntemps=ntemps, log10beta_min=log10beta_min)
mcmc.run(run_setup, gen_tex_table=True)
#mcmc.run(Nsegs0=50)
mcmc.plot_corner(add_prior=True)
......
......@@ -47,7 +47,7 @@ theta_prior = {'F0': {'type': 'unif',
}
ntemps = 1
log10temperature_min = -1
log10beta_min = -1
nwalkers = 100
nsteps = [1000, 1000]
......@@ -55,7 +55,7 @@ mcmc = pyfstat.MCMCSearch(
label='fully_coherent_search_using_MCMC', outdir='data',
sftfilepattern='data/*'+data_label+'*sft', theta_prior=theta_prior, tref=tref,
minStartTime=tstart, maxStartTime=tend, nsteps=nsteps, nwalkers=nwalkers,
ntemps=ntemps, log10temperature_min=log10temperature_min)
ntemps=ntemps, log10beta_min=log10beta_min)
mcmc.run(context='paper', subtractions=[30, -1e-10], c=2)
mcmc.plot_corner(add_prior=True)
mcmc.print_summary()
......@@ -21,7 +21,7 @@ theta_prior = {'F0': {'type': 'unif', 'lower': F0-1e-4, 'upper': F0+1e-4},
}
ntemps = 2
log10temperature_min = -0.01
log10beta_min = -0.01
nwalkers = 100
nsteps = [500, 500]
......@@ -29,7 +29,7 @@ mcmc = MCMCSearch('fully_coherent_search_using_MCMC_on_glitching_data', 'data',
sftfilepattern='data/*_glitch*.sft',
theta_prior=theta_prior, tref=tref, minStartTime=tstart, maxStartTime=tend,
nsteps=nsteps, nwalkers=nwalkers, ntemps=ntemps,
log10temperature_min=log10temperature_min)
log10beta_min=log10beta_min)
mcmc.run()
mcmc.plot_corner(add_prior=True)
mcmc.print_summary()
......@@ -47,7 +47,7 @@ theta_prior = {'F0': {'type': 'unif',
search = pyfstat.MCMCGlitchSearch(
label=label, outdir=outdir, sftfilepattern=sftfilepattern,
theta_prior=theta_prior, nglitch=1, tref=tref, nsteps=[500, 500],
ntemps=3, log10temperature_min=-0.5, minStartTime=tstart,
ntemps=3, log10beta_min=-0.5, minStartTime=tstart,
maxStartTime=tstart+Tspan)
search.run()
search.plot_corner(label_offset=0.8, add_prior=True)
......
......@@ -25,7 +25,7 @@ theta_prior = {'F0': {'type': 'norm', 'loc': F0, 'scale': abs(1e-6*F0)},
}
ntemps = 4
log10temperature_min = -1
log10beta_min = -1
nwalkers = 100
nsteps = [5000, 1000, 1000]
......@@ -34,7 +34,7 @@ mcmc = pyfstat.MCMCGlitchSearch(
sftfilepattern='data/*_glitch*sft', theta_prior=theta_prior, tref=tref,
tstart=tstart, tend=tend, nsteps=nsteps, nwalkers=nwalkers,
scatter_val=1e-10, nglitch=1, ntemps=ntemps,
log10temperature_min=log10temperature_min)
log10beta_min=log10beta_min)
mcmc.run()
mcmc.plot_corner(add_prior=True)
......
......@@ -19,7 +19,7 @@ theta_prior = {'F0': {'type': 'unif', 'lower': F0*(1-1e-6), 'upper': F0*(1+1e-5)
}
ntemps = 1
log10temperature_min = -1
log10beta_min = -1
nwalkers = 100
nsteps = [500, 500, 500]
......@@ -27,7 +27,7 @@ mcmc = pyfstat.MCMCSemiCoherentSearch(
label='semi_coherent_search_using_MCMC', outdir='data', nsegs=20,
sftfilepattern='data/*basic*sft', theta_prior=theta_prior, tref=tref,
minStartTime=tstart, maxStartTime=tend, nsteps=nsteps, nwalkers=nwalkers,
ntemps=ntemps, log10temperature_min=log10temperature_min)
ntemps=ntemps, log10beta_min=log10beta_min)
mcmc.run()
mcmc.plot_corner(add_prior=True)
mcmc.print_summary()
......@@ -34,7 +34,7 @@ theta_prior = {'F0': {'type': 'unif',
}
ntemps = 2
log10temperature_min = -1
log10beta_min = -1
nwalkers = 100
nsteps = [100, 100]
......@@ -43,7 +43,7 @@ mcmc = pyfstat.MCMCTransientSearch(
sftfilepattern='data/*simulated_transient_signal*sft',
theta_prior=theta_prior, tref=tref, minStartTime=minStartTime,
maxStartTime=maxStartTime, nsteps=nsteps, nwalkers=nwalkers, ntemps=ntemps,
log10temperature_min=log10temperature_min)
log10beta_min=log10beta_min)
mcmc.run()
mcmc.plot_corner(label_offset=0.7)
mcmc.print_summary()
......@@ -47,7 +47,7 @@ theta_prior = {'F0': {'type': 'unif',
}
ntemps = 1
log10temperature_min = -1
log10beta_min = -1
nwalkers = 100
nsteps = [50, 50]
......@@ -55,7 +55,7 @@ mcmc = pyfstat.MCMCSearch(
label='twoF_cumulative', outdir='data',
sftfilepattern='data/*'+data_label+'*sft', theta_prior=theta_prior, tref=tref,
minStartTime=tstart, maxStartTime=tend, nsteps=nsteps, nwalkers=nwalkers,
ntemps=ntemps, log10temperature_min=log10temperature_min)
ntemps=ntemps, log10beta_min=log10beta_min)
mcmc.run(context='paper', subtractions=[30, -1e-10])
mcmc.plot_corner(add_prior=True)
mcmc.print_summary()
......
......@@ -48,7 +48,7 @@ theta_prior = {'F0': {'type': 'unif', 'lower': F0-DeltaF0/2.,
}
ntemps = 3
log10temperature_min = -0.5
log10beta_min = -0.5
nwalkers = 100
scatter_val = 1e-10
nsteps = [100, 100]
......@@ -57,7 +57,7 @@ mcmc = pyfstat.MCMCFollowUpSearch(
label='weak_signal_follow_up', outdir='data',
sftfilepattern='data/*'+data_label+'*sft', theta_prior=theta_prior, tref=tref,
minStartTime=tstart, maxStartTime=tend, nwalkers=nwalkers, nsteps=nsteps,
ntemps=ntemps, log10temperature_min=log10temperature_min,
ntemps=ntemps, log10beta_min=log10beta_min,
scatter_val=scatter_val)
fig, axes = plt.subplots(nrows=2, ncols=2)
......
......@@ -48,9 +48,10 @@ class MCMCSearch(core.BaseSearchClass):
nwalkers, ntemps: int,
The number of walkers and temperates to use in the parallel
tempered PTSampler.
log10temperature_min float < 0
The log_10(tmin) value, the set of betas passed to PTSampler are
generated from `np.logspace(0, log10temperature_min, ntemps)`.
log10beta_min float < 0
The log_10(beta) value, if given the set of betas passed to PTSampler
are generated from `np.logspace(0, log10beta_min, ntemps)` (given
in descending order to emcee).
theta_initial: dict, array, (None)
A dictionary of distribution about which to distribute the
initial walkers about
......@@ -101,7 +102,7 @@ class MCMCSearch(core.BaseSearchClass):
def __init__(self, label, outdir, theta_prior, tref, minStartTime,
maxStartTime, sftfilepattern=None, detectors=None,
nsteps=[100, 100], nwalkers=100, ntemps=1,
log10temperature_min=-5, theta_initial=None,
log10beta_min=-5, theta_initial=None,
rhohatmax=1000, binary=False, BSGL=False,
SSBprec=None, minCoverFreq=None, maxCoverFreq=None,
injectSources=None, assumeSqrtSX=None):
......@@ -119,8 +120,8 @@ class MCMCSearch(core.BaseSearchClass):
self.pickle_path = '{}/{}_saved_data.p'.format(self.outdir, self.label)
self._unpack_input_theta()
self.ndim = len(self.theta_keys)
if self.log10temperature_min:
self.betas = np.logspace(0, self.log10temperature_min, self.ntemps)
if self.log10beta_min:
self.betas = np.logspace(0, self.log10beta_min, self.ntemps)
else:
self.betas = None
......@@ -138,8 +139,8 @@ class MCMCSearch(core.BaseSearchClass):
logging.info('nwalkers={}'.format(self.nwalkers))
logging.info('nsteps = {}'.format(self.nsteps))
logging.info('ntemps = {}'.format(self.ntemps))
logging.info('log10temperature_min = {}'.format(
self.log10temperature_min))
logging.info('log10beta_min = {}'.format(
self.log10beta_min))
def _initiate_search_object(self):
logging.info('Setting up search object')
......@@ -1163,7 +1164,7 @@ class MCMCSearch(core.BaseSearchClass):
d = dict(nsteps=self.nsteps, nwalkers=self.nwalkers,
ntemps=self.ntemps, theta_keys=self.theta_keys,
theta_prior=self.theta_prior,
log10temperature_min=self.log10temperature_min,
log10beta_min=self.log10beta_min,
BSGL=self.BSGL)
return d
......@@ -1571,7 +1572,7 @@ class MCMCGlitchSearch(MCMCSearch):
def __init__(self, label, outdir, theta_prior, tref, minStartTime,
maxStartTime, sftfilepattern=None, detectors=None,
nsteps=[100, 100], nwalkers=100, ntemps=1,
log10temperature_min=-5, theta_initial=None,
log10beta_min=-5, theta_initial=None,
rhohatmax=1000, binary=False, BSGL=False,
SSBprec=None, minCoverFreq=None, maxCoverFreq=None,
injectSources=None, assumeSqrtSX=None,
......@@ -1586,8 +1587,8 @@ class MCMCGlitchSearch(MCMCSearch):
self.pickle_path = '{}/{}_saved_data.p'.format(self.outdir, self.label)
self._unpack_input_theta()
self.ndim = len(self.theta_keys)
if self.log10temperature_min:
self.betas = np.logspace(0, self.log10temperature_min, self.ntemps)
if self.log10beta_min:
self.betas = np.logspace(0, self.log10beta_min, self.ntemps)
else:
self.betas = None
if args.clean and os.path.isfile(self.pickle_path):
......@@ -1702,7 +1703,7 @@ class MCMCGlitchSearch(MCMCSearch):
d = dict(nsteps=self.nsteps, nwalkers=self.nwalkers,
ntemps=self.ntemps, theta_keys=self.theta_keys,
theta_prior=self.theta_prior,
log10temperature_min=self.log10temperature_min,
log10beta_min=self.log10beta_min,
theta0_idx=self.theta0_idx, BSGL=self.BSGL)
return d
......@@ -1780,7 +1781,7 @@ class MCMCSemiCoherentSearch(MCMCSearch):
def __init__(self, label, outdir, theta_prior, tref, minStartTime,
maxStartTime, sftfilepattern=None, detectors=None,
nsteps=[100, 100], nwalkers=100, ntemps=1,
log10temperature_min=-5, theta_initial=None,
log10beta_min=-5, theta_initial=None,
rhohatmax=1000, binary=False, BSGL=False,
SSBprec=None, minCoverFreq=None, maxCoverFreq=None,
injectSources=None, assumeSqrtSX=None,
......@@ -1795,8 +1796,8 @@ class MCMCSemiCoherentSearch(MCMCSearch):
self.pickle_path = '{}/{}_saved_data.p'.format(self.outdir, self.label)
self._unpack_input_theta()
self.ndim = len(self.theta_keys)
if self.log10temperature_min:
self.betas = np.logspace(0, self.log10temperature_min, self.ntemps)
if self.log10beta_min:
self.betas = np.logspace(0, self.log10beta_min, self.ntemps)
else:
self.betas = None
if args.clean and os.path.isfile(self.pickle_path):
......@@ -1816,7 +1817,7 @@ class MCMCSemiCoherentSearch(MCMCSearch):
d = dict(nsteps=self.nsteps, nwalkers=self.nwalkers,
ntemps=self.ntemps, theta_keys=self.theta_keys,
theta_prior=self.theta_prior,
log10temperature_min=self.log10temperature_min,
log10beta_min=self.log10beta_min,
BSGL=self.BSGL, nsegs=self.nsegs)
return d
......@@ -1853,7 +1854,7 @@ class MCMCFollowUpSearch(MCMCSemiCoherentSearch):
def _get_data_dictionary_to_save(self):
d = dict(nwalkers=self.nwalkers, ntemps=self.ntemps,
theta_keys=self.theta_keys, theta_prior=self.theta_prior,
log10temperature_min=self.log10temperature_min,
log10beta_min=self.log10beta_min,
BSGL=self.BSGL, run_setup=self.run_setup)
return d
......
......@@ -227,7 +227,7 @@ class TestMCMCSearch(Test):
label=self.label, outdir=outdir, theta_prior=theta, tref=tref,
sftfilepattern='{}/*{}*sft'.format(Writer.outdir, Writer.label),
minStartTime=minStartTime, maxStartTime=maxStartTime,
nsteps=[100, 100], nwalkers=100, ntemps=2, log10temperature_min=-1)
nsteps=[100, 100], nwalkers=100, ntemps=2, log10beta_min=-1)
search.setup_burnin_convergence_testing()
search.run(create_plots=False)
_, FS = search.get_max_twoF()
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment