Class BatchResult
java.lang.Object
neqsim.process.calibration.BatchResult
- All Implemented Interfaces:
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 Summary
FieldsModifier and TypeFieldDescriptionprivate final doubleBias (mean signed deviation).private final doubleChi-square value (sum of squared weighted residuals).private final double[]95% confidence interval lower bounds.private final double[]95% confidence interval upper bounds.private final booleanWhether the optimization converged.private final double[][]Correlation matrix of parameter estimates.private final double[][]Covariance matrix of parameter estimates.private final intNumber of data points used.private final double[]Optimized parameter values.private final intNumber of iterations used.private final doubleMean absolute deviation.private final String[]Parameter names in order.private final doubleRoot mean square error.private final doubleR-squared (coefficient of determination).private static final longprivate final double[]Standard deviations of parameter estimates. -
Constructor Summary
ConstructorsConstructorDescriptionBatchResult(String[] parameterNames, double[] estimates, double[] uncertainties, double chiSquare, int iterations, int dataPointCount, boolean converged) Creates a new batch result.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. -
Method Summary
Modifier and TypeMethodDescriptiondoublegetBias()Gets the bias (mean signed deviation).doubleGets the chi-square value.double[]Gets the 95% confidence interval lower bounds.double[]Gets the 95% confidence interval upper bounds.double[][]Gets the correlation matrix.double[][]Gets the covariance matrix.intGets the number of data points used.intGets the degrees of freedom (data points - parameters).doublegetEstimate(int index) Gets a specific parameter estimate.doublegetEstimate(String name) Gets a specific parameter estimate by name.double[]Gets the optimized parameter estimates.intGets the number of iterations used.doubleGets the mean absolute deviation.String[]Gets the parameter names.doubleGets the reduced chi-square (chi-square per degree of freedom).doublegetRMSE()Gets the root mean square error.doubleGets the R-squared (coefficient of determination).double[]Gets the parameter uncertainties (standard deviations).doublegetUncertainty(int index) Gets a specific parameter uncertainty.booleanChecks if the optimization converged.private voidprintSeparator(int length) Prints a separator line.voidPrints a summary of the results.Converts to aCalibrationResultfor API compatibility.toMap()Converts to a map of parameter names to values.toString()
-
Field Details
-
serialVersionUID
private static final long serialVersionUID- See Also:
-
parameterNames
Parameter names in order. -
estimates
private final double[] estimatesOptimized parameter values. -
uncertainties
private final double[] uncertaintiesStandard deviations of parameter estimates. -
confidenceIntervalLower
private final double[] confidenceIntervalLower95% confidence interval lower bounds. -
confidenceIntervalUpper
private final double[] confidenceIntervalUpper95% confidence interval upper bounds. -
chiSquare
private final double chiSquareChi-square value (sum of squared weighted residuals). -
rmse
private final double rmseRoot mean square error. -
meanAbsoluteDeviation
private final double meanAbsoluteDeviationMean absolute deviation. -
bias
private final double biasBias (mean signed deviation). -
rSquared
private final double rSquaredR-squared (coefficient of determination). -
iterations
private final int iterationsNumber of iterations used. -
dataPointCount
private final int dataPointCountNumber of data points used. -
converged
private final boolean convergedWhether the optimization converged. -
covarianceMatrix
private final double[][] covarianceMatrixCovariance matrix of parameter estimates. -
correlationMatrix
private final double[][] correlationMatrixCorrelation 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 parametersestimates- optimized parameter valuesuncertainties- standard deviationschiSquare- chi-square valueiterations- number of iterationsdataPointCount- number of data pointsconverged- 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 parametersestimates- optimized parameter valuesuncertainties- standard deviationschiSquare- chi-square valueiterations- number of iterationsdataPointCount- number of data pointsconverged- whether optimization convergedcovarianceMatrix- parameter covariance matrixcorrelationMatrix- parameter correlation matrixmeanAbsoluteDeviation- mean absolute deviationbias- mean signed deviationrSquared- 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
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
-
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
-
toCalibrationResult
Converts to aCalibrationResultfor 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
-