Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/ndabap/lorenz-curve

NOT MAINTAINED Get the lorenz curve of a given data set
https://github.com/ndabap/lorenz-curve

javascript lorenz math statistics

Last synced: 1 day ago
JSON representation

NOT MAINTAINED Get the lorenz curve of a given data set

Awesome Lists containing this project

README

        

# NOT MAINTAINED lorenz-curve

## Installation
```
npm install lorenz-curve --save
```

## API
### `lorenzCurve(data: Number[], precision: Number)`

| Parameter | Type | Description |
|-------------|-------------------|-----------------------------------|
| `data` | `Number[]` | Data set |
| `precision` | `Number` | Precision for ratios (default: 2) |

## Usage

```js
import lorenzCurve from 'lorenz-curve'
import * as assert from 'assert'

const {x, y} = lorenzCurve([3, 4, 5, 5, 18])

assert.deepEqual(x, [0.2, 0.4, 0.6, 0.8, 1])
assert.deepEqual(y, [0.09, 0.2, 0.34, 0.49, 1])
```

If you are using `require`, you have to attach `.default`.

## Author

[Julian Claus](https://www.julian-claus.de) and contributors.

## License

MIT