diff --git a/Paper/Examples/fully_coherent_search_using_MCMC.py b/Paper/Examples/fully_coherent_search_using_MCMC.py index fb4464ec9de22ab5f73f53bf11d5366597c85e54..bb53c79937bf7920bf185e590fca0db1bdf192a4 100644 --- a/Paper/Examples/fully_coherent_search_using_MCMC.py +++ b/Paper/Examples/fully_coherent_search_using_MCMC.py @@ -59,3 +59,18 @@ mcmc = pyfstat.MCMCSearch( mcmc.run(context='paper', subtractions=[30, -1e-10]) mcmc.plot_corner(add_prior=True) mcmc.print_summary() + +from latex_macro_generator import write_to_macro +write_to_macro('BasicExampleF0', '{:1.0f}'.format(F0), '../macros.tex') +write_to_macro('BasicExampleF1', F1, '../macros.tex') +write_to_macro('BasicExampleh0', h0, '../macros.tex') +write_to_macro('BasicExampleSqrtSn', sqrtSX, '../macros.tex') +write_to_macro('BasicExampleDepth', depth, '../macros.tex') +write_to_macro('BasicExampleDeltaF0', DeltaF0, '../macros.tex') +write_to_macro('BasicExampleDeltaF1', DeltaF1, '../macros.tex') +write_to_macro('BasicExampleVF0', VF0, '../macros.tex') +write_to_macro('BasicExampleVF1', VF1, '../macros.tex') +write_to_macro('BasicExampleV', VF0*VF1, '../macros.tex') +write_to_macro('BasicExamplenburn', nsteps[0], '../macros.tex') +write_to_macro('BasicExamplenprod', nsteps[1], '../macros.tex') + diff --git a/Paper/Examples/transient_search_using_MCMC.py b/Paper/Examples/transient_search_using_MCMC.py index 8df9b12b4627b8b7a1367443ae3d3b5c7af37ca2..c1cf3fede47515d95b2cf5a2555f29ad6024f9bc 100644 --- a/Paper/Examples/transient_search_using_MCMC.py +++ b/Paper/Examples/transient_search_using_MCMC.py @@ -16,7 +16,7 @@ data_tstart = tstart - duration data_tend = data_tstart + 3*duration tref = .5*(data_tstart+data_tend) -h0 = 1e-23 +h0 = 5e-24 sqrtSX = 1e-22 transient = pyfstat.Writer( @@ -26,9 +26,7 @@ transient = pyfstat.Writer( transient.make_data() print transient.predict_fstat() - - -DeltaF0 = 6e-7 +DeltaF0 = 1e-7 DeltaF1 = 1e-13 VF0 = (np.pi * duration * DeltaF0)**2 / 3.0 VF1 = (np.pi * duration**2 * DeltaF1)**2 * 4/45. @@ -48,7 +46,7 @@ theta_prior = {'F0': {'type': 'unif', ntemps = 3 log10temperature_min = -1 nwalkers = 100 -nsteps = [750, 250] +nsteps = [100, 100] mcmc = pyfstat.MCMCSearch( label='transient_search_initial_stage', outdir='data', diff --git a/Paper/macros.tex b/Paper/macros.tex index 2d6a1c62e6bae828f5911650f64bd27d06bfa3e4..db1e556bd3b91252e54fd2d3b33b00fad51ee214 100644 --- a/Paper/macros.tex +++ b/Paper/macros.tex @@ -1,4 +1,16 @@ -\def\DirectedMCNoiseOnlyMaximum{52.4} -\def\DirectedMCNoiseN{10000} -\def\AllSkyMCNoiseOnlyMaximum{59.8} \def\AllSkyMCNoiseN{10000} +\def\AllSkyMCNoiseOnlyMaximum{59.8} +\def\BasicExampleDeltaFone{1.0{\times}10^{-13}} +\def\BasicExampleDeltaFzero{1.0{\times}10^{-7}} +\def\BasicExampleDepth{10.0} +\def\BasicExampleFone{-1.0{\times}10^{-10}} +\def\BasicExampleFzero{30} +\def\BasicExampleSqrtSn{1.0{\times}10^{-23}} +\def\BasicExampleV{120.0} +\def\BasicExampleVFone{49.0} +\def\BasicExampleVFzero{2.5} +\def\BasicExamplehzero{1.0{\times}10^{-24}} +\def\BasicExamplenburn{50.0} +\def\BasicExamplenprod{50.0} +\def\DirectedMCNoiseN{10000} +\def\DirectedMCNoiseOnlyMaximum{52.4} diff --git a/Paper/paper_cw_mcmc.tex b/Paper/paper_cw_mcmc.tex index 2dc7f005b9d34a00a5b09526a8dc1c6c0741224e..cd8bc4c552778396c60b4691bccb75c6dc053ff1 100644 --- a/Paper/paper_cw_mcmc.tex +++ b/Paper/paper_cw_mcmc.tex @@ -672,11 +672,12 @@ metric-mismatch of unity.} In order to familiarise the reader with the features of an MCMC search, we will now describe a simple directed search (over $f$ and $\dot{f}$) for a simulated -signal in Gaussian noise. The signal will have a frequency of $30$~Hz and a -spin-down of $-1{\times}10^{-10}$~Hz/s, all other Doppler parameters are -`known' and so are irrelevant. Moreover, the signal has an amplitude -$h_0=10^{-24}$~Hz$^{-1/2}$ while the Gaussian noise has -$\Sn=10^{-23}$~Hz$^{-1/2}$ such that the signal has a depth of 10. +signal in Gaussian noise. The signal will have a frequency of +$\BasicExampleFzero$~Hz and a spin-down of $\BasicExampleFone$~Hz/s, all other +Doppler parameters are known and so are irrelevant. Moreover, the signal has an +amplitude $\BasicExamplehzero$~Hz$^{-1/2}$ while the Gaussian noise has +$\sqrt{\Sn}=\BasicExampleSqrtSn$~Hz$^{-1/2}$ such that the signal has a depth +of $\BasicExampleDepth$. First, we must define a prior for each search parameter Typically, we recommend either a uniform prior bounding the area of interest, or a normal distribution @@ -684,23 +685,23 @@ centered on the target and with some well defined width. However, to ensure that the MCMC simulation has a reasonable chance at finding a peak, one should consider the corresponding metric-volume given in Equation~\eqref{eqn_metric_volume}. For this example, we will use a uniform -prior with a frequency range of $\Delta f = 10^{-7}$~Hz and a spin-down range -of $\Delta \fdot=10^{-13}$~Hz/s both centered on the simulated signal frequency -and spin-down rate. We set the reference time to coincide with the middle of -the data span, therefore the metric volume can be decomposed into the frequency -contribution and spin-down contribution: +prior with a frequency range of $\Delta f=\BasicExampleDeltaFzero$~Hz and a +spin-down range of $\Delta \fdot=\BasicExampleDeltaFone$~Hz/s both centered on +the simulated signal frequency and spin-down rate. We set the reference time to +coincide with the middle of the data span, therefore the metric volume can be +decomposed into the frequency contribution and spin-down contribution: frequency, \begin{align} -\Vpe^{(0)} = \frac{(\pi\Tcoh\Delta f)^2}{3} \approx 2.46 +\Vpe^{(0)} = \frac{(\pi\Tcoh\Delta f)^2}{3} \approx \BasicExampleVFzero \end{align} and \begin{align} -\Vpe^{(1)} = \frac{4(\pi\Delta \fdot)^2\Tcoh^{4}}{45} \approx 48.9 +\Vpe^{(1)} = \frac{4(\pi\Delta \fdot)^2\Tcoh^{4}}{45} \approx \BasicExampleVFone \end{align} -such that $\V\approx120$ (note that $\Vsky$ does not contribute since we do -not search over the sky parameters). This metric volume indicates that the -signal will occupy about 1\% of the prior volume, therefore the MCMC is -expected to work. Alternative priors will need careful thought about how to +such that $\V\approx\BasicExampleV$ (note that $\Vsky$ does not contribute +since we do not search over the sky parameters). This metric volume indicates +that the signal will occupy about 1\% of the prior volume, therefore the MCMC +is expected to work. Alternative priors will need careful thought about how to translate them into a metric volume: for example using a Gaussian one could use the standard deviation as a proxy for the allowed search region.