correlation
correlation
¶
Classes for enforcing correlations between branches in logic trees
Correlation
dataclass
¶
A correlation between BranchSets of a logic tree. Correlations are used when buiding combinations of branches from differnt BranchSets.
For example, if a logic tree contains branchets A and B each with branches A1, A2 and B1, B2, respectivly, then a correlation A1, B1 will only allow A1-B1 not A1-B2 as valid composite branches.
The primary_brach will not appear in combination with any branches except those identified in associated_branches for the relevent BranchSets
Parameters:
Name | Type | Description | Default |
---|---|---|---|
primary_branch
|
Branch
|
the branch that MUST be correlated with the associated brances. |
Branch()
|
associated_branches
|
List[Branch]
|
list of branches that the primary_branch must always be coupled with. |
list()
|
weight
|
Optional[float]
|
weight used for composite branch formed by correlation. Defaults to weight of primary_branch |
None
|
Source code in nzshm_model/logic_tree/correlation.py
12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 |
|
LogicTreeCorrelations
dataclass
¶
Bases: Sequence
All correlations for a logic tree.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
correlation_groups
|
List[Correlation]
|
list of correlations to be applied to the logic tree branch sets. |
list()
|
Source code in nzshm_model/logic_tree/correlation.py
48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 |
|
primary_branches()
¶
Yield the primary branches of all correlation_groups
Returns:
Type | Description |
---|---|
None
|
branches |
Source code in nzshm_model/logic_tree/correlation.py
62 63 64 65 66 67 68 69 70 |
|