# commons-math-interpolation

> A partial port of the Apache Commons Math Interpolation package, including Akima cubic spline interpolation and LOESS/LOWESS local regression.

Latest version **2.2.4** (published 2025-08-16) · MIT license · 1.4K weekly downloads

## Install

```sh
npm install commons-math-interpolation
pnpm add commons-math-interpolation
yarn add commons-math-interpolation
bun add commons-math-interpolation
```

## Health

**Score 55/100 (C)** — status: stable.

Positive: has types; esm support; no vulnerabilities.

Negative: stale.

## Facts

| | |
|---|---|
| Version | 2.2.4 |
| Published | 2025-08-16 |
| First published | 2017-12-29 |
| Weekly downloads | 1.4K |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 0 |
| Unpacked size | 27.2 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 29 |
| Maintainers | chdh |
| Keywords | math, interpolation, akima, cubic spline, LOESS, LOWESS, local regression, apache commons math |

## Links

- npm: https://www.npmjs.com/package/commons-math-interpolation
- Repository: https://github.com/chdh/commons-math-interpolation
- Homepage: http://www.source-code.biz/snippets/typescript/akima
- Issues: https://github.com/chdh/commons-math-interpolation/issues
- npm.io page: https://npm.io/package/commons-math-interpolation

## Alternatives

- [random-seedable](https://npm.io/package/random-seedable.md) — 27.9K weekly downloads
- [n2words](https://npm.io/package/n2words.md) — 22.2K weekly downloads
- [@stdlib/math-base-special-factorialln](https://npm.io/package/@stdlib/math-base-special-factorialln.md) — 5.7K weekly downloads
- [@stdlib/math-base-special-abs2](https://npm.io/package/@stdlib/math-base-special-abs2.md) — 1.7K weekly downloads
- [@guandata/guanvis](https://npm.io/package/@guandata/guanvis.md) — 206 weekly downloads

## Recent versions

- 2.2.4 (latest) — 2025-08-16
- 2.2.3 — 2022-04-21
- 2.2.2 — 2021-01-03
- 2.2.1 — 2019-06-03
- 2.2.0 — 2019-05-29
- 2.1.0 — 2019-04-15
- 2.0.0 — 2019-01-24
- 1.0.1 — 2017-12-29

## README

# commons-math-interpolation

This package is a partial TypeScript port of some Java classes of the [Apache Commons Math library](http://commons.apache.org/math).

The following forms of interpolation are implemented:

- [Akima cubic spline interpolation](https://en.wikipedia.org/wiki/Akima_spline)
- [Natural cubic spline interpolation](https://en.wikipedia.org/wiki/Spline_interpolation)
- [Linear interpolation](https://en.wikipedia.org/wiki/Linear_interpolation)
- [Nearest neighbor interpolation](https://en.wikipedia.org/wiki/Nearest-neighbor_interpolation)

The interpolators work on a dataset of x/y points (knots).

Additionally, a local regression algorithm is implemented that can be used in conjunction with the above interpolators.

- [LOESS/LOWESS local regression](https://en.wikipedia.org/wiki/Local_regression)

Interpolation demo: [www.source-code.biz/snippets/typescript/akima](http://www.source-code.biz/snippets/typescript/akima)<br>
LOESS demo: [www.source-code.biz/snippets/typescript/loess](http://www.source-code.biz/snippets/typescript/loess)<br>
NPM package: [commons-math-interpolation](https://www.npmjs.com/package/commons-math-interpolation)

---
_Source: https://npm.io/package/commons-math-interpolation · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
