time-to-botec

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

index.js (1242B)


      1 /**
      2 * @license Apache-2.0
      3 *
      4 * Copyright (c) 2018 The Stdlib Authors.
      5 *
      6 * Licensed under the Apache License, Version 2.0 (the "License");
      7 * you may not use this file except in compliance with the License.
      8 * You may obtain a copy of the License at
      9 *
     10 *    http://www.apache.org/licenses/LICENSE-2.0
     11 *
     12 * Unless required by applicable law or agreed to in writing, software
     13 * distributed under the License is distributed on an "AS IS" BASIS,
     14 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
     15 * See the License for the specific language governing permissions and
     16 * limitations under the License.
     17 */
     18 
     19 'use strict';
     20 
     21 /**
     22 * Compute ranks for the values of an array-like object.
     23 *
     24 * @module @stdlib/stats/ranks
     25 *
     26 * @example
     27 * var ranks = require( '@stdlib/stats/ranks' );
     28 *
     29 * var arr = [ 1.1, 2.0, 3.5, 0.0, 2.4 ];
     30 * var out = ranks( arr );
     31 * // returns [ 2, 3, 5, 1, 4 ]
     32 *
     33 * // Ties are averaged:
     34 * arr = [ 2, 2, 1, 4, 3 ];
     35 * out = ranks ( arr );
     36 * // returns [ 2.5, 2.5, 1, 5, 4 ];
     37 *
     38 * // Missing values are placed last:
     39 * arr = [ null, 2, 2, 1, 4, 3, NaN, NaN ];
     40 * out = ranks( arr );
     41 * // returns [ 6, 2.5, 2.5, 1, 5, 4, 7 ,8 ]
     42 */
     43 
     44 // MODULES //
     45 
     46 var ranks = require( './main.js' );
     47 
     48 
     49 // EXPORTS //
     50 
     51 module.exports = ranks;