Class MomentEvaluator

java.lang.Object
org.jreliability.evaluator.MomentEvaluator
All Implemented Interfaces:
Evaluator

public class MomentEvaluator extends Object implements 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 Details

    • epsilon

      protected final double epsilon
      The allowed error epsilon for Romberg's integration.
    • n

      protected final int n
      The n-th moment.
  • Constructor Details

    • MomentEvaluator

      public MomentEvaluator(int n)
      Constructs a MomentEvaluator for the given n-th moment and a maximum error epsilon of 1.0E-5.
      Parameters:
      n - the n value
    • MomentEvaluator

      public MomentEvaluator(int n, double epsilon)
      Constructs a MomentEvaluator for the given n-th moment and a maximum error epsilon.
      Parameters:
      n - the n value
      epsilon - the maximum error
  • Method Details

    • evaluate

      public double evaluate(ReliabilityFunction reliabilityFunction)
      Returns the value derived from an integration of the ReliabilityFunction.
      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 reliabilityFunction
      a - the lower bound
      b - the upper bound
      Returns:
      the value of the integral between a and b