Commit 620b8f5a authored by Gregory Ashton's avatar Gregory Ashton
Browse files

Incomplete work on updating the docs for fc search on glitching data

parent 967e1f7d
...@@ -2,8 +2,8 @@ ...@@ -2,8 +2,8 @@
In this example, we will show the basics of setting up and running a MCMC In this example, we will show the basics of setting up and running a MCMC
search for a fully-coherent search. This is based on the example search for a fully-coherent search. This is based on the example
[fully_coherent_search.py](../example/fully_coherent_search.py). We will run [fully_coherent_search_using_MCMC.py](../example/fully_coherent_search_using_MCMC.py).
the search on the `basic` data generated in the We will run the search on the `basic` data generated in the
[make_fake_data](make_fake_data.md) example. [make_fake_data](make_fake_data.md) example.
First, we need to import the search tool, in this example we will use the First, we need to import the search tool, in this example we will use the
...@@ -83,7 +83,7 @@ mcmc.run() ...@@ -83,7 +83,7 @@ mcmc.run()
This produces two `.png` images. The first is the position of the *walkers* This produces two `.png` images. The first is the position of the *walkers*
during the simulation: during the simulation:
![](img/fully_coherent_using_MCMC_walkers.png) ![](img/fully_coherent_search_using_MCMC_walkers.png)
This shows (in red) the position of the walkers during the burn-in stage. They This shows (in red) the position of the walkers during the burn-in stage. They
are initially defuse (they start from positions randomly picked from the prior), are initially defuse (they start from positions randomly picked from the prior),
but eventually converge to a single stable solution. The black is the production but eventually converge to a single stable solution. The black is the production
...@@ -99,7 +99,7 @@ To get posteriors, we call ...@@ -99,7 +99,7 @@ To get posteriors, we call
mcmc.plot_corner() mcmc.plot_corner()
``` ```
which produces a corner plot which produces a corner plot
![](img/fully_coherent_using_MCMC_corner.png) ![](img/fully_coherent_search_using_MCMC_corner.png)
illustrating the tightly constrained posteriors on `F0` and `F1` and their illustrating the tightly constrained posteriors on `F0` and `F1` and their
covariance. Furthermore, one may wish to get a summary which can be printed covariance. Furthermore, one may wish to get a summary which can be printed
to the terminal via to the terminal via
......
# Fully coherent search on glitching data using MCMC # Fully coherent search on glitching data using MCMC
This example applies the basic [fully coherent This example applies the basic [fully coherent
search](fully_coherent_search.md), to the glitching signal data set created in search using MCMC](fully_coherent_search_using_MCMC.md), to the glitching signal data set created in
[make fake data](make_fake_data.md]). The aim here is to illustrate the effect [make fake data](make_fake_data.md]). The aim here is to illustrate the effect
such a signal can have on a fully-coherent search. The complete script for this such a signal can have on a fully-coherent search. The complete script for this
example canbe found example canbe found
......
from pyfstat import MCMCSearch from pyfstat import MCMCSearch
import numpy as np
F0 = 30.0 F0 = 30.0
F1 = -1e-10 F1 = -1e-10
...@@ -12,9 +11,8 @@ tstart = 1000000000 ...@@ -12,9 +11,8 @@ 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-1e-4, 'upper': F0+1e-4},
'upper': F0+5e-5}, 'F1': {'type': 'unif', 'lower': F1*(1+1e-3), 'upper': F1*(1-1e-3)},
'F1': {'type': 'norm', 'loc': F1, 'scale': abs(1e-6*F1)},
'F2': F2, 'F2': F2,
'Alpha': Alpha, 'Alpha': Alpha,
'Delta': Delta 'Delta': Delta
...@@ -25,11 +23,11 @@ log10temperature_min = -30 ...@@ -25,11 +23,11 @@ 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_search_using_MCMC_on_glitching_data', 'data',
sftfilepath='data/*_glitch*.sft', 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, nsteps=nsteps, nwalkers=nwalkers, ntemps=ntemps,
log10temperature_min=log10temperature_min, scatter_val=1e-6) log10temperature_min=log10temperature_min)
mcmc.run() mcmc.run()
mcmc.plot_corner(add_prior=True) mcmc.plot_corner(add_prior=True)
mcmc.print_summary() mcmc.print_summary()
...@@ -27,7 +27,7 @@ data.make_data() ...@@ -27,7 +27,7 @@ data.make_data()
# Next, taking the same signal parameters, we include a glitch half way through # Next, taking the same signal parameters, we include a glitch half way through
dtglitch = duration/2.0 dtglitch = duration/2.0
delta_F0 = 0.4e-5 delta_F0 = 4e-5
delta_F1 = 0 delta_F1 = 0
glitch_data = Writer( glitch_data = Writer(
...@@ -45,7 +45,7 @@ print data.predict_fstat() ...@@ -45,7 +45,7 @@ print data.predict_fstat()
dtglitch = [duration/4.0, 4*duration/5.0] dtglitch = [duration/4.0, 4*duration/5.0]
delta_phi = [0, 0] delta_phi = [0, 0]
delta_F0 = [0.4e-5, 0.3e-6] delta_F0 = [4e-6, 3e-7]
delta_F1 = [0, 0] delta_F1 = [0, 0]
delta_F2 = [0, 0] delta_F2 = [0, 0]
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment