stats - Statistics#

gammapy.stats Package#

Statistics.

Functions#

cash(n_on, mu_on[, truncation_value])

Cash statistic, for Poisson data.

cstat(n_on, mu_on[, truncation_value])

C statistic, for Poisson data.

get_wstat_gof_terms(n_on, n_off)

Goodness of fit terms for WSTAT.

get_wstat_mu_bkg(n_on, n_off, alpha, mu_sig)

Background estimate mu_bkg for WSTAT.

wstat(n_on, n_off, alpha, mu_sig[, mu_bkg, ...])

W statistic, for Poisson data with Poisson background.

compute_fvar(flux, flux_err[, axis])

Calculate the fractional excess variance.

compute_fpp(flux, flux_err[, axis])

Calculate the point-to-point excess variance.

compute_flux_doubling(flux, flux_err, coords)

Compute the minimum characteristic flux doubling and halving over a certain coordinate axis for a series of measurements.

compute_chisq(flux)

Calculate the chi-square test for LightCurve.

structure_function(flux, flux_err, time[, ...])

Compute the discrete structure function for a variable source.

discrete_correlation(flux1, flux_err1, ...)

Compute the discrete correlation function for a variable source.

TimmerKonig_lightcurve_simulator(...[, ...])

Implementation of the Timmer-Koenig algorithm to simulate a time series from a power spectrum.

sigma_to_ts(n_sigma[, df, n_sigma_asimov])

Convert number of sigma to delta ts.

ts_to_sigma(ts[, df, ts_asimov])

Convert delta ts to number of sigma.

Classes#

CashCountsStatistic

Class to compute statistics for Poisson distributed variable with known background.

Chi2FitStatistic

Chi2 fit statistic class for measurements with gaussian symmetric errors.

Chi2AsymmetricErrorFitStatistic

Pseudo-Chi2 fit statistic class for measurements with gaussian asymmetric errors with upper limits.

WStatCountsStatistic

Class to compute statistics for Poisson distributed variable with unknown background.