analysis.APositiveAValueEstimator.calculate#
- APositiveAValueEstimator.calculate(magnitudes: ndarray, mc: float, delta_m: float, times: ndarray, scaling_factor: float | None = None, m_ref: float | None = None, b_value: float | None = None, dmc: float | None = None) float#
- Parameters:
magnitudes – Array of magnitudes.
mc – Completeness magnitude.
delta_m – Bin size of discretized magnitudes.
times – Array of times of the events, in any format (datetime, float, etc.).
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.
dmc – Minimum magnitude difference between consecutive events. If None, the default value is delta_m.
- Returns:
a_pos – a-value of the Gutenberg-Richter law.
Examples
>>> import numpy as np >>> from seismostats.analysis import APositiveAValueEstimator >>> magnitudes = np.array([2.1, 2.3, 2.0, 2.0, 2.1, 2.2, 2.1, ... 2.3, 2.0, 2.0]) >>> times = np.array([1, 2, 3, 4, 5, 6, 7, 8, 9, 10]) >>> my_estimator = APositiveAValueEstimator() >>> a_value = my_estimator.calculate(magnitudes=magnitudes, ... mc=2.0, delta_m=0.1, times=times) >>> a_value 0.9542425094393249