Package org.jreliability.evaluator
Class MomentEvaluator
java.lang.Object
org.jreliability.evaluator.MomentEvaluator
- All Implemented Interfaces:
Evaluator
The
MomentEvaluator determines the n-th moment of a density
function f(x) given a ReliabilityFunction R(x).E(X^n) = integral_0^infinity x^n f(x) dx.
It performs an integration from 0 to infinity using Romberg's
integration. This is commonly used to derived measures like, e.g., Mean Time
To Failure (MTTF) (E(X)) and its variance (E(X^2)-E(X)^2).
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiondoubleevaluate(ReliabilityFunction reliabilityFunction) Returns the value derived from an integration of theReliabilityFunction.doublegetUpperBound(ReliabilityFunction reliabilityFunction) Returns the calculated upper bound that will be used in the integration process.protected doubleintegrate(ReliabilityFunction reliabilityFunction, double a, double b) Calculates the integral between a and b using Romberg's integration.
-
Field Details
-
epsilon
protected final double epsilonThe allowed errorepsilonfor Romberg's integration. -
n
protected final int nThen-th moment.
-
-
Constructor Details
-
MomentEvaluator
public MomentEvaluator(int n) - Parameters:
n- the n value
-
MomentEvaluator
public MomentEvaluator(int n, double epsilon) - Parameters:
n- the n valueepsilon- the maximum error
-
-
Method Details
-
evaluate
Returns the value derived from an integration of theReliabilityFunction.- Parameters:
reliabilityFunction- the reliabilityFunction- Returns:
- the value derived from the integration of the reliabilityFunction
-
getUpperBound
Returns the calculated upper bound that will be used in the integration process.- Parameters:
reliabilityFunction- the reliabilityFunction- Returns:
- the calculated upper bound that will be used in the integration process
-
integrate
Calculates the integral between a and b using Romberg's integration.- Parameters:
reliabilityFunction- the reliabilityFunctiona- the lower boundb- the upper bound- Returns:
- the value of the integral between a and b
-