A probability range used to dictate the set of ordered trial losses in a loss distribution that should be selected during a metrics request. Includes additional features for defining probability windows in different way, as well as implementing the IEquatable interface so that these instances can be used as Dictionary Keys.
More...
|
| ProbabilityWindow (double min, double max) |
| Constructs a probability window from a min and max probability.
|
|
override bool | Equals (object obj) |
|
bool | Equals (ProbabilityWindow other) |
| Determines whether the specified probability windows have precisely the same minimum and maximum.
|
|
override int | GetHashCode () |
|
virtual T | ShallowCopy< T > () |
| Create a shallow copy of this object. - See also
- ExtensionMethods.DeepCopy<T>
for a serializer-based copy method.
|
|
override string | ToString () |
|
|
static ProbabilityWindow | FromReturnPeriods (double starting_return_period, double ending_return_period) |
| Create a probability window from return period window.
|
|
static implicit | operator ProbabilityWindow (double tail) |
| Obsolete. You should explicitly create a probability window for a tail distribution using Tail(Double) if that is your intention. Automatically converts a double probability into a tail window.
|
|
static ProbabilityWindow | Tail (double tail_probability) |
| Returns a window representing the tail probability range [0, tail_probability], such that all losses larger than the trial indicated by the specified probability will be included in the metrics.
|
|
|
virtual void | AfterMembersCloned (APIType originalResource) |
| Invoked following construction if the current instance has been created using a member-wise clone of some other instance. Override if your derived APIType class contains some members that should not be cloned.
|
|
|
static ProbabilityWindow | All [get] |
| Returns a window representing the full probability range [0, 1], such that all trial losses will be included in the requested metrics.
|
|
double | max_probability [get] |
| The inclusive upper-bound of the probability window, which will correspond to the smallest trial loss that will be included in the metrics.
|
|
double | min_probability [get] |
| The inclusive lower-bound of the probability window, which will correspond to the largest trial loss that will be included in the metrics.
|
|
A probability range used to dictate the set of ordered trial losses in a loss distribution that should be selected during a metrics request. Includes additional features for defining probability windows in different way, as well as implementing the IEquatable interface so that these instances can be used as Dictionary Keys.
Definition at line 11 of file ProbabilityWindow.cs.
◆ ProbabilityWindow()
AnalyzeRe.ProbabilityWindow.ProbabilityWindow |
( |
double |
min, |
|
|
double |
max |
|
) |
| |
|
inline |
Constructs a probability window from a min and max probability.
- Parameters
-
min | The min_probability to use. The minimum probability must be between zero (inclusive) and one (exclusive), and must be less than or equal to the maximum probability. |
max | The max_probability to use. The maximum probability must be between zero (exclusive) and one (inclusive), and must be greater than or equal to the minimum probability. |
Definition at line 45 of file ProbabilityWindow.cs.
◆ AfterMembersCloned()
virtual void AnalyzeRe.APIType.AfterMembersCloned |
( |
APIType |
originalResource | ) |
|
|
inlineprotectedvirtualinherited |
Invoked following construction if the current instance has been created using a member-wise clone of some other instance. Override if your derived APIType class contains some members that should not be cloned.
Overriding implementations should be sure to invoke base.AfterMembersCloned().
A sane question for a code reviewer to ask might be: "Why not avoid copying those members in the first place?" The answer is that there is no framework-supported method of excluding members from a MemberwiseClone. The only officially supported solution is to not use the object.MemberwiseClone method at all and instead have each class implement it's own Copy method. In our case, most objects have no need to specialize their copy implementation (even though they could - the ShallowCopy<T> method is marked virtual). It's simpler to simply "correct" any special-case members after the fact, and requires less error-prone code than if the code were responsible for ensuring no members were missed in a copy. It's also faster than any reflection-based approach, even though such an approach could benefit from custom attributes meant to exclude certain members from copying.
Reimplemented in AnalyzeRe.APITypes.APIResource_WithDataEndpoint, AnalyzeRe.APIResourceView.BaseAPIResourceView, AnalyzeRe.Distributions.CustomDistribution, AnalyzeRe.LossSets.LossSet_WithData, AnalyzeRe.Optimization.Candidate, AnalyzeRe.Optimization.OptimizationView, and AnalyzeRe.StaticSimulation.
Definition at line 37 of file APIType.cs.
◆ Equals() [1/2]
override bool AnalyzeRe.ProbabilityWindow.Equals |
( |
object |
obj | ) |
|
◆ Equals() [2/2]
Determines whether the specified probability windows have precisely the same minimum and maximum.
Note: This does not compare doubles directly, otherwise double precision might result in determining two ProbabilityWindows are not equal when they should be considered equivalent. Instead, this determines whether the min and max probabilities are guaranteed to result in the same trial selection.
◆ FromReturnPeriods()
static ProbabilityWindow AnalyzeRe.ProbabilityWindow.FromReturnPeriods |
( |
double |
starting_return_period, |
|
|
double |
ending_return_period |
|
) |
| |
|
static |
Create a probability window from return period window.
- Parameters
-
starting_return_period | The starting return period for which to return metrics. This is equivalent to one over the maximum probability of a probability window. |
ending_return_period | The ending return period for which to return metrics. This is equivalent to one over the minimum probability of a probability window. |
◆ GetHashCode()
override int AnalyzeRe.ProbabilityWindow.GetHashCode |
( |
| ) |
|
◆ operator ProbabilityWindow()
static implicit AnalyzeRe.ProbabilityWindow.operator ProbabilityWindow |
( |
double |
tail | ) |
|
|
static |
Obsolete. You should explicitly create a probability window for a tail distribution using Tail(Double) if that is your intention. Automatically converts a double probability into a tail window.
- Parameters
-
tail | The tail distribution probability. |
◆ ShallowCopy< T >()
virtual T AnalyzeRe.APIType.ShallowCopy< T > |
( |
| ) |
|
|
inlinevirtualinherited |
Create a shallow copy of this object.
- See also
- ExtensionMethods.DeepCopy<T>
for a serializer-based copy method.
- Returns
- A shallow copy of this object.
If this object contains any members that reference the current object (this), the class should override this method to avoid cloning a reference to the old class.
Implements AnalyzeRe.IAPIType.
Definition at line 14 of file APIType.cs.
◆ Tail()
Returns a window representing the tail probability range [0, tail_probability], such that all losses larger than the trial indicated by the specified probability will be included in the metrics.
- Parameters
-
tail_probability | The tail distribution probability |
◆ ToString()
override string AnalyzeRe.ProbabilityWindow.ToString |
( |
| ) |
|
- Returns
- The probability window in the format that it appears in a request URL e.g. min_probability of 0.2 and max of 0.5 returns "0.2_0.5".
◆ All
Returns a window representing the full probability range [0, 1], such that all trial losses will be included in the requested metrics.
Definition at line 73 of file ProbabilityWindow.cs.
◆ max_probability
double AnalyzeRe.ProbabilityWindow.max_probability |
|
get |
The inclusive upper-bound of the probability window, which will correspond to the smallest trial loss that will be included in the metrics.
Definition at line 36 of file ProbabilityWindow.cs.
◆ min_probability
double AnalyzeRe.ProbabilityWindow.min_probability |
|
get |
The inclusive lower-bound of the probability window, which will correspond to the largest trial loss that will be included in the metrics.
Definition at line 31 of file ProbabilityWindow.cs.
The documentation for this class was generated from the following file: