Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/basementuniverse/weighted-averages
Various weighted average functions
https://github.com/basementuniverse/weighted-averages
Last synced: 23 days ago
JSON representation
Various weighted average functions
- Host: GitHub
- URL: https://github.com/basementuniverse/weighted-averages
- Owner: basementuniverse
- License: mit
- Created: 2024-02-22T17:53:42.000Z (11 months ago)
- Default Branch: master
- Last Pushed: 2024-02-22T17:54:37.000Z (11 months ago)
- Last Synced: 2024-04-14T04:43:17.077Z (9 months ago)
- Language: TypeScript
- Size: 36.1 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Weighted averages
Various weighted average functions.
## Installation
```
npm install -g @basementuniverse/weighted-averages
```## Usage
```ts
import {
weightedArithmeticMean,
weightedGeometricMean,
inverseWeightedGeometricMean,
weightedHarmonicMean,
inverseWeightedHarmonicMean,
} from '@basementuniverse/weighted-averages';console.log(weightedArithmeticMean([1, 2, 3], [1, 1, 1]));
console.log(weightedGeometricMean([1, 2, 3], [1, 1, 1]));
console.log(inverseWeightedGeometricMean([1, 2, 3], [1, 1, 1]));
console.log(weightedHarmonicMean([1, 2, 3], [1, 1, 1]));
console.log(inverseWeightedHarmonicMean([1, 2, 3], [1, 1, 1]));
```See `demo.html` for a browser-based demo.