openquake.hazardlib.correlation_models package#
Base interfaces#
Base interfaces shared by ground-motion correlation models.
- class openquake.hazardlib.correlation_models.base.CholeskyFactor(lower_triangle: ndarray)[source]#
Bases:
objectDense Cholesky factorization used by the default implementation.
- lower_triangle: ndarray#
- class openquake.hazardlib.correlation_models.base.CorrelationContext(mag: float | None = None, rake: float | None = None, trt: str | None = None, region: str | None = None)[source]#
Bases:
objectOptional predictors used by context-dependent correlation models.
- mag: float | None = None#
- rake: float | None = None#
- region: str | None = None#
- trt: str | None = None#
- class openquake.hazardlib.correlation_models.base.CorrelationFactor(*args, **kwargs)[source]#
Bases:
ProtocolA factorization capable of applying correlation to samples.
- class openquake.hazardlib.correlation_models.base.CorrelationModel[source]#
Bases:
objectCommon metadata and validation for all correlation models.
- CALIBRATED_FOR_INTENSITY_MEASURE_TYPES = None#
- DEFINED_FOR_INTENSITY_MEASURE_COMPONENT = None#
- DEFINED_FOR_INTENSITY_MEASURE_TYPES = None#
- DEFINED_FOR_REGION = None#
- DEFINED_FOR_RESIDUAL_COMPONENT = None#
- DEFINED_FOR_SA_DAMPING = None#
- DEFINED_FOR_SA_PERIOD_RANGE = None#
- INTENSITY_MEASURE_TYPE_APPROXIMATIONS = {}#
- class openquake.hazardlib.correlation_models.base.CrossIMTCorrelationModel[source]#
Bases:
SpatialCrossIMTCorrelationModelCross-IMT correlation at a single site.
- correlation_matrix(imts, component=None, context=None, dtype=<class 'float'>)[source]#
Return an
M x Mcross-IMT correlation matrix.
- covariance(sites, imts, component=None, context=None)[source]#
Embed cross-IMT matrices for each site in IMT-major ordering.
- class openquake.hazardlib.correlation_models.base.ResidualComponent(value, names=<not given>, *values, module=None, qualname=None, type=None, start=1, boundary=None)[source]#
Bases:
str,EnumResidual components for which a model can be calibrated.
- BETWEEN_EVENT = 'between'#
- TOTAL = 'total'#
- WITHIN_EVENT = 'within'#
- class openquake.hazardlib.correlation_models.base.SpatialCorrelationModel[source]#
Bases:
SpatialCrossIMTCorrelationModelSame-IMT spatial correlation over a collection of sites.
- apply_correlation(sites, imt, residuals, stddev_intra=0)[source]#
Apply spatial correlation to sampled within-event residuals.
- correlation_matrix(sites, imt, component=None, context=None)[source]#
Return a same-IMT spatial correlation matrix or block.
- class openquake.hazardlib.correlation_models.base.SpatialCrossIMTCorrelationModel[source]#
Bases:
CorrelationModelCorrelation over a joint, IMT-major vector of sites and IMTs.
- correlate(sites, imts, samples, component=None, context=None)[source]#
Correlate standard-normal samples across IMTs and sites.
samplesmust have shape(M, N, E). The first two dimensions are flattened in IMT-major order before applying the factorization.
- correlation_block(distances, imts1, imts2=None, component=None, context=None)[source]#
Return correlation between two IMT-major site vectors.
distanceshas shape(N1, N2)and the returned matrix has shape(len(imts1) * N1, len(imts2) * N2). Joint models should implement this method so they can also be used for conditioning.
- covariance(sites, imts, component=None, context=None)[source]#
Return a covariance matrix with shape
(M*N, M*N).
- factor(sites, imts, component=None, context=None, ensure_psd=True)[source]#
Return the default dense factorization of
covariance().The fast path attempts Cholesky decomposition directly. A covariance repair is performed only when decomposition fails and
ensure_psdis true. Models with efficient structured factorizations should override this method.
- class openquake.hazardlib.correlation_models.base.TruncatedCrossIMTCorrelationModel(truncation_level=99.0)[source]#
Bases:
CrossIMTCorrelationModelCross-IMT model able to sample truncated normal residuals.
- matrix_dtype#
alias of
float
Registry#
Registry for ground-motion correlation models.
- class openquake.hazardlib.correlation_models.registry.ModelSpec(name: str, cls: type[openquake.hazardlib.correlation_models.base.CorrelationModel], aliases: tuple[str, ...], model_type: str, description: str)[source]#
Bases:
objectRegistration metadata for a correlation model.
- aliases: tuple[str, ...]#
- property calibrated_imts#
- description: str#
- property imc#
- property intensity_measure_type_approximations#
- model_type: str#
- name: str#
- property region#
- property residual_component#
- property sa_damping#
- property sa_period_range#
- property supported_imts#
- openquake.hazardlib.correlation_models.registry.get_model(name, model_type=None, **parameters)[source]#
Instantiate and validate the model registered under
name.
- openquake.hazardlib.correlation_models.registry.get_model_class(name, model_type=None)[source]#
Return the class registered under
name.
Spatial models#
- class openquake.hazardlib.correlation_models.spatial.jayaram_baker_2009.JayaramBaker2009(vs30_clustering)[source]#
Bases:
SpatialCorrelationModelWithin-event spatial correlation by Jayaram and Baker (2009).
The publication calibrated PGA and 5%-damped SA through 10 seconds. PGV is retained temporarily using OpenQuake’s historical SA(1.0) proxy.
- class openquake.hazardlib.correlation_models.spatial.heresi_miranda_2019.HeresiMiranda2019(uncertainty_multiplier=0)[source]#
Bases:
SpatialCorrelationModelWithin-event spatial correlation by Heresi and Miranda (2019).
- class openquake.hazardlib.correlation_models.spatial.aldea_et_al_2022.AldeaEtAl2022[source]#
Bases:
SpatialCorrelationModelWithin-event model for the Chilean subduction zone.
- class openquake.hazardlib.correlation_models.spatial.schiappapietra_et_al_2022.SchiappapietraEtAl2022NorthernItaly[source]#
Bases:
_SchiappapietraEtAl2022Median model calibrated for Northern Italy.
- class openquake.hazardlib.correlation_models.spatial.schiappapietra_et_al_2022.SchiappapietraEtAl2022CentralItaly[source]#
Bases:
_SchiappapietraEtAl2022Median model calibrated for Central Italy.
- class openquake.hazardlib.correlation_models.spatial.schiappapietra_et_al_2022.SchiappapietraEtAl2022SouthernItaly[source]#
Bases:
_SchiappapietraEtAl2022Median model calibrated for Southern Italy.
The publication notes that this regional model is less well constrained than the Northern and Central Italy models because only six earthquakes were available for its calibration.
Joint spatial and cross-IMT models#
- class openquake.hazardlib.correlation_models.spatial_cross_imt.loth_baker_2013.LothBaker2013[source]#
Bases:
SpatialCrossIMTCorrelationModelWithin-event spatial cross-IMT model by Loth and Baker (2013).
The model was calibrated for 5%-damped SA from 0.01 to 10 s. PGA is supported through the conventional SA(0.01) correlation proxy.
- class openquake.hazardlib.correlation_models.spatial_cross_imt.markhvida_et_al_2018.MarkhvidaEtAl2018[source]#
Bases:
SpatialCrossIMTCorrelationModelWithin-event spatial cross-IMT model by Markhvida et al. (2018).
The model uses all nineteen principal components, following the authors’ current reference implementation, and was calibrated for 5%-damped SA from 0.01 to 5 seconds. PGA is supported through the conventional SA(0.01) correlation proxy; this is an operational approximation rather than a calibrated part of the model.
- class openquake.hazardlib.correlation_models.spatial_cross_imt.wang_du_2013.WangDu2013PGAIAPGV(vs30_correlation_range=12.5)[source]#
Bases:
_WangDu2013Joint correlation for the publication’s PGA, IA, and PGV set.
- class openquake.hazardlib.correlation_models.spatial_cross_imt.wang_du_2013.WangDu2013SpectralAcceleration(vs30_correlation_range=12.5)[source]#
Bases:
_WangDu2013Joint correlation for 5%-damped SA from 0.01 to 10 seconds.
The publication permits linear interpolation of the tabulated coregionalization matrices. Interpolation can change their marginal variances, so the resulting covariance is normalized to a correlation matrix. This preserves the standard deviations supplied by the GSIM.
Cross-IMT models#
- class openquake.hazardlib.correlation_models.cross_imt.baker_cornell_2006.BakerCornell2006[source]#
Bases:
CrossIMTCorrelationModelTotal-residual spectral correlation by Baker and Cornell (2006).
The publication calibrated 5%-damped SA from 0.05 to 5 seconds. PGA and PGV are retained temporarily using the engine’s historical SA(0.05) proxy.
- class openquake.hazardlib.correlation_models.cross_imt.baker_jayaram_2008.BakerJayaram2008[source]#
Bases:
CrossIMTCorrelationModelTotal-residual cross-IMT correlation for GMRotI50.
The publication calibrated 5%-damped SA from 0.01 to 10 seconds. PGA is represented by the model’s shortest calibrated period, SA(0.01).
- class openquake.hazardlib.correlation_models.cross_imt.bradley_2012.Bradley2012(truncation_level=99.0)[source]#
Bases:
TruncatedCrossIMTCorrelationModelTotal-residual correlation between PGV and spectrum-based IMTs.
- class openquake.hazardlib.correlation_models.cross_imt.goda_atkinson_2009.GodaAtkinson2009(truncation_level=99.0)[source]#
Bases:
TruncatedCrossIMTCorrelationModelBetween-event cross-IMT correlation by Goda and Atkinson (2009).
The model was calibrated for 5%-damped SA from 0.1 to 5 seconds. PGA is retained temporarily using the engine’s historical SA(0.05) proxy, which lies outside that calibrated range.
- matrix_dtype#
alias of
float32
- class openquake.hazardlib.correlation_models.cross_imt.no_cross_correlation.NoCrossCorrelation(truncation_level=99.0)[source]#
Bases:
TruncatedCrossIMTCorrelationModelRepresent the absence of cross-IMT correlation.
- class openquake.hazardlib.correlation_models.cross_imt.full_cross_correlation.FullCrossCorrelation(truncation_level=99.0)[source]#
Bases:
TruncatedCrossIMTCorrelationModelRepresent perfect cross-IMT correlation.
Compatibility modules#
openquake.hazardlib.correlation and
openquake.hazardlib.cross_correlation are compatibility modules for the
historical APIs. New code should import canonical classes from
openquake.hazardlib.correlation_models subpackages or resolve configured
models through the registry.