Catalog.estimate_a#
- Catalog.estimate_a(mc: float | None = None, delta_m: float | None = None, scaling_factor: float | None = None, m_ref: float | None = None, b_value: float | None = None, method: ~seismostats.analysis.avalue.base.AValueEstimator = <class 'seismostats.analysis.avalue.classic.ClassicAValueEstimator'>, **kwargs) AValueEstimator#
Estimates a-value of the Gutenberg-Richter (GR) law, using the magnitudes in the Catalog. Sets attribute a-value to the computed value, but also returns the a-value estimator object.
- Parameters:
magnitudes – Array of magnitudes.
mc – Completeness magnitude.
delta_m – Bin size of discretized magnitudes.
scaling_factor – Scaling factor. If given, this is used to normalize the number of observed events. For example: Volume or area of the region considered or length of the time interval, given in the unit of interest.
m_ref – Reference magnitude for which the a-value is estimated.
b_value – b-value of the Gutenberg-Richter law. Only relevant when m_ref is not None.
method – AValueEstimator class to use for calculation.
**kwargs – Additional parameters to be passed to the AValueEstimator.calculate method.
- Returns:
estimator – Object of type
ClassicAValueEstimator()or of the type provided by the method parameter.
See also
By default uses
ClassicAValueEstimator()as estimator. All available estimators can be found in the avalues module.Examples
The estimate_a method sets the a_value attribute of the catalog to the computed value.
>>> from datetime import datetime >>> from seismostats import Catalog >>> cat = Catalog.from_dict({ ... 'magnitude': [0, 0.9, -1, 0.2, 0.5], ... 'time': [datetime(2000, 1, 1), ... datetime(2000, 1, 2), ... datetime(2000, 1, 3), ... datetime(2000, 1, 4), ... datetime(2000, 1, 5)]}) >>> cat.mc = -1.0 >>> cat.estimate_a(delta_m=0.1) >>> cat.a_value 0.6989700043360189
The returned estimator can be used to access the remaining results, see the documentation of
ClassicAValueEstimator()or the explicitly used estimator for more information.>>> estimator = cat.estimate_a(delta_m=0.1) >>> estimator.a_value, estimator.mc (0.6989700043360189, -1.0)
Using for example the
APositiveAValueEstimator(), thetimeparameter can either be passed in thekwargs, like the additionaldmcparameter. If not passed, it will be taken from the catalog columns directly.>>> from seismostats.analysis import APositiveAValueEstimator >>> estimator = cat.estimate_a(delta_m=0.1, ... method=APositiveAValueEstimator, dmc=0.1) >>> type(estimator) <class 'seismostats.analysis.APositiveAValueEstimator'>