    Return the data used by plot_pvalue.

get_pvalue_plot(null_model=None, alt_model=None, conv_model=None, id=1, otherids=(), num=500, bins=25, numcores=None, recalc=False)
conv_model - optional
id - int or str, optional
otherids - sequence of int or str, optional
num - int, optional
bins - int, optional
numcores - optional
recalc - bool, optional

Access the data arrays and preferences defining the histogram plot produced by the `plot_pvalue` function, a histogram of the likelihood ratios comparing fits of the null model to fits of the alternative model using faked data with Poisson noise. Data returned includes the likelihood ratio computed using the observed data, and the p-value, used to reject or accept the null model.

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 and print the results:

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

PARAMETERS

The parameters for this function are:

Parameter
Definition
null_model
The model expression for the null hypothesis.
alt_model
The model expression for the alternative hypothesis.
conv_model
An expression used to modify the model so that it can be compared to the data (e.g. a PSF or PHA response).
id
The data set that provides the data. The default is 1.
otherids
Other data sets to use in the calculation.
num
The number of simulations to run. The default is 500.
bins
The number of bins to use to create the histogram. The default is 25.
numcores
The number of CPU cores to use. The default is to use all the cores on the machine.
recalc
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.

Notes

The `set_rng` routine is used to control how the random numbers are generated.

See the bugs pages on the Sherpa website for an up-to-date listing of known bugs.

December 2023