Marginalized time model
Example with GW150914
The marginalized time model can handle a broad array of waveform models which
it generates at full resolution like the gaussian_noise model. However,
it is optimized to enable marginalization of time in addition to marginalization
over sky location, polarization, and overall phase (valid if the waveform
approximant is dominant mode only).
This example demonstrates using the marginalized_time model with the
dynesty sampler in a configuration designed to run in couple minutes on a
laptop. Actual sampling will only occur over the component masses and
inclination. The remaining parameters are marginalized over, but will
be reconstructed after running the parameter estimation by a follow-up
script.
First, we create the following configuration file:
For this example, we’ll need to download gravitational-wave data for GW150914:
set -e
for ifo in H-H1 L-L1
do
file=${ifo}_GWOSC_4KHZ_R1-1126257415-4096.gwf
test -f ${file} && continue
# Not downloading frames from GWOSC to avoid failures.
# GWOSC often is not responsive to queries from within the GitHub CI.
# The commented command below is how to get the frame from GWOSC if you
# wanted to verify they are the same.
#curl -O -L --show-error --silent \
# https://www.gwosc.org/eventapi/html/GWTC-1-confident/GW150914/v3/${file}
curl -O -L --show-error --silent \
https://media.githubusercontent.com/media/gwastro/pycbc_data/master/${file}
done
By setting the model name to marginalized_time we are using
MarginalizedTime.
Now run the following script. Note that after the parameter inference is run, we reconstruct the marginalized parameters by using the pycbc_inference_model_stats script with the options as follows.
OMP_NUM_THREADS=1 pycbc_inference \
--config-file `dirname "$0"`/margtime.ini \
--nprocesses 1 \
--processing-scheme mkl \
--output-file marg_150914.hdf \
--seed 0 \
--force \
--verbose
# This reconstructs any marginalized parameters
OMP_NUM_THREADS=1 pycbc_inference_model_stats \
--input-file marg_150914.hdf \
--output-file demarg_150914.hdf \
--nprocesses 1 \
--reconstruct-parameters \
--force \
--verbose
pycbc_inference_plot_posterior \
--input-file demarg_150914.hdf \
--output-file demarg_150914.png \
--parameters \
"primary_mass(mass1, mass2) / (1 + redshift(distance)):srcmass1" \
"secondary_mass(mass1, mass2) / (1 + redshift(distance)):srcmass2" \
ra dec tc inclination coa_phase polarization distance \
--vmin 23.2 \
--z-arg snr
This will run the dynesty sampler. When it is done, you will have a file called
demarg_150914.hdf which contains the results. It should take just a few minutes to run.
This will create the following plot:
The scatter points show position of different posterior samples.