-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feature/one sided confidence #10
base: master
Are you sure you want to change the base?
Conversation
…and standard deviation. Added function to test whether a function is slower than a specified time.
…m a measured time less than the hypothesized time.
…ull hypothesis is rejected.
247703e
to
a1185c8
Compare
val tDist = new TDistribution(sampleSize - 1) | ||
val tAlpha = tDist.inverseCumulativeProbability(falsePositive) | ||
val tBeta = tDist.inverseCumulativeProbability(falseNegative) | ||
val delta = sampleMean - time - minimumTimeDifference |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do the signs work out here? I would think it is Math.max(0.0, Math.abs(sampleMean-time) - minimumTimeDifference)
val tAlpha = tDist.inverseCumulativeProbability(falsePositive) | ||
val tBeta = tDist.inverseCumulativeProbability(falseNegative) | ||
val delta = sampleMean - time - minimumTimeDifference | ||
val tRequiredSampleSize = Math.pow(sampleStd * (tAlpha + tBeta) / delta, 2) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This symmetric treatment of tAlpha
and tBeta
wrt signum(sampleMean - time)
strikes me as maybe not right. Do we get the expected behavior when FP is very low, FN is very high, and sampleMean << time or sampleMean >> time ?
…ne an execution block is slower than the specified time.
ff9b211
to
d96c346
Compare
…owerThan when the sample mean is lower than the hypothesized time.
…g the null hypothesis.
A new function
isSlowerThan
has been added to theStopwatch
. This function will determine whether a function's execution time is slower than a specified time with given false positive and false negative rates. There is also an option to exit the evaluation early if the measured duration is clearly larger or smaller than the hypothesis.The function works by calculating the required sample size to achieve the requested false positive and false negative rates using the equation found here. If the number of samples exceeds this value, the hypothesis is tested.
More testing is needed. Opening for visibility.
Sources: