Class MomentEvaluator

  • All Implemented Interfaces:
    Evaluator

    public class MomentEvaluator
    extends java.lang.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 Summary

      Fields 
      Modifier and Type Field Description
      protected double epsilon
      The allowed error epsilon for Romberg's integration.
      protected int n
      The n-th moment.
    • Constructor Summary

      Constructors 
      Constructor Description
      MomentEvaluator​(int n)
      Constructs a MomentEvaluator for the given n-th moment and a maximum error epsilon of 1.0E-5.
      MomentEvaluator​(int n, double epsilon)
      Constructs a MomentEvaluator for the given n-th moment and a maximum error epsilon.
    • Field Detail

      • epsilon

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

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

      • 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 Detail

      • 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