4.7. Relative Score Method — Incremental Dynamic Analysis

imselection.compute_rsm_ida(ida_dict_im1, ida_dict_im2)[source]

Relative Sufficiency Measure between two IMs using Incremental Dynamic Analysis.

Implements Equation 8 of Ebrahimian & Jalayer (2021).

API contract: ida_dict_im1 and ida_dict_im2 must have been computed from the same N ground-motion records in the same order.

Parameters:
  • ida_dict_im1 (dict) – IDA result for IM₁ (reference IM).

  • ida_dict_im2 (dict) – IDA result for IM₂ (candidate IM).

Returns:

  • dict with keys

  • * 'rsm' — scalar RSM in bits (positive → IM₂ better)

  • * 'rsm_per_record' — ndarray of per-record log₂ ratios (valid only)

  • * 'n_records' — total number of records

  • * 'n_valid' — records where IDA interpolation succeeded

  • * 'method''IDA'

Example

from openquake.vmtk.imselection import imselection

ims = imselection()
result = ims.compute_rsm_ida(ida_dict1, ida_dict2)
print(f"RSM(IM2 vs IM1) = {result['rsm']:.4f} bits")