Class MeasurementSeries<Q extends Quantity<Q>>

java.lang.Object
org.episteme.core.measure.metrology.MeasurementSeries<Q>

public class MeasurementSeries<Q extends Quantity<Q>> extends Object
Statistical analysis of repeated measurements.

Collects multiple measurements of the same quantity and provides statistical analysis including mean, standard deviation, confidence intervals, and outlier detection.

Example Usage:

Since:
1.0
Author:
Silvere Martin-Michiellot, Gemini AI (Google DeepMind)
  • Constructor Details

    • MeasurementSeries

      public MeasurementSeries()
  • Method Details

    • addMeasurement

      public void addMeasurement(Quantity<Q> value)
      Adds a measurement to the series.
      Parameters:
      value - the measured value
    • getCount

      public int getCount()
      Returns the number of measurements.
      Returns:
      the count
    • getMean

      public Quantity<Q> getMean()
      Returns the arithmetic mean of all measurements.
      Returns:
      the mean value
      Throws:
      IllegalStateException - if no measurements
    • getStandardDeviation

      public Quantity<Q> getStandardDeviation()
      Returns the sample standard deviation.

      Uses Bessel's correction (n-1 denominator).

      Returns:
      the standard deviation
      Throws:
      IllegalStateException - if fewer than 2 measurements
    • getStandardError

      public Quantity<Q> getStandardError()
      Returns the standard error of the mean (SEM).

      SEM = σ / √n

      Returns:
      the standard error
    • getConfidenceInterval

      public MeasuredQuantity<Q> getConfidenceInterval(double confidenceLevel)
      Returns a measurement with confidence interval.

      For normal distributions:

      • 68.3% → mean ± 1×SEM
      • 95.4% → mean ± 2×SEM
      • 99.7% → mean ± 3×SEM
      Parameters:
      confidenceLevel - the confidence level (e.g., 0.95)
      Returns:
      the mean with uncertainty
    • detectOutliers

      public Set<Quantity<Q>> detectOutliers(MeasurementSeries.OutlierMethod method)
      Detects outliers using the specified method.
      Parameters:
      method - the outlier detection method
      Returns:
      the set of detected outliers
    • getMeanExcludingOutliers

      public MeasuredQuantity<Q> getMeanExcludingOutliers()
      Returns the mean excluding detected outliers.
      Returns:
      the trimmed mean with confidence interval