Record Class DistributionComparison
java.lang.Object
java.lang.Record
com.amalgamasimulation.core.statistics.DistributionComparison
public record DistributionComparison(DistributionStatistics baseline, DistributionStatistics subject)
extends Record
Compares two
DistributionStatistics instances (baseline vs. subject)
and provides methods to assess relative magnitude and statistical
significance.-
Constructor Summary
ConstructorsConstructorDescriptionDistributionComparison(DistributionStatistics baseline, DistributionStatistics subject) Creates an instance of aDistributionComparisonrecord class. -
Method Summary
Modifier and TypeMethodDescriptionbaseline()Returns the value of thebaselinerecord component.Returns the 95% confidence interval for the baseline.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.booleanReturns true if the subject average is greater than the baseline average.booleanReturns true if the subject average is less than or equal to the baseline average.booleanChecks if the subject average is significantly higher than the baseline, using the upper bound of the baseline's 95% confidence interval.booleanChecks if the subject average is significantly lower than the baseline, using the lower bound of the baseline's 95% confidence interval.subject()Returns the value of thesubjectrecord component.Returns the 95% confidence interval for the subject.doubleReturns the relative difference of subject to baseline means.doubleReturns the relative difference between subject mean and the upper bound of the baseline 95% confidence interval.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
DistributionComparison
Creates an instance of aDistributionComparisonrecord class.- Parameters:
baseline- the value for thebaselinerecord componentsubject- the value for thesubjectrecord component
-
-
Method Details
-
baselineConfidenceInterval
Returns the 95% confidence interval for the baseline. -
subjectConfidenceInterval
Returns the 95% confidence interval for the subject. -
isSignificantlyLessThanBaseline
public boolean isSignificantlyLessThanBaseline()Checks if the subject average is significantly lower than the baseline, using the lower bound of the baseline's 95% confidence interval. -
isSignificantlyGreaterThanBaseline
public boolean isSignificantlyGreaterThanBaseline()Checks if the subject average is significantly higher than the baseline, using the upper bound of the baseline's 95% confidence interval. -
isGreaterThanBaseline
public boolean isGreaterThanBaseline()Returns true if the subject average is greater than the baseline average. -
isLessThanBaseline
public boolean isLessThanBaseline()Returns true if the subject average is less than or equal to the baseline average. -
subjectToBaselineRelativeDifference
public double subjectToBaselineRelativeDifference()Returns the relative difference of subject to baseline means.- Returns:
- (subject - baseline) / baseline
-
subjectToBaselineUpperIntervalBoundDifference
public double subjectToBaselineUpperIntervalBoundDifference()Returns the relative difference between subject mean and the upper bound of the baseline 95% confidence interval.- Returns:
- (subject - baselineConfidenceInterval().max()) / baselineConfidenceInterval().max()
-
toString
Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components. -
hashCode
public final int hashCode()Returns a hash code value for this object. The value is derived from the hash code of each of the record components. -
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared withObjects::equals(Object,Object). -
baseline
Returns the value of thebaselinerecord component.- Returns:
- the value of the
baselinerecord component
-
subject
Returns the value of thesubjectrecord component.- Returns:
- the value of the
subjectrecord component
-