Skip to content
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

Open
wants to merge 17 commits into
base: master
Choose a base branch
from
Open

Conversation

latture
Copy link
Contributor

@latture latture commented Oct 24, 2018

A new function isSlowerThan has been added to the Stopwatch. 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:

@latture latture requested a review from a team October 24, 2018 23:19
@latture latture force-pushed the feature/one-sided-confidence branch from 247703e to a1185c8 Compare October 25, 2018 01:33
val tDist = new TDistribution(sampleSize - 1)
val tAlpha = tDist.inverseCumulativeProbability(falsePositive)
val tBeta = tDist.inverseCumulativeProbability(falseNegative)
val delta = sampleMean - time - minimumTimeDifference
Copy link
Contributor

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)
Copy link
Contributor

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.
@latture latture force-pushed the feature/one-sided-confidence branch from ff9b211 to d96c346 Compare October 25, 2018 14:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants