Last modified: December 2020

URL: https://cxc.cfa.harvard.edu/sherpa/ahelp/calc_mlr.html
AHELP for CIAO 4.13 Sherpa v1

calc_mlr

Context: utilities

Synopsis

Compare two models using the Maximum Likelihood Ratio test.

Syntax

calc_mlr(delta_dof, delta_stat)

delta_dof - int
delta_stat - number

Description

The Maximum Likelihood Ratio (MLR) test is a model comparison test; that is, it is a test used to select from two competing models which best describes a particular data set. A model comparison test statistic, T, is created from the best-fit statistics of each fit; as with all statistics, it is sampled from a probability distribution p(T). The test significance is defined as the integral of p(T) from the observed value of T to infinity. Thesignificance quantifies the probability that one would select the more complex model when in fact the null hypothesis is correct. See also `calc_ftest` .


Example

In this example, the more-complex model has 2 extra degrees of freedom and a statistic value that is larger by 3.7. The MLR test does not provide any evidence that the complex model is a better fit to the data than the simple model since the result is much larger than 0.

>>> calc_mlr(2, 3.7)
0.15723716631362761

PARAMETERS

The parameters for this function are:

Parameter Definition
delta_dof change in the number of degrees of freedom
delta_stat change in the best-fit statistic value

Return value

The return value from this function is:

sig -- The significance, or p-value. A standard threshold for selecting the more complex model is significance < 0.05 (the '95% criterion' of statistics).

Notes

The MLR test should only be used when:

See Protassov et al. 2002 [1] for more discussion.

References


Bugs

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

See Also

data
copy_data, dataspace1d, dataspace2d, datastack, delete_data, fake, get_axes, get_bkg_chisqr_plot, get_bkg_delchi_plot, get_bkg_fit_plot, get_bkg_model_plot, get_bkg_plot, get_bkg_ratio_plot, get_bkg_resid_plot, get_bkg_source_plot, get_counts, get_data, get_data_contour, get_data_contour_prefs, get_data_image, get_data_plot, get_data_plot_prefs, get_dep, get_dims, get_error, get_quality, get_specresp, get_staterror, get_syserror, group, group_adapt, group_adapt_snr, group_bins, group_counts, group_snr, group_width, load_ascii, load_data, load_grouping, load_quality, set_data, set_quality, ungroup, unpack_ascii, unpack_data
filtering
get_filter, load_filter, set_filter
info
get_default_id, list_data_ids, list_response_ids
modeling
clean
plotting
plot_data, set_xlinear, set_xlog, set_ylinear, set_ylog
saving
save_error, save_filter, save_grouping, save_quality, save_staterror, save_syserror
utilities
calc_data_sum, calc_data_sum2d, calc_ftest, calc_kcorr, calc_model_sum2d, calc_source_sum2d, get_rate
visualization
contour, contour_data, contour_ratio, histogram1d, histogram2d, image_data, rebin