Skip to content

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

Description

@sitegui

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;

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions