Gutenberg-Richter

require.mx('mxjs/seismic/gutenberg-richter.js');

Gutenberg-Richter relationship tools.

StatusName
determineGRRelationship ( TypedArray magnitudes, Object settings )

Determine the Gutenberg-Richter relationship from an array of magnitudes, using the survival function to determine mmin, b, and N_at_mmin. The settings object supports the following properties:

  • survival_resolution {Number} (optional) defaults to 0.1.
  • mref {Number} reference magnitude to use for the survival function.
  • floor_number {Number}
  • floor_fraction {Number}
  • mmin_lower_limit {Number}
  • mmin_upper_limit {Number}
  • mmax {Number} if passed, will be added to the resulting GRRelationship so that truncated distribution methods can be used.

GRRelationship determineGRRelationshipFromMagnitudesAndMmin ( TypedArray magnitudes, Number mmin )

Determine the Gutenberg-Richter relationship from an array of magnitudes and a given mmin. This function calculates the b-value and N_at_mmin directly from the given mmin.

Object determineVarsFromMagnitudesAndMmin ( TypedArray magnitudes, Number mmin )

Determine some variables for the Gutenberg-Richter relationship, from an array of magnitudes and a given mmin. This function calculates the b-value using the formula `b=1/(ln (10)(bar (Ml)-M_min))`.

getGRRelationship ( Object variables )

Get a Gutenberg-Richter relationship object for the given variables. Variables should be an object containing the following properties:

  • mmin Minimum magnitude (typically determined by the survival function).
  • mmax Maximum magnitude (estimate that was used by the survival function).
  • beta (optional) may be specified instead of the b-value.
  • b (optional) may be specified instead of beta - typically determined by the survival function.
  • N_at_mmin Number of events with magnitude >= mmin, typically determined by the survival function (Min Index).

getGRRelationshipFromJSONString ( String JSONString )

Get a Gutenberg-Richter relationship object from the given JSON string.

plotGRlines ( Table plot, Object variables, Object user_inputs )

The plot table requires the following output columns:

  • ID
  • event_count
  • magnitude
  • probability
  • user_defined_percentage
  • generic_percentage


The variables object requires the following properties:
  • mmin
  • mmax
  • N_at_mmin
  • b (optional)
  • beta (optional)


The user_inputs object supports the following properties:
Resolution: {
   Prob: Number,
   NEvent_Count: Number,
   MagClosenessThreshold: Number
  },
  Probability_Lines: Number
 

toFMVariables ( Object variables )


Library Functions

Lib.determineGRRelationship ( magnitudes, settings )

Determine the Gutenberg-Richter relationship from an array of magnitudes, using the survival function to determine mmin, b, and N_at_mmin. The settings object supports the following properties:

  • survival_resolution {Number} (optional) defaults to 0.1.
  • mref {Number} reference magnitude to use for the survival function.
  • floor_number {Number}
  • floor_fraction {Number}
  • mmin_lower_limit {Number}
  • mmin_upper_limit {Number}
  • mmax {Number} if passed, will be added to the resulting GRRelationship so that truncated distribution methods can be used.

Parameters:
GRrel = Lib.determineGRRelationshipFromMagnitudesAndMmin ( magnitudes, mmin )

Determine the Gutenberg-Richter relationship from an array of magnitudes and a given mmin. This function calculates the b-value and N_at_mmin directly from the given mmin.

Parameters: Returns: GRRelationship GRrel - the resulting GRRelationship object. If the relationship could not be determined (magnitudes were empty, or the b-value could not be determined), then nothing is returned.
vars = Lib.determineVarsFromMagnitudesAndMmin ( magnitudes, mmin )

Determine some variables for the Gutenberg-Richter relationship, from an array of magnitudes and a given mmin. This function calculates the b-value using the formula `b=1/(ln (10)(bar (Ml)-M_min))`.

Parameters: Returns: Object vars - an object containing the following properties: N_at_mmin, b, and Mmean. If the b-value could not be determined (i.e. the divisor in the above equation was zero), then b will be NaN. If the magnitudes array had no elements, then no object is returned.
Lib.getGRRelationship ( variables )

Get a Gutenberg-Richter relationship object for the given variables. Variables should be an object containing the following properties:

  • mmin Minimum magnitude (typically determined by the survival function).
  • mmax Maximum magnitude (estimate that was used by the survival function).
  • beta (optional) may be specified instead of the b-value.
  • b (optional) may be specified instead of beta - typically determined by the survival function.
  • N_at_mmin Number of events with magnitude >= mmin, typically determined by the survival function (Min Index).

Parameters:
Lib.getGRRelationshipFromJSONString ( JSONString )

Get a Gutenberg-Richter relationship object from the given JSON string.

Parameters:
  • String JSONString
Lib.plotGRlines ( plot, variables, user_inputs )

The plot table requires the following output columns:

  • ID
  • event_count
  • magnitude
  • probability
  • user_defined_percentage
  • generic_percentage


The variables object requires the following properties:
  • mmin
  • mmax
  • N_at_mmin
  • b (optional)
  • beta (optional)


The user_inputs object supports the following properties:
Resolution: {
   Prob: Number,
   NEvent_Count: Number,
   MagClosenessThreshold: Number
  },
  Probability_Lines: Number
 

Parameters:
Lib.toFMVariables ( variables )

Parameters:

Class: FMVariables

StatusName

Class: GRRelationship

StatusName
Member Number N_at_mmin

Member Number a

calculated from b, mmin, and N_at_mmin using `a=log_10("N_at_mmin")+bM_min`.

Member Number b

Member Number beta

Member Number delta_b

calculated from b and N_at_mmin using `deltab = b / sqrt(N)`.

Member Number mmax

Member Number mmin

Number calculateNAtML ( Number ↓ML )

Calculate the expected N at a given M L, using the formula `N=10^(a-bM_L)`.

CDF ( Number m )

Untruncated GR relationship CDF (FGR).

`F(m) = {(0,if m < m_min),(1-exp[-beta(m-m_min)],if m >= m_min):}`

complementaryCDF ( Number m )

Untruncated GR survival function (SGR).

Object getVariables ( )

PDF ( Number m )

Untruncated GR relationship PDF (probability density function).

`f(m) = {(0,if m < m_min),(beta exp[-beta(m-m_min)],if m >= m_min):}`

survivalFunction ( Number m )

Alias for complementaryCDF.

String toJSONString ( )

Get a JSON string that can be used to recreate this G-R relationship object using the getGRRelationshipFromJSONString function.

truncatedCDF ( Number m )

Truncated GR relationship CDF (FGRT), requires mmax.

`F(m) = {(0,if m < m_min),((1-exp[-beta(m-m_min)])/(1-exp[-beta(m_max-m_min)]),if m_min <= m <= m_max),(1,if m > m_max):}`

truncatedComplementaryCDF ( Number m )

Truncated GR survival function (SGRT), requires mmax.

truncatedPDF ( Number m )

Truncated GR relationship PDF, requires mmax.

`f(m) = {(0,if m < m_min or m > m_max),((beta exp[-beta(m-m_min)])/(1-exp[-beta(m_max-m_min)]),if m_min <= m <= m_max):}`

truncatedSurvivalFunction ( Number m )

Alias for truncatedComplementaryCDF.

truncatedXmaxCDF ( Number m )

CDF of maximum event (FmaxGRT), requires mmax and N_at_mmin. This function uses the following formula, where `N = text{N_at_mmin}`.

`text{truncatedXmaxCDF}(m) = N * text{truncatedCDF}(m)^N`

truncatedXmaxPDF ( Number m )

PDF of maximum event, required mmax and N_at_mmin. This function uses the following formula, where `N = text{N_at_mmin}`.

`text{truncatedXmaxPDF}(m) = N * text{truncatedCDF}(m)^(N-1) * text{truncatedPDF}(m)`

GRRelationship.calculateNAtML ( ↓ML )

Calculate the expected N at a given M L, using the formula `N=10^(a-bM_L)`.

Parameters:
  • Number ↓ML - magnitude to calculate N at.
Returns: Number N - the expected N at the given ML.
GRRelationship.CDF ( m )

Untruncated GR relationship CDF (FGR).

`F(m) = {(0,if m < m_min),(1-exp[-beta(m-m_min)],if m >= m_min):}`

Parameters:
  • Number m - magnitude to calculate the CDF for.
GRRelationship.complementaryCDF ( m )

Untruncated GR survival function (SGR).

Parameters:
  • Number m - magnitude to calculate the 1-CDF for.
GRRelationship.getVariables ( )

Parameters:
Returns: Object variables - An object containing the variables that define this G-R relationship.
GRRelationship.PDF ( m )

Untruncated GR relationship PDF (probability density function).

`f(m) = {(0,if m < m_min),(beta exp[-beta(m-m_min)],if m >= m_min):}`

Parameters:
  • Number m - magnitude to calculate the PDF for.
GRRelationship.survivalFunction ( m )

Alias for complementaryCDF.

Parameters:
  • Number m - magnitude to calculate the 1-CDF for.
GRRelationship.toJSONString ( )

Get a JSON string that can be used to recreate this G-R relationship object using the getGRRelationshipFromJSONString function.

Parameters:
Returns: String JSON - A JSON string containing the variables that define this G-R relationship.
GRRelationship.truncatedCDF ( m )

Truncated GR relationship CDF (FGRT), requires mmax.

`F(m) = {(0,if m < m_min),((1-exp[-beta(m-m_min)])/(1-exp[-beta(m_max-m_min)]),if m_min <= m <= m_max),(1,if m > m_max):}`

Parameters:
  • Number m - magnitude to calculate the truncated CDF for.
GRRelationship.truncatedComplementaryCDF ( m )

Truncated GR survival function (SGRT), requires mmax.

Parameters:
  • Number m - magnitude to calculate the truncated 1-CDF for.
GRRelationship.truncatedPDF ( m )

Truncated GR relationship PDF, requires mmax.

`f(m) = {(0,if m < m_min or m > m_max),((beta exp[-beta(m-m_min)])/(1-exp[-beta(m_max-m_min)]),if m_min <= m <= m_max):}`

Parameters:
  • Number m - magnitude to calculate the truncated PDF for.
GRRelationship.truncatedSurvivalFunction ( m )

Alias for truncatedComplementaryCDF.

Parameters:
  • Number m - magnitude to calculate the truncated 1-CDF for.
GRRelationship.truncatedXmaxCDF ( m )

CDF of maximum event (FmaxGRT), requires mmax and N_at_mmin. This function uses the following formula, where `N = text{N_at_mmin}`.

`text{truncatedXmaxCDF}(m) = N * text{truncatedCDF}(m)^N`

Parameters:
  • Number m - magnitude to calculate for.
GRRelationship.truncatedXmaxPDF ( m )

PDF of maximum event, required mmax and N_at_mmin. This function uses the following formula, where `N = text{N_at_mmin}`.

`text{truncatedXmaxPDF}(m) = N * text{truncatedCDF}(m)^(N-1) * text{truncatedPDF}(m)`

Parameters:
  • Number m - magnitude to calculate for.