Package org.jreliability.evaluator
Class MomentEvaluator
- java.lang.Object
-
- org.jreliability.evaluator.MomentEvaluator
-
- All Implemented Interfaces:
Evaluator
public class MomentEvaluator extends java.lang.Object implements Evaluator
TheMomentEvaluator
determines then
-th moment of a density functionf(x)
given aReliabilityFunction
R(x)
.
E(X^n) = integral_0^infinity x^n f(x) dx
.It performs an integration from
0
toinfinity
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
).
-
-
Constructor Summary
Constructors Constructor Description MomentEvaluator(int n)
MomentEvaluator(int n, double epsilon)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description double
evaluate(ReliabilityFunction reliabilityFunction)
Returns the value derived from an integration of theReliabilityFunction
.double
getUpperBound(ReliabilityFunction reliabilityFunction)
Returns the calculated upper bound that will be used in the integration process.protected double
integrate(ReliabilityFunction reliabilityFunction, double a, double b)
Calculates the integral between a and b using Romberg's integration.
-
-
-
Method Detail
-
evaluate
public double evaluate(ReliabilityFunction reliabilityFunction)
Returns the value derived from an integration of theReliabilityFunction
.- Parameters:
reliabilityFunction
- the reliabilityFunction- Returns:
- the value derived from the integration of the reliabilityFunction
-
getUpperBound
public double getUpperBound(ReliabilityFunction reliabilityFunction)
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
protected double integrate(ReliabilityFunction reliabilityFunction, double a, double b)
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
-
-