-
Notifications
You must be signed in to change notification settings - Fork 40
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Throw an error when passing empty input to
cov
(#93)
74897fe unintentionnally changed the behavior of `cov`, which now allows passing two empty vectors instead of throwing an error. This is inconsistent with `cor`. If we wanted to return a value, `NaN` would be more appropriate and consistent with `var`, but for now make this an error again. Also add tests to cover all empty inputs for similar functions. Unfortunately it turns out we are quite inconsistent already, as `cor` and `cov` allow empty matrices already, but `cov` returns `-0.0` while `cor`, `std` and `var` return `NaN`.
- Loading branch information
Showing
2 changed files
with
33 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters