|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.opensha.commons.calc.GaussianDistCalc
public final class GaussianDistCalc
Title: GaussianDistCalc.java
Description:
This utility calculates the probability of exceedance assuming a gaussian distribution. The object edu.uah.math.psol.distributions.NormalDistribution is not used here because it was found to be ~3 times slower (see the getCDF_Alt() method commented out).
| Constructor Summary | |
|---|---|
GaussianDistCalc()
|
|
| Method Summary | |
|---|---|
static double |
getCDF(double standRandVariable)
This function calculates the cumulative density function for a Gaussian distribution (the area under the curve up to standRandVariable). |
static double |
getExceedProb(double standRandVariable)
|
static double |
getExceedProb(double standRandVariable,
double lowerTruncLevel,
double upperTruncLevel)
This function calculates the exceedance probability for a truncated Gaussian distribution. |
static double |
getExceedProb(double standRandVariable,
int truncType,
double truncLevel)
This function calculates the exceedance probability for a truncated Gaussian distribution. |
static double |
getStandRandVar(double exceedProb,
double lowerTruncLevel,
double upperTruncLevel,
double tolerance)
This returns the standardized random variable (SRV) associated with the given exceedance probability. |
static double |
getStandRandVar(double exceedProb,
int truncType,
double truncLevel,
double tolerance)
This returns the standardized random variable (SRV) associated with the given exceedance probability. |
static void |
main(String[] args)
main method for running tests |
static void |
test_symmetry_getStandRandVar()
|
static boolean |
test1_getStandRandVar(double tol,
int trTyp,
double trLev)
This method tests the getStandRandVar() method over a wide range of input probabilities for a given tolerance, truncation type, and truncation value (the range of probabilites tested are those computed from getExceedProb() for SRV from -7.5 to 7.5). |
static void |
test2_getStandRandVar()
This runs test1_getStandRandVar() over a range of tolerances, truncation types, and trucation levels. |
static void |
testSpeed_getStandRandVar()
This tests the influence of tolerance on performance. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public GaussianDistCalc()
| Method Detail |
|---|
public static double getExceedProb(double standRandVariable)
public static double getExceedProb(double standRandVariable,
int truncType,
double truncLevel)
standRandVariable - truncType - set 0 for none, 1 for upper only, and 2 for two sidedtruncLevel - in units of SRV (must be positive, and can't = 0.0 for truncType = 2)
public static double getExceedProb(double standRandVariable,
double lowerTruncLevel,
double upperTruncLevel)
standRandVariable - lowerTruncLevel - in units of SRVupperTruncLevel - in units of SRV
public static double getCDF(double standRandVariable)
public static double getStandRandVar(double exceedProb,
int truncType,
double truncLevel,
double tolerance)
exceedProb - The target exceedance probabilitytruncType - The truncation typetruncLevel - The truncation level (num SRVs)tolerance - The tolerance
public static double getStandRandVar(double exceedProb,
double lowerTruncLevel,
double upperTruncLevel,
double tolerance)
exceedProb - The target exceedance probabilitylowerTruncLevel - The lower truncation level must be < 0upperTruncLevel - The upper truncation level must be ??? 0tolerance - The tolerance
public static boolean test1_getStandRandVar(double tol,
int trTyp,
double trLev)
tol - tolerancetrTyp - truncation typetrLev - truncation level
public static void test2_getStandRandVar()
public static void testSpeed_getStandRandVar()
public static void test_symmetry_getStandRandVar()
public static void main(String[] args)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||