Class EstimationTestHarness

java.lang.Object
neqsim.process.calibration.EstimationTestHarness
All Implemented Interfaces:
Serializable

public class EstimationTestHarness extends Object implements Serializable
Test harness for validating parameter estimation systems before deployment.

This class provides a framework for testing estimation algorithms (EnKF, Gauss-Newton, etc.) using synthetic data with known ground truth, ensuring the estimator works correctly before being deployed with real plant data.

Key Testing Capabilities:

  • Convergence testing - verify estimator converges to true values
  • Noise robustness - test performance under various noise levels
  • Outlier robustness - verify estimator handles bad data
  • Drift tracking - test detection of parameter changes over time
  • Monte Carlo validation - statistical confidence in estimates

Usage Example:


// Create test harness
EstimationTestHarness harness = new EstimationTestHarness(processSystem);

// Define parameters and measurements
harness.addParameter("Pipe1.heatTransferCoefficient", 12.0); // true value = 12.0
harness.addParameter("Pipe2.heatTransferCoefficient", 18.0);
harness.addMeasurement("HPManifold.temperature", "C", 0.5);

// Run convergence test
TestReport report = harness.runConvergenceTest(estimator, 50);

// Check results
if (report.passes(criteria)) {
  System.out.println("Ready for deployment!");
}

Version:
1.0
Author:
NeqSim Development Team
See Also:
  • Field Details

  • Constructor Details

    • EstimationTestHarness

      public EstimationTestHarness(ProcessSystem processSystem)
      Creates a test harness for a process system.
      Parameters:
      processSystem - the process system to test with
  • Method Details

    • setSeed

      public EstimationTestHarness setSeed(long seed)
      Sets the random seed for reproducibility.
      Parameters:
      seed - random seed
      Returns:
      this harness for chaining
    • addParameter

      public EstimationTestHarness addParameter(String path, double trueValue)
      Adds a parameter with known true value.
      Parameters:
      path - variable path
      trueValue - ground truth value
      Returns:
      this harness for chaining
    • addParameter

      public EstimationTestHarness addParameter(String path, double trueValue, double minBound, double maxBound)
      Adds a parameter with known true value and bounds.
      Parameters:
      path - variable path
      trueValue - ground truth value
      minBound - minimum bound
      maxBound - maximum bound
      Returns:
      this harness for chaining
    • addMeasurement

      public EstimationTestHarness addMeasurement(String path, String unit, double noiseStd)
      Adds a measurement variable.
      Parameters:
      path - variable path
      unit - unit of measurement
      noiseStd - measurement noise standard deviation
      Returns:
      this harness for chaining
    • generateMeasurement

      public Map<String,Double> generateMeasurement(double noiseMultiplier)
      Generates synthetic measurements using true parameter values.
      Parameters:
      noiseMultiplier - multiplier for noise level
      Returns:
      map of measurement path to noisy value
    • runConvergenceTest

      public EstimationTestHarness.TestReport runConvergenceTest(EnKFParameterEstimator estimator, int numSteps)
      Runs a convergence test.
      Parameters:
      estimator - the estimator to test
      numSteps - number of update steps
      Returns:
      test report
    • runConvergenceTest

      public EstimationTestHarness.TestReport runConvergenceTest(EnKFParameterEstimator estimator, int numSteps, double noiseMultiplier, Consumer<Integer> progressCallback)
      Runs a convergence test with optional progress callback.
      Parameters:
      estimator - the estimator to test
      numSteps - number of update steps
      noiseMultiplier - noise level multiplier
      progressCallback - optional callback for progress updates
      Returns:
      test report
    • runNoiseRobustnessTest

      public Map<Double, EstimationTestHarness.TestReport> runNoiseRobustnessTest(EnKFParameterEstimator estimator, int stepsPerLevel, double[] noiseLevels)
      Runs a noise robustness test at multiple noise levels.
      Parameters:
      estimator - the estimator to test
      stepsPerLevel - steps at each noise level
      noiseLevels - array of noise multipliers to test
      Returns:
      map of noise level to test report
    • runDriftTrackingTest

      public EstimationTestHarness.TestReport runDriftTrackingTest(EnKFParameterEstimator estimator, int numSteps, int driftingParamIndex, double driftRate)
      Runs a parameter drift tracking test.
      Parameters:
      estimator - the estimator to test
      numSteps - number of steps
      driftingParamIndex - which parameter drifts
      driftRate - rate of drift per step
      Returns:
      test report with tracking accuracy
    • runMonteCarloValidation

      public EstimationTestHarness.MonteCarloReport runMonteCarloValidation(Supplier<EnKFParameterEstimator> estimatorFactory, int numTrials, int stepsPerTrial)
      Runs Monte Carlo validation with multiple trials.
      Parameters:
      estimatorFactory - factory to create fresh estimator instances
      numTrials - number of Monte Carlo trials
      stepsPerTrial - steps per trial
      Returns:
      summary statistics across all trials