Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/stdlib-js/math-base-special-boxcox1pinv
Compute the inverse of a one-parameter Box-Cox transformation for 1+x.
https://github.com/stdlib-js/math-base-special-boxcox1pinv
box-cox boxcox inverse javascript math mathematics node node-js nodejs power power-transform stdlib transform transformation
Last synced: about 2 months ago
JSON representation
Compute the inverse of a one-parameter Box-Cox transformation for 1+x.
- Host: GitHub
- URL: https://github.com/stdlib-js/math-base-special-boxcox1pinv
- Owner: stdlib-js
- License: apache-2.0
- Created: 2021-06-15T17:04:22.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2024-10-01T11:41:02.000Z (3 months ago)
- Last Synced: 2024-10-02T06:23:27.655Z (3 months ago)
- Topics: box-cox, boxcox, inverse, javascript, math, mathematics, node, node-js, nodejs, power, power-transform, stdlib, transform, transformation
- Language: Python
- Homepage: https://github.com/stdlib-js/stdlib
- Size: 897 KB
- Stars: 1
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
- Citation: CITATION.cff
- Security: SECURITY.md
Awesome Lists containing this project
README
About stdlib...
We believe in a future in which the web is a preferred environment for numerical computation. To help realize this future, we've built stdlib. stdlib is a standard library, with an emphasis on numerical and scientific computation, written in JavaScript (and C) for execution in browsers and in Node.js.
The library is fully decomposable, being architected in such a way that you can swap out and mix and match APIs and functionality to cater to your exact preferences and use cases.
When you use stdlib, you can be absolutely certain that you are using the most thorough, rigorous, well-written, studied, documented, tested, measured, and high-quality code out there.
To join us in bringing numerical computing to the web, get started by checking us out on GitHub, and please consider financially supporting stdlib. We greatly appreciate your continued support!
# boxcox1pinv
[![NPM version][npm-image]][npm-url] [![Build Status][test-image]][test-url] [![Coverage Status][coverage-image]][coverage-url]
> Compute the inverse of a one-parameter [Box-Cox transformation][box-cox-transformation] for `1+x`.
To compute the inverse of a one-parameter [Box-Cox transformation][box-cox-transformation], one finds the `x` such that
## Installation
```bash
npm install @stdlib/math-base-special-boxcox1pinv
```Alternatively,
- To load the package in a website via a `script` tag without installation and bundlers, use the [ES Module][es-module] available on the [`esm`][esm-url] branch (see [README][esm-readme]).
- If you are using Deno, visit the [`deno`][deno-url] branch (see [README][deno-readme] for usage intructions).
- For use in Observable, or in browser/node environments, use the [Universal Module Definition (UMD)][umd] build available on the [`umd`][umd-url] branch (see [README][umd-readme]).The [branches.md][branches-url] file summarizes the available branches and displays a diagram illustrating their relationships.
To view installation and usage instructions specific to each branch build, be sure to explicitly navigate to the respective README files on each branch, as linked to above.
## Usage
```javascript
var boxcox1pinv = require( '@stdlib/math-base-special-boxcox1pinv' );
```#### boxcox1pinv( y, lambda )
Computes the inverse of a one-parameter [Box-Cox transformation][box-cox-transformation] for `1+x`.
```javascript
var v = boxcox1pinv( 1.0, 2.5 );
// returns ~0.6505v = boxcox1pinv( 4.0, 2.5 );
// returns ~1.6095v = boxcox1pinv( 10.0, 2.5 );
// returns ~2.6812v = boxcox1pinv( 2.0, 0.0 );
// returns ~6.3891v = boxcox1pinv( -1.0, 2.5 );
// returns NaNv = boxcox1pinv( 0.0, -1.0 );
// returns 0.0v = boxcox1pinv( 1.0, NaN );
// returns NaNv = boxcox1pinv( NaN, 3.1 );
// returns NaN
```## Examples
```javascript
var incrspace = require( '@stdlib/array-base-incrspace' );
var boxcox1pinv = require( '@stdlib/math-base-special-boxcox1pinv' );var y = incrspace( -1.0, 10.0, 1.0 );
var l = incrspace( -0.5, 5.0, 0.5 );var b;
var i;
var j;
for ( i = 0; i < y.length; i++ ) {
for ( j = 0; j < l.length; j++ ) {
b = boxcox1pinv( y[ i ], l[ j ] );
console.log( 'boxcox1pinv(%d, %d) = %d', y[ i ], l[ j ], b );
}
}
```* * *
## C APIs
### Usage
```c
#include "stdlib/math/base/special/boxcox1pinv.h"
```#### stdlib_base_boxcox1pinv( y, lambda )
Computes the inverse of a one-parameter [Box-Cox transformation][box-cox-transformation] of `1+x`.
```c
double out = stdlib_base_boxcox1pinv( 1.0, 2.5 );
// returns ~0.6505out = stdlib_base_boxcox1pinv( 4.0, 2.5 );
// returns ~1.6095
```The function accepts the following arguments:
- **y**: `[in] double` input value.
- **lambda**: `[in] double` power parameter.```c
double stdlib_base_boxcox1pinv ( const double y, const double lambda );
```### Examples
```c
#include "stdlib/math/base/special/boxcox1pinv.h"
#includeint main( void ) {
const double y[] = { -1.0, 10.0, 1.0 };
const double l[] = { -0.5, 5.0, 0.5 };double b;
int i;
int j;
for ( i = 0; i < 3; i++ ) {
for ( j = 0; j < 3; j++ ){
b = stdlib_base_boxcox1pinv( y[ i ], l[ j ] );
printf ( "boxcox1pinv(%lf, %lf) = %lf\n", y[ i ], l[ j ], b );
}
}
}
```## References
- Box, G. E. P., and D. R. Cox. 1964. "An Analysis of Transformations." _Journal of the Royal Statistical Society. Series B (Methodological)_ 26 (2). \[Royal Statistical Society, Wiley]: 211–52. .
* * *
## See Also
- [`@stdlib/math-base/special/boxcox`][@stdlib/math/base/special/boxcox]: compute a one-parameter Box-Cox transformation.
- [`@stdlib/math-base/special/boxcox1p`][@stdlib/math/base/special/boxcox1p]: compute a one-parameter Box-Cox transformation of 1+x.
- [`@stdlib/math-base/special/boxcoxinv`][@stdlib/math/base/special/boxcoxinv]: compute the inverse of a one-parameter Box-Cox transformation.* * *
## Notice
This package is part of [stdlib][stdlib], a standard library for JavaScript and Node.js, with an emphasis on numerical and scientific computing. The library provides a collection of robust, high performance libraries for mathematics, statistics, streams, utilities, and more.
For more information on the project, filing bug reports and feature requests, and guidance on how to develop [stdlib][stdlib], see the main project [repository][stdlib].
#### Community
[![Chat][chat-image]][chat-url]
---
## License
See [LICENSE][stdlib-license].
## Copyright
Copyright © 2016-2024. The Stdlib [Authors][stdlib-authors].
[npm-image]: http://img.shields.io/npm/v/@stdlib/math-base-special-boxcox1pinv.svg
[npm-url]: https://npmjs.org/package/@stdlib/math-base-special-boxcox1pinv[test-image]: https://github.com/stdlib-js/math-base-special-boxcox1pinv/actions/workflows/test.yml/badge.svg?branch=main
[test-url]: https://github.com/stdlib-js/math-base-special-boxcox1pinv/actions/workflows/test.yml?query=branch:main[coverage-image]: https://img.shields.io/codecov/c/github/stdlib-js/math-base-special-boxcox1pinv/main.svg
[coverage-url]: https://codecov.io/github/stdlib-js/math-base-special-boxcox1pinv?branch=main[chat-image]: https://img.shields.io/gitter/room/stdlib-js/stdlib.svg
[chat-url]: https://app.gitter.im/#/room/#stdlib-js_stdlib:gitter.im[stdlib]: https://github.com/stdlib-js/stdlib
[stdlib-authors]: https://github.com/stdlib-js/stdlib/graphs/contributors
[umd]: https://github.com/umdjs/umd
[es-module]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Modules[deno-url]: https://github.com/stdlib-js/math-base-special-boxcox1pinv/tree/deno
[deno-readme]: https://github.com/stdlib-js/math-base-special-boxcox1pinv/blob/deno/README.md
[umd-url]: https://github.com/stdlib-js/math-base-special-boxcox1pinv/tree/umd
[umd-readme]: https://github.com/stdlib-js/math-base-special-boxcox1pinv/blob/umd/README.md
[esm-url]: https://github.com/stdlib-js/math-base-special-boxcox1pinv/tree/esm
[esm-readme]: https://github.com/stdlib-js/math-base-special-boxcox1pinv/blob/esm/README.md
[branches-url]: https://github.com/stdlib-js/math-base-special-boxcox1pinv/blob/main/branches.md[stdlib-license]: https://raw.githubusercontent.com/stdlib-js/math-base-special-boxcox1pinv/main/LICENSE
[box-cox-transformation]: https://en.wikipedia.org/wiki/Power_transform#Box-Cox_transformation
[@stdlib/math/base/special/boxcox]: https://github.com/stdlib-js/math-base-special-boxcox
[@stdlib/math/base/special/boxcox1p]: https://github.com/stdlib-js/math-base-special-boxcox1p
[@stdlib/math/base/special/boxcoxinv]: https://github.com/stdlib-js/math-base-special-boxcoxinv