time-to-botec

Benchmark sampling in different programming languages
Log | Files | Refs | README

README.md (4068B)


      1 <!--
      2 
      3 @license Apache-2.0
      4 
      5 Copyright (c) 2018 The Stdlib Authors.
      6 
      7 Licensed under the Apache License, Version 2.0 (the "License");
      8 you may not use this file except in compliance with the License.
      9 You may obtain a copy of the License at
     10 
     11    http://www.apache.org/licenses/LICENSE-2.0
     12 
     13 Unless required by applicable law or agreed to in writing, software
     14 distributed under the License is distributed on an "AS IS" BASIS,
     15 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
     16 See the License for the specific language governing permissions and
     17 limitations under the License.
     18 
     19 -->
     20 
     21 # boxcox1pinv
     22 
     23 > Compute the inverse of a one-parameter [Box-Cox transformation][box-cox-transformation] for `1+x`.
     24 
     25 <!-- Section to include introductory text. Make sure to keep an empty line after the intro `section` element and another before the `/section` close. -->
     26 
     27 <section class="intro">
     28 
     29 To compute the inverse of a one-parameter [Box-Cox transformation][box-cox-transformation], one finds the `x` such that 
     30 
     31 <!-- <equation class="equation" label="eq:inverse_boxcox_transformation_one_parameter" align="center" raw="y^{\lambda} = \begin{cases}\frac{(x + 1)^{\lambda} - 1}{\lambda} & \textrm{if}\ \lambda \neq 0 \\ \log(x + 1) & \textrm{if}\ \lambda = 0 \end{cases}" alt="Inverse One-Parameter Box-Cox Transformation"> -->
     32 
     33 <div class="equation" align="center" data-raw-text="y^{\lambda} = \begin{cases}\frac{(x + 1)^{\lambda} - 1}{\lambda} & \textrm{if}\ \lambda \neq 0 \\ \log(x + 1) & \textrm{if}\ \lambda = 0 \end{cases}" data-equation="eq:inverse_boxcox_transformation_one_parameter">
     34     <img src="https://cdn.jsdelivr.net/gh/stdlib-js/stdlib@e8453b2b45eefe64cc256c32bbb826204180623d/lib/node_modules/@stdlib/math/base/special/boxcox1pinv/docs/img/equation_inverse_boxcox_transformation_one_parameter.svg" alt="Inverse One-Parameter Box-Cox Transformation" />
     35     <br>
     36 </div>
     37 
     38 <!-- </equation> -->
     39 
     40 </section>
     41 
     42 <!-- /.intro -->
     43 
     44 <!-- Package usage documentation. -->
     45 
     46 <section class="usage">
     47 
     48 ## Usage
     49 
     50 ```javascript
     51 var boxcox1pinv = require( '@stdlib/math/base/special/boxcox1pinv' );
     52 ```
     53 
     54 #### boxcox1pinv( y, lambda )
     55 
     56 Computes the inverse of a one-parameter [Box-Cox transformation][box-cox-transformation] for `1+x`.
     57 
     58 ```javascript
     59 var v = boxcox1pinv( 1.0, 2.5 );
     60 // returns ~0.6505
     61 
     62 v = boxcox1pinv( 4.0, 2.5 );
     63 // returns ~1.6095
     64 
     65 v = boxcox1pinv( 10.0, 2.5 );
     66 // returns ~2.6812
     67 
     68 v = boxcox1pinv( 2.0, 0.0 );
     69 // returns ~6.3891
     70 
     71 v = boxcox1pinv( -1.0, 2.5 );
     72 // returns NaN
     73 
     74 v = boxcox1pinv( 0.0, -1.0 );
     75 // returns 0.0
     76 
     77 v = boxcox1pinv( 1.0, NaN );
     78 // returns NaN
     79 
     80 v = boxcox1pinv( NaN, 3.1 );
     81 // returns NaN
     82 ```
     83 
     84 </section>
     85 
     86 <!-- /.usage -->
     87 
     88 <!-- Package usage examples. -->
     89 
     90 <section class="examples">
     91 
     92 ## Examples
     93 
     94 <!-- eslint no-undef: "error" -->
     95 
     96 ```javascript
     97 var incrspace = require( '@stdlib/array/incrspace' );
     98 var boxcox1pinv = require( '@stdlib/math/base/special/boxcox1pinv' );
     99 
    100 var y = incrspace( -1.0, 10.0, 1.0 );
    101 var l = incrspace( -0.5, 5.0, 0.5 );
    102 var b;
    103 var i;
    104 var j;
    105 
    106 for ( i = 0; i < y.length; i++ ) {
    107     for ( j = 0; j < l.length; j++ ) {
    108         b = boxcox1pinv( y[ i ], l[ j ] );
    109         console.log( 'boxcox1pinv(%d, %d) = %d', y[ i ], l[ j ], b );
    110     }
    111 }
    112 ```
    113 
    114 </section>
    115 
    116 <!-- /.examples -->
    117 
    118 <!-- Section to include cited references. If references are included, add a horizontal rule *before* the section. Make sure to keep an empty line after the `section` element and another before the `/section` close. -->
    119 
    120 <section class="references">
    121 
    122 ## References
    123 
    124 -   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. <http://www.jstor.org/stable/2984418>.
    125 
    126 </section>
    127 
    128 <!-- /.references -->
    129 
    130 <!-- Section for all links. Make sure to keep an empty line after the `section` element and another before the `/section` close. -->
    131 
    132 <section class="links">
    133 
    134 [box-cox-transformation]: https://en.wikipedia.org/wiki/Power_transform#Box-Cox_transformation
    135 
    136 </section>
    137 
    138 <!-- /.links -->