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

Updates all examples and existing docs to lates user interface

parent 87604fa0
No related branches found
No related tags found
No related merge requests found
...@@ -66,11 +66,11 @@ simply called `nsteps = [500, 1000]`). Finally, the simulation run for `500` ...@@ -66,11 +66,11 @@ simply called `nsteps = [500, 1000]`). Finally, the simulation run for `500`
steps of burn-in then `1000` steps of production to estimate the posterior. steps of burn-in then `1000` steps of production to estimate the posterior.
Passing all this to the MCMC search, we also need to give it a label and Passing all this to the MCMC search, we also need to give it a label and
directory to save the data and provide `sftlabel` and `sftdir` which defines directory to save the data and provide `sftfilepath`, a string matching
which data to use in the search the data to use in the search
``` ```
mcmc = MCMCSearch('fully_coherent', 'data', sftlabel='basic', sftdir='data', mcmc = MCMCSearch('fully_coherent', 'data', sftfilepath='data/*basic*sft',
theta_prior=theta_prior, tref=tref, tstart=tstart, tend=tend, theta_prior=theta_prior, tref=tref, tstart=tstart, tend=tend,
nsteps=nsteps, nwalkers=nwalkers, ntemps=ntemps, nsteps=nsteps, nwalkers=nwalkers, ntemps=ntemps,
scatter_val=1e-10) scatter_val=1e-10)
......
...@@ -47,11 +47,10 @@ nwalkers = 500 ...@@ -47,11 +47,10 @@ nwalkers = 500
nsteps = [100, 100, 100] nsteps = [100, 100, 100]
mcmc = MCMCSearch('fully_coherent_on_glitching_data', 'data', mcmc = MCMCSearch('fully_coherent_on_glitching_data', 'data',
sftlabel='glitch', sftdir='data', sftfilepath='data/*_glitch*.sft',
theta_prior=theta_prior, tref=tref, tstart=tstart, tend=tend, theta_prior=theta_prior, tref=tref, tstart=tstart, tend=tend,
nsteps=nsteps, nwalkers=nwalkers, ntemps=ntemps, betas=betas, nsteps=nsteps, nwalkers=nwalkers, ntemps=ntemps,
scatter_val=1e-6) log10temperature_min=log10temperature_min, scatter_val=1e-6)
mcmc.run() mcmc.run()
mcmc.plot_corner(add_prior=True) mcmc.plot_corner(add_prior=True)
``` ```
......
...@@ -9,7 +9,7 @@ tref = 362750407.0 ...@@ -9,7 +9,7 @@ tref = 362750407.0
tstart = 1000000000 tstart = 1000000000
duration = 100*86400 duration = 100*86400
tend = tstart = duration tend = tstart + duration
theta_prior = {'F0': {'type': 'norm', 'loc': F0, 'scale': abs(1e-6*F0)}, theta_prior = {'F0': {'type': 'norm', 'loc': F0, 'scale': abs(1e-6*F0)},
'F1': {'type': 'norm', 'loc': F1, 'scale': abs(1e-6*F1)}, 'F1': {'type': 'norm', 'loc': F1, 'scale': abs(1e-6*F1)},
...@@ -22,7 +22,7 @@ ntemps = 1 ...@@ -22,7 +22,7 @@ ntemps = 1
nwalkers = 100 nwalkers = 100
nsteps = [100, 500, 1000] nsteps = [100, 500, 1000]
mcmc = MCMCSearch('fully_coherent', 'data', sftlabel='basic', sftdir='data', mcmc = MCMCSearch('fully_coherent', 'data', sftfilepath='data/*basic*sft',
theta_prior=theta_prior, tref=tref, tstart=tstart, tend=tend, theta_prior=theta_prior, tref=tref, tstart=tstart, tend=tend,
nsteps=nsteps, nwalkers=nwalkers, ntemps=ntemps, nsteps=nsteps, nwalkers=nwalkers, ntemps=ntemps,
scatter_val=1e-10) scatter_val=1e-10)
......
...@@ -10,7 +10,7 @@ tref = 362750407.0 ...@@ -10,7 +10,7 @@ tref = 362750407.0
tstart = 1000000000 tstart = 1000000000
duration = 100*86400 duration = 100*86400
tend = tstart = duration tend = tstart + duration
theta_prior = {'F0': {'type': 'unif', 'lower': F0-5e-5, theta_prior = {'F0': {'type': 'unif', 'lower': F0-5e-5,
'upper': F0+5e-5}, 'upper': F0+5e-5},
...@@ -21,15 +21,15 @@ theta_prior = {'F0': {'type': 'unif', 'lower': F0-5e-5, ...@@ -21,15 +21,15 @@ theta_prior = {'F0': {'type': 'unif', 'lower': F0-5e-5,
} }
ntemps = 10 ntemps = 10
betas = np.logspace(0, -30, ntemps) log10temperature_min = -30
nwalkers = 500 nwalkers = 500
nsteps = [100, 100, 100] nsteps = [100, 100, 100]
mcmc = MCMCSearch('fully_coherent_on_glitching_data', 'data', mcmc = MCMCSearch('fully_coherent_on_glitching_data', 'data',
sftlabel='glitch', sftdir='data', sftfilepath='data/*_glitch*.sft',
theta_prior=theta_prior, tref=tref, tstart=tstart, tend=tend, theta_prior=theta_prior, tref=tref, tstart=tstart, tend=tend,
nsteps=nsteps, nwalkers=nwalkers, ntemps=ntemps, betas=betas, nsteps=nsteps, nwalkers=nwalkers, ntemps=ntemps,
scatter_val=1e-6) log10temperature_min=log10temperature_min, scatter_val=1e-6)
mcmc.run() mcmc.run()
mcmc.plot_corner(add_prior=True) mcmc.plot_corner(add_prior=True)
mcmc.print_summary() mcmc.print_summary()
...@@ -28,7 +28,7 @@ nwalkers = 500 ...@@ -28,7 +28,7 @@ nwalkers = 500
nsteps = [1000, 1000, 1000] nsteps = [1000, 1000, 1000]
mcmc = pyfstat.MCMCGlitchSearch( mcmc = pyfstat.MCMCGlitchSearch(
'semi_coherent_glitch_search', 'data', sftlabel='glitch', sftdir='data', 'semi_coherent_glitch_search', 'data', sftfilepath='data/*_glitch*sft',
theta_prior=theta_prior, tref=tref, tstart=tstart, tend=tend, theta_prior=theta_prior, tref=tref, tstart=tstart, tend=tend,
nsteps=nsteps, nwalkers=nwalkers, scatter_val=1e-10, nglitch=1) nsteps=nsteps, nwalkers=nwalkers, scatter_val=1e-10, nglitch=1)
......
...@@ -28,8 +28,8 @@ nwalkers = 100 ...@@ -28,8 +28,8 @@ nwalkers = 100
nsteps = [500, 500, 500] nsteps = [500, 500, 500]
mcmc = pyfstat.MCMCGlitchSearch( mcmc = pyfstat.MCMCGlitchSearch(
'semi_coherent_twoglitch_search', 'data', sftlabel='twoglitch', 'semi_coherent_twoglitch_search', 'data', sftfilepath='data/*twoglitch*sft',
sftdir='data', theta_prior=theta_prior, tref=tref, tstart=tstart, theta_prior=theta_prior, tref=tref, tstart=tstart,
tend=tend, nsteps=nsteps, nwalkers=nwalkers, scatter_val=1e-10, nglitch=2) tend=tend, nsteps=nsteps, nwalkers=nwalkers, scatter_val=1e-10, nglitch=2)
mcmc.run() mcmc.run()
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment