stdlib-js / stdlib-js/stdlib

Incremental skewness and other higher moments when provided equal values do not yield expected results

Đang mở
#287 1 bình luận 0 reaction 0 người được giao Xem trên GitHub
Bug Math Statistics
Ngôn ngữ chính
JavaScript
Star
6k
Fork
1.3k
Merge trung bình
1 ngày 3 giờ
Pull request đã merge (30 ngày)
611

Mô tả

## Checklist

> Please ensure the following tasks are completed before filing a bug report.

- [x] Read and understood the [Code of Conduct][code-of-conduct].
- [x] Searched for existing issues and pull requests.

## Description

> Description of the issue.

Encountered a potential bug when using the incremental accumulators for skewness and kurtosis. Notably, when providing all equal values, the accumulators return `NaN`. However, for uniformly distributed values, the skewness is `0`.

## Related Issues

> Does this issue have any related issues?

No related issues in this repository. However, Pandas seems to have encountered a similar issue: https://github.com/pandas-dev/pandas/issues/18044.

## Questions

> Any questions for reviewers?

No.

## Other

> Any other information relevant to this issue? This may include screenshots, references, stack traces, sample output, and/or implementation notes.

No.

#### Demo

> If relevant, provide a link to a live demo.

N/A

#### Reproduction

> What steps are required to reproduce the unexpected output?

In order to reproduce this bug, do the following:

```javascript
var incrskewness = require( '@stdlib/stats/incr/skewness' );

var acc = incrskewnesss();

for ( var i = 0; i < 100; i++ ) {
acc( 10.0 );
}
console.log( acc() );
// => NaN
```

#### Expected Results

> What are the expected results?

The following results are expected:

```text
0
```

#### Actual Results

> What are the actual results?

The following are the actual results:

```text
NaN
```

#### Environments

> What environments are affected (e.g., `Node v0.4.x`, `Chrome`, `IE 11`)? If Node.js, include the `npm` version, operating system, and any other potentially relevant platform information.

All environments are affected.

[code-of-conduct]: https://github.com/stdlib-js/stdlib/blob/develop/CODE_OF_CONDUCT.md

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Đánh giá

Issue này chưa được đánh giá.

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.