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

Should a single sample's variance being zero be acceptable? #1

Open
sitegui opened this issue May 9, 2021 · 1 comment
Open

Should a single sample's variance being zero be acceptable? #1

sitegui opened this issue May 9, 2021 · 1 comment

Comments

@sitegui
Copy link

sitegui commented May 9, 2021

Hello,

First of all, thanks for taking the time to write the awesome introduction! I've learned a lot :)

I was reading the code and the error Error::ZeroVariance returned here got me thinking: does it make sense for confidence_interval() to only return this error when both the samples have a zero variance?

Numerically, when both are zero we have a problem (v would divide by zero). But when only one is zero (let's say x.var), the code would collapse to:

// Estimate the variance of the `y.mean - x.mean`
let var_delta = y.mean_var();

// Approximate the degrees of freedom of `var_delta`
let v = (y.count - 1) as f64;
@asayers
Copy link
Owner

asayers commented May 17, 2021

Thanks for taking a look at the code! I think what you’re saying makes sense. I can imagine a situation where one of the benchmarks is so reliable that it always gives the same answer (ie. the true distribution is a delta function). In this case I think the CI for the difference in the means should just be the CI for the mean of the unreliable benchmark with an offset.

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

No branches or pull requests

2 participants