get_pvalue_plot

sherpa.ui.get_pvalue_plot(null_model=None, alt_model=None, conv_model=None, id=1, otherids=(), num=500, bins=25, numcores=None, recalc=False)

Return the data used by plot_pvalue.

Parameters:
  • null_model – The model expression for the null hypothesis.
  • alt_model – The model expression for the alternative hypothesis.
  • conv_model (optional) – An expression used to modify the model so that it can be compared to the data (e.g. a PSF or PHA response).
  • id (int or str, optional) – The data set that provides the data. The default is 1.
  • otherids (sequence of int or str, optional) – Other data sets to use in the calculation.
  • num (int, optional) – The number of simulations to run. The default is 500.
  • bins (int, optional) – The number of bins to use to create the histogram. The default is 25.
  • numcores (optional) – The number of CPU cores to use. The default is to use all the cores on the machine.
  • recalc (bool, optional) – The default value (False) means that the results from the last call to plot_pvalue or get_pvalue_plot are returned. If True, the values are re-calculated.
Returns:

plot

Return type:

a sherpa.plot.LRHistogram instance

See also

get_pvalue_results()
Return the data calculated by the last plot_pvalue call.
plot_pvalue()
Compute and plot a histogram of likelihood ratios by simulating data.

Examples

Return the values from the last call to plot_pvalue:

>>> pvals = get_pvalue_plot()
>>> pvals.ppp
0.472

Run 500 simulations for the two models:

>>> pvals = get_pvalue_plot(mdl1, mdl2, recalc=True, num=500)