Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature: store "aggregate" disaggregation #31

Open
10 tasks done
chrisdicaprio opened this issue Feb 2, 2023 · 2 comments
Open
10 tasks done

Feature: store "aggregate" disaggregation #31

chrisdicaprio opened this issue Feb 2, 2023 · 2 comments
Assignees

Comments

@chrisdicaprio
Copy link
Collaborator

chrisdicaprio commented Feb 2, 2023

We want to be able to store an aggregate disagg (e.g. typically, a mean of all disaggregations of a logic tree)

unique identifiers of a disaggregation are:

  • vs30
  • location lat,, lon
  • hazard_model_id (THS)
  • annual PoE (what about PoO)
  • IMT
  • agg of the hazard curve (e.g. 'mean', '0.5', etc)
  • agg of the disaggregation

Data to be stored

  • hazard level of shaking. This is a single floating point value
  • the bins (i.e. the values of magnitude, distance, etc) at which we've calculated the disagg: equivalent to levels in a hazard aggregation
  • the disaggregation probabilities: equivalent to values in a hazard aggregation

Data Structure

The diaggregation is a multi-dimensional matrix (typically 4 dimensions). In the example data provided the dimensions are

  • magnitude
  • distance
  • trt (tectonic region type)
  • epsilon

It is possible to have a disagg over a subset of those dimensions. It may also be possible that we have more or other dimensions (e.g. lat and lon)

Code References

Sample Data

sample_data.zip

For the sample data provided, the axis of the 4d disagg array are:

  • 0: magnitude
  • 1: distance
  • 2: trt
  • 3: epsilon

Similarly, bins[i] are the values of the bins for the dimension i
bins[4] stores the value of the hazard level of shaking

vs30 = 750
location = lat: 39.000 lon:175.930
hazard_model_id = 'SLT_v8_gmm_v2_FINAL'
annual probability = 0.038559172
IMT = 'SA(0.5)'
agg = 'mean'
deagg_SLT_v8_gmm_v2_FINAL_-39.000~175.930_750_SA(0.5)86_eps-dist-mag-trt.npy
bins_SLT_v8_gmm_v2_FINAL
-39.000~175.930_750_SA(0.5)_86_eps-dist-mag-trt.npy

vs30 = 400
location = lat:-42.780 lon:171.540'
hazard_model_id = 'SLT_v8_gmm_v2_FINAL'
annual probability = 0.019688642
IMT = 'SA(1.5)'
agg = 'mean'
deagg_SLT_v8_gmm_v2_FINAL_-42.780~171.540_400_SA(1.5)63_eps-dist-mag-trt.npy
bins_SLT_v8_gmm_v2_FINAL
-42.780~171.540_400_SA(1.5)_63_eps-dist-mag-trt.npy

@chrisbc chrisbc self-assigned this Feb 8, 2023
@chrisdicaprio
Copy link
Collaborator Author

aggregate possibilities for Enum
["mean", "cov", "std", "0.005", "0.01", "0.025", "0.05", "0.1", "0.2", "0.3", "0.4", "0.5", "0.6", "0.7", "0.8", "0.9", "0.95", "0.975", "0.99", "0.995"]

@chrisdicaprio
Copy link
Collaborator Author

probabilities

Probability % in 50 probability fraction in 1 year probability fraction in 1 year (sci notation)
86 0.038559171941116 3.8559E-02
63 0.0196886419357 1.9689E-02
39 0.009837221296157 9.8372E-03
18 0.00396115262986 3.9612E-03
10 0.002104991704137 2.1050E-03
5 0.001025339867232 1.0253E-03
2 0.000403972527467 4.0397E-04
1 0.000200986516573 2.0099E-04

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants