analysis.estimate_mc_ks#

seismostats.analysis.estimate_mc_ks(magnitudes: ~numpy.ndarray, delta_m: float, mcs_test: ~numpy.ndarray | None = None, p_value_pass: float = 0.1, stop_when_passed: bool = True, b_value: float | None = None, b_method: ~seismostats.analysis.bvalue.base.BValueEstimator = <class 'seismostats.analysis.bvalue.classic.ClassicBValueEstimator'>, n: int = 10000, ks_ds_list: list[list] | None = None, verbose: bool = False, **kwargs) tuple[float | None, float | None, list[float], list[float], list[float], list[float]]#

Returns the smallest magnitude in a given list of completeness magnitudes for which the KS test is passed, i.e., where the null hypothesis that the sample is drawn from a Gutenberg-Richter law with that mc cannot be rejected.

Source:
  • Clauset, A., Shalizi, C.R. and Newman, M.E., 2009. Power-law distributions in empirical data. SIAM review, 51(4), pp.661-703.

  • Mizrahi, L., Nandan, S. and Wiemer, S., 2021. The effect of declustering on the size distribution of mainshocks. Seismological Society of America, 92(4), pp.2333-2342.

Parameters:
  • magnitudes – Array of magnitudes to test.

  • delta_m – Bin size of discretized magnitudes. Sample has to be rounded to bins beforehand).

  • mcs_test – Array of tested completeness magnitudes. If None, it will be generated automatically based on magnitudes and delta_m.

  • p_value_pass – p-value threshold for the KS test. Below this value, the null hypothesis that the sample is drawn from a Gutenberg-Richter distribution with the given mc is rejected.

  • stop_when_passed – Whether to stop calculations when first mc passes the test.

  • b_value – If b_value is ‘known’, only estimate mc assuming the given b_value.

  • b_method – b-value estimator to use if b-value needs to be calculated from data

  • n – Number of number of times the KS distance is calculated for estimating the p-value.

  • ks_ds_list – KS distances from synthetic data with the given parameters. If None, they will be estimated here.

  • verbose – Whether to print verbose output.

  • **kwargs – Additional parameters to be passed to the b-value estimator.

Returns:
  • best_mcmc for which the p-value is lowest.

  • best_b_valueb_value corresponding to the best mc.

  • mcs_test – Tested completeness magnitudes.

  • b_values_test – Tested b-values.

  • ks_ds – KS distances.

  • p_values – Corresponding p-values.