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
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