Class BatchResult

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

public class BatchResult extends Object implements Serializable
Container for batch parameter estimation results.

This class holds the results from a Levenberg-Marquardt batch optimization including:

  • Optimized parameter values
  • Parameter uncertainties (standard deviations from covariance matrix)
  • 95% confidence intervals
  • Goodness-of-fit statistics (chi-square, RMSE, R-squared)
  • Convergence information

Usage:


BatchResult result = estimator.solve();

double[] estimates = result.getEstimates();
double[] uncertainties = result.getUncertainties();
double rmse = result.getRMSE();

// Get 95% confidence intervals
double[] lowerCI = result.getConfidenceIntervalLower();
double[] upperCI = result.getConfidenceIntervalUpper();

// Check convergence
if (result.isConverged()) {
  System.out.println("Optimization converged in " + result.getIterations() + " iterations");
}

Version:
1.0
Author:
ESOL
See Also:
  • Field Details

    • serialVersionUID

      private static final long serialVersionUID
      See Also:
    • parameterNames

      private final String[] parameterNames
      Parameter names in order.
    • estimates

      private final double[] estimates
      Optimized parameter values.
    • uncertainties

      private final double[] uncertainties
      Standard deviations of parameter estimates.
    • confidenceIntervalLower

      private final double[] confidenceIntervalLower
      95% confidence interval lower bounds.
    • confidenceIntervalUpper

      private final double[] confidenceIntervalUpper
      95% confidence interval upper bounds.
    • chiSquare

      private final double chiSquare
      Chi-square value (sum of squared weighted residuals).
    • rmse

      private final double rmse
      Root mean square error.
    • meanAbsoluteDeviation

      private final double meanAbsoluteDeviation
      Mean absolute deviation.
    • bias

      private final double bias
      Bias (mean signed deviation).
    • rSquared

      private final double rSquared
      R-squared (coefficient of determination).
    • iterations

      private final int iterations
      Number of iterations used.
    • dataPointCount

      private final int dataPointCount
      Number of data points used.
    • converged

      private final boolean converged
      Whether the optimization converged.
    • covarianceMatrix

      private final double[][] covarianceMatrix
      Covariance matrix of parameter estimates.
    • correlationMatrix

      private final double[][] correlationMatrix
      Correlation matrix of parameter estimates.
  • Constructor Details

    • BatchResult

      public BatchResult(String[] parameterNames, double[] estimates, double[] uncertainties, double chiSquare, int iterations, int dataPointCount, boolean converged)
      Creates a new batch result.
      Parameters:
      parameterNames - names of the parameters
      estimates - optimized parameter values
      uncertainties - standard deviations
      chiSquare - chi-square value
      iterations - number of iterations
      dataPointCount - number of data points
      converged - whether optimization converged
    • BatchResult

      public BatchResult(String[] parameterNames, double[] estimates, double[] uncertainties, double chiSquare, int iterations, int dataPointCount, boolean converged, double[][] covarianceMatrix, double[][] correlationMatrix, double meanAbsoluteDeviation, double bias, double rSquared)
      Full constructor with all statistics.
      Parameters:
      parameterNames - names of the parameters
      estimates - optimized parameter values
      uncertainties - standard deviations
      chiSquare - chi-square value
      iterations - number of iterations
      dataPointCount - number of data points
      converged - whether optimization converged
      covarianceMatrix - parameter covariance matrix
      correlationMatrix - parameter correlation matrix
      meanAbsoluteDeviation - mean absolute deviation
      bias - mean signed deviation
      rSquared - coefficient of determination
  • Method Details

    • getEstimates

      public double[] getEstimates()
      Gets the optimized parameter estimates.
      Returns:
      array of parameter values
    • getEstimate

      public double getEstimate(int index)
      Gets a specific parameter estimate.
      Parameters:
      index - parameter index
      Returns:
      the parameter value
    • getEstimate

      public double getEstimate(String name)
      Gets a specific parameter estimate by name.
      Parameters:
      name - parameter name
      Returns:
      the parameter value, or NaN if not found
    • getUncertainties

      public double[] getUncertainties()
      Gets the parameter uncertainties (standard deviations).
      Returns:
      array of standard deviations
    • getUncertainty

      public double getUncertainty(int index)
      Gets a specific parameter uncertainty.
      Parameters:
      index - parameter index
      Returns:
      the standard deviation
    • getConfidenceIntervalLower

      public double[] getConfidenceIntervalLower()
      Gets the 95% confidence interval lower bounds.
      Returns:
      array of lower bounds
    • getConfidenceIntervalUpper

      public double[] getConfidenceIntervalUpper()
      Gets the 95% confidence interval upper bounds.
      Returns:
      array of upper bounds
    • getParameterNames

      public String[] getParameterNames()
      Gets the parameter names.
      Returns:
      array of parameter names
    • getChiSquare

      public double getChiSquare()
      Gets the chi-square value.
      Returns:
      sum of squared weighted residuals
    • getRMSE

      public double getRMSE()
      Gets the root mean square error.
      Returns:
      RMSE
    • getMeanAbsoluteDeviation

      public double getMeanAbsoluteDeviation()
      Gets the mean absolute deviation.
      Returns:
      mean absolute deviation
    • getBias

      public double getBias()
      Gets the bias (mean signed deviation).
      Returns:
      bias
    • getRSquared

      public double getRSquared()
      Gets the R-squared (coefficient of determination).
      Returns:
      R-squared value
    • getIterations

      public int getIterations()
      Gets the number of iterations used.
      Returns:
      number of iterations
    • getDataPointCount

      public int getDataPointCount()
      Gets the number of data points used.
      Returns:
      number of data points
    • isConverged

      public boolean isConverged()
      Checks if the optimization converged.
      Returns:
      true if converged
    • getCovarianceMatrix

      public double[][] getCovarianceMatrix()
      Gets the covariance matrix.
      Returns:
      the covariance matrix, or null if not computed
    • getCorrelationMatrix

      public double[][] getCorrelationMatrix()
      Gets the correlation matrix.
      Returns:
      the correlation matrix, or null if not computed
    • getDegreesOfFreedom

      public int getDegreesOfFreedom()
      Gets the degrees of freedom (data points - parameters).
      Returns:
      degrees of freedom
    • getReducedChiSquare

      public double getReducedChiSquare()
      Gets the reduced chi-square (chi-square per degree of freedom).
      Returns:
      reduced chi-square
    • toMap

      public Map<String,Double> toMap()
      Converts to a map of parameter names to values.
      Returns:
      map of parameter estimates
    • toCalibrationResult

      public CalibrationResult toCalibrationResult()
      Converts to a CalibrationResult for API compatibility.
      Returns:
      calibration result
    • printSummary

      public void printSummary()
      Prints a summary of the results.
    • printSeparator

      private void printSeparator(int length)
      Prints a separator line.
      Parameters:
      length - length of the separator
    • toString

      public String toString()
      Overrides:
      toString in class Object