Loading [MathJax]/extensions/TeX/AMSsymbols.js
LALInference 4.1.9.1-5e288d3
All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
cbcBayesPPAnalysis Namespace Reference

Functions

def fractional_rank (x, xs)
 Returns the fraction of samples, xs, that fall below the value x. More...
 
def pp_plot (ps, title=None, outfile=None)
 Generates a p-p plot for the given ps. More...
 
def pp_kstest_pvalue (ps)
 Returns the K-S p-value for the test of the given ps against a uniform distribution on [0,1]. More...
 
def read_posterior_samples (f, injrow)
 Returns a bppu posterior sample object. More...
 
def output_html (outdir, ks_pvalues, injnum, skypp=False)
 Outputs the HTML page summarizing the results. More...
 

Variables

dictionary posterior_name_to_latex_name
 
string USAGE
 
 parser = optparse.OptionParser(USAGE)
 
 action
 
 type
 
 dest
 
 help
 
 default
 
 None
 
 options
 
 args
 
 injs = lsctables.SimInspiralTable.get_table(utils.load_filename(options.injxml))
 
list parameters = ['m1', 'm2', 'mc', 'eta', 'q', 'theta_jn', 'a1', 'a2', 'tilt1', 'tilt2', 'phi12', 'phi_jl', 'ra', 'dec', 'distance', 'time', 'phi_orb', 'psi']
 
dictionary pvalues = { }
 
 posfiles = args
 
int Ninj = 0
 
def psamples = read_posterior_samples(posfile,injs[index])
 
def samples = psamples[par].samples
 
def true_value = psamples[par].injval
 
def p = fractional_rank(true_value, samples)
 
dictionary ks_pvalues = {}
 
 ps
 
 title
 
 outfile
 
bool skypp = False
 
int found = 0
 
 inf = os.path.join(os.path.realpath(options.skypp),'p-p.%s'%i)
 
 outf = os.path.join(options.outdir,'sky_p-p.%s'%i)
 
 outdir
 

Function Documentation

◆ fractional_rank()

def cbcBayesPPAnalysis.fractional_rank (   x,
  xs 
)

Returns the fraction of samples, xs, that fall below the value x.

Definition at line 109 of file cbcBayesPPAnalysis.py.

◆ pp_plot()

def cbcBayesPPAnalysis.pp_plot (   ps,
  title = None,
  outfile = None 
)

Generates a p-p plot for the given ps.

:param ps: The p-values whose cumulative distribution is to be plotted.

:param title: An (optional) title for the plot.

:param outfile: An (optional) basename for the plot file; both basename.png and basename.pdf will be created.

Definition at line 125 of file cbcBayesPPAnalysis.py.

◆ pp_kstest_pvalue()

def cbcBayesPPAnalysis.pp_kstest_pvalue (   ps)

Returns the K-S p-value for the test of the given ps against a uniform distribution on [0,1].

Definition at line 161 of file cbcBayesPPAnalysis.py.

◆ read_posterior_samples()

def cbcBayesPPAnalysis.read_posterior_samples (   f,
  injrow 
)

Returns a bppu posterior sample object.

Definition at line 168 of file cbcBayesPPAnalysis.py.

◆ output_html()

def cbcBayesPPAnalysis.output_html (   outdir,
  ks_pvalues,
  injnum,
  skypp = False 
)

Outputs the HTML page summarizing the results.

Definition at line 182 of file cbcBayesPPAnalysis.py.

Variable Documentation

◆ posterior_name_to_latex_name

dictionary cbcBayesPPAnalysis.posterior_name_to_latex_name

Definition at line 40 of file cbcBayesPPAnalysis.py.

◆ USAGE

string cbcBayesPPAnalysis.USAGE
Initial value:
1= '''%prog [options] posfile1.dat posfile2.dat ...
2 Generate PP analysis for a set of injections. posfiles must be in same order as injections.'''

Definition at line 238 of file cbcBayesPPAnalysis.py.

◆ parser

cbcBayesPPAnalysis.parser = optparse.OptionParser(USAGE)

Definition at line 240 of file cbcBayesPPAnalysis.py.

◆ action

cbcBayesPPAnalysis.action

Definition at line 241 of file cbcBayesPPAnalysis.py.

◆ type

cbcBayesPPAnalysis.type

Definition at line 241 of file cbcBayesPPAnalysis.py.

◆ dest

cbcBayesPPAnalysis.dest

Definition at line 241 of file cbcBayesPPAnalysis.py.

◆ help

cbcBayesPPAnalysis.help

Definition at line 242 of file cbcBayesPPAnalysis.py.

◆ default

cbcBayesPPAnalysis.default

Definition at line 247 of file cbcBayesPPAnalysis.py.

◆ None

cbcBayesPPAnalysis.None

Definition at line 252 of file cbcBayesPPAnalysis.py.

◆ options

cbcBayesPPAnalysis.options

Definition at line 254 of file cbcBayesPPAnalysis.py.

◆ args

cbcBayesPPAnalysis.args

Definition at line 254 of file cbcBayesPPAnalysis.py.

◆ injs

cbcBayesPPAnalysis.injs = lsctables.SimInspiralTable.get_table(utils.load_filename(options.injxml))

Definition at line 256 of file cbcBayesPPAnalysis.py.

◆ parameters

cbcBayesPPAnalysis.parameters = ['m1', 'm2', 'mc', 'eta', 'q', 'theta_jn', 'a1', 'a2', 'tilt1', 'tilt2', 'phi12', 'phi_jl', 'ra', 'dec', 'distance', 'time', 'phi_orb', 'psi']

Definition at line 259 of file cbcBayesPPAnalysis.py.

◆ pvalues

dictionary cbcBayesPPAnalysis.pvalues = { }

Definition at line 268 of file cbcBayesPPAnalysis.py.

◆ posfiles

cbcBayesPPAnalysis.posfiles = args

Definition at line 269 of file cbcBayesPPAnalysis.py.

◆ Ninj

cbcBayesPPAnalysis.Ninj = 0

Definition at line 270 of file cbcBayesPPAnalysis.py.

◆ psamples

def cbcBayesPPAnalysis.psamples = read_posterior_samples(posfile,injs[index])

Definition at line 273 of file cbcBayesPPAnalysis.py.

◆ samples

def cbcBayesPPAnalysis.samples = psamples[par].samples

Definition at line 281 of file cbcBayesPPAnalysis.py.

◆ true_value

def cbcBayesPPAnalysis.true_value = psamples[par].injval

Definition at line 282 of file cbcBayesPPAnalysis.py.

◆ p

def cbcBayesPPAnalysis.p = fractional_rank(true_value, samples)

Definition at line 283 of file cbcBayesPPAnalysis.py.

◆ ks_pvalues

cbcBayesPPAnalysis.ks_pvalues = {}

Definition at line 293 of file cbcBayesPPAnalysis.py.

◆ ps

cbcBayesPPAnalysis.ps

Definition at line 297 of file cbcBayesPPAnalysis.py.

◆ title

cbcBayesPPAnalysis.title

Definition at line 297 of file cbcBayesPPAnalysis.py.

◆ outfile

cbcBayesPPAnalysis.outfile

Definition at line 297 of file cbcBayesPPAnalysis.py.

◆ skypp

bool cbcBayesPPAnalysis.skypp = False

Definition at line 304 of file cbcBayesPPAnalysis.py.

◆ found

int cbcBayesPPAnalysis.found = 0

Definition at line 306 of file cbcBayesPPAnalysis.py.

◆ inf

cbcBayesPPAnalysis.inf = os.path.join(os.path.realpath(options.skypp),'p-p.%s'%i)

Definition at line 310 of file cbcBayesPPAnalysis.py.

◆ outf

cbcBayesPPAnalysis.outf = os.path.join(options.outdir,'sky_p-p.%s'%i)

Definition at line 311 of file cbcBayesPPAnalysis.py.

◆ outdir

cbcBayesPPAnalysis.outdir

Definition at line 322 of file cbcBayesPPAnalysis.py.