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

Calculate the coefficient of variation without calculating the mean twice? #175

Open
Boscop opened this issue Dec 7, 2022 · 1 comment

Comments

@Boscop
Copy link

Boscop commented Dec 7, 2022

With this crate, is it possible to calculate the coefficient of variation / relative std dev (data.std_dev()/data.mean()) without calculating the mean twice?

@YeungOnion
Copy link
Contributor

If the distribution is specified by a family of distributions, e.g. Normal, Exponential, then it certainly won't need to be computed twice.

If however, you need to determine this from data, perhaps from an iterable, then the Empirical distribution's implementation add to add a datum will stream the variance and mean.

average may also be useful for you.

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