EstimateMUL

require.mx('mxjs/seismic/hazard/mmax/combined.js');

Interface to various MUL estimation methods.

StatusName
Constant Object METHODS

a dictionary containing all the Method objects.

Constant Array METHODS_ARRAY

an array containing all the Method objects.

EventInfo readEventInformation ( Function ↓read_Magnitude, Number ↓begin, Number ↓end, Object ↓settings )

Read event magnitudes into an EventInfo object, which can be used with the various MUL estimation methods. The settings object supports the following properties:

  • sortedDescending {Bool} are the magnitudes already sorted in descending order? If so, we'll avoid internally re-sorting them.

Array runMethods ( EventInfo ↓eventInfo, Object ↓settings, Array ↓methodIDs )

Run MUL estimation methods on an EventInfo object. The following properties are recognised by the settings object, though not all properties are needed by all methods:

  • desiredAccuracy {Number} Desired accuracy.
  • maxIterations {Number} Maximum number of iterations.
  • maxMmax {Number} Max M Max.
  • stdDevMMaxObs {Number} Standard Deviation of Observed MMax observed.
  • C80RMax {Number} Number of events used in the Cook 1980 and Order Statistics methods.


Library Functions

eventInfo = Lib.readEventInformation ( ↓read_Magnitude, ↓begin, ↓end, ↓settings )

Read event magnitudes into an EventInfo object, which can be used with the various MUL estimation methods. The settings object supports the following properties:

  • sortedDescending {Bool} are the magnitudes already sorted in descending order? If so, we'll avoid internally re-sorting them.

Parameters:
  • Function ↓read_Magnitude - function to read the event magnitude.
  • Number ↓begin - row to begin reading.
  • Number ↓end - row to end reading (this row is not included).
  • Object ↓settings - settings object.
Returns: EventInfo eventInfo
results = Lib.runMethods ( ↓eventInfo, ↓settings, ↓methodIDs )

Run MUL estimation methods on an EventInfo object. The following properties are recognised by the settings object, though not all properties are needed by all methods:

  • desiredAccuracy {Number} Desired accuracy.
  • maxIterations {Number} Maximum number of iterations.
  • maxMmax {Number} Max M Max.
  • stdDevMMaxObs {Number} Standard Deviation of Observed MMax observed.
  • C80RMax {Number} Number of events used in the Cook 1980 and Order Statistics methods.

Parameters:
  • EventInfo ↓eventInfo - event information (from readEventInformation).
  • Object ↓settings - settings for the various estimation methods.
  • Array ↓methodIDs - (optional) an array of Method IDs to use. If this is not provided, then all methods will be used.
Returns: Array results - an array containing one value for every estimation method used. Each value is an object with the following properties: method, the Method object used; mmax the estimated MUL; and stddev the Std. Deviation.

Category: Example

A complete example of using the code:

const LibEstimateMUL = require.mx('mxjs/seismic/hazard/mmax/combined.js');

// Read event information (already sorted in descending order) const eventInfo = LibMULEstimate.readEventInformation( Events.read_magnitude, 0, Events.size(), { sortedDescending: true });

// Run all methods on the event information const results = LibMULEstimate.runMethods(eventInfo, { desiredAccuracy: 0.05, maxIterations: 1, maxMmax: 6, stdDevMMaxObs: 0.2, C80RMax: 5 });

results.forEach(function(result, i) { print("method " + result.method.name + " (id " + result.method.id + ")"); print(" mmax = " + result.mmax + ", stddev = " + result.stddev); });


Class: Method

StatusName
Member Number id

this method's ID

Member String name

this method's name

Object calculate ( EventInfo eventInfo, Object settings )

Use this method to estimate the MUL from a collection of events.

Method.calculate ( eventInfo, settings )

Use this method to estimate the MUL from a collection of events.

Parameters:
  • EventInfo eventInfo - the event information.
  • Object settings - settings for the calculation.
Returns: Object results - an object with the following properties: mmax, stddev.