Apache License 2.0

项目介绍

stdlib-js/stats-incr-midrange 是一个托管在 GitHub 上的开源项目,主要使用 JavaScript 编写,采用 Apache License 2.0 许可证,目前获得 2 个 Star、0 次 Fork。

仓库全名
stdlib-js/stats-incr-midrange
开源许可证
Apache License 2.0
Star 数
2

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…

完整内容见 GitHub 原始 README 或本页 。

常见问题

stats-incr-midrange 用什么语言开发?

主要使用 JavaScript 编写,采用 Apache License 2.0 许可证,目前有 2 个 Star。

stats-incr-midrange 可以免费商用吗?

仓库采用 Apache License 2.0 许可证,可免费使用与修改,商业使用请遵守许可证条款(例如保留版权声明与许可声明)。

如何获取 stats-incr-midrange 的源码?

可以直接克隆仓库:git clone https://github.com/stdlib-js/stats-incr-midrange.git,默认分支为 main;安装与运行步骤见仓库 README。

stats-incr-midrange 最近还在维护吗?

仓库最近一次更新为 2 周前,当前没有未关闭的 Issue;Star 数为 2,可作为社区活跃度的参考。

关于

Compute a mid-range incrementally.

描述取自 GitHub 官方 API,中文内容由 GitRead 中文社区 编辑团队整理。

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!

incrmidrange

NPM version Build Status Coverage Status

Compute a mid-range incrementally.

The mid-range, or mid-extreme, is the arithmetic mean of maximum and minimum values. Accordingly, the mid-range is the midpoint of the range and a measure of central tendency.

Installation

npm install @stdlib/stats-incr-midrange

Alternatively,

  • To load the package in a website via a script tag without installation and bundlers, use the ES Module available on the esm branch (see README).
  • If you are using Deno, visit the deno branch (see README for usage intructions).
  • For use in Observable, or in browser/node environments, use the Universal Module Definition (UMD) build available on the umd branch (see README).

The branches.md 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

var incrmidrange = require( '@stdlib/stats-incr-midrange' );
incrmidrange()

Returns an accumulator function which incrementally computes a mid-range.

var accumulator = incrmidrange();
accumulator( [x] )

If provided an input value x, the accumulator function returns an updated mid-range. If not provided an input value x, the accumulator function returns the current mid-range.

var accumulator = incrmidrange();

var midrange = accumulator();
// returns null

midrange = accumulator( -2.0 );
// returns -2.0

midrange = accumulator( 1.0 );
// returns -0.5

midrange = accumulator( 3.0 );
// returns 0.5

midrange = accumulator();
// returns 0.5

Notes

  • Input values are not type checked. If provided NaN, the accumulated value is NaN for all future invocations. If non-numeric inputs are possible, you are advised to type check and handle accordingly before passing the value to the accumulator function.

Examples

var randu = require( '@stdlib/random-base-randu' );
var incrmidrange = require( '@stdlib/stats-incr-midrange' );

var accumulator;
var v;
var i;

// Initialize an accumulator:
accumulator = incrmidrange();

// For each simulated datum, update the mid-range...
for ( i = 0; i < 100; i++ ) {
    v = randu() * 100.0;
    accumulator( v );
}
console.log( accumulator() );

Notice

This package is part of 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, see the main project repository.

Community

Chat


License

See LICENSE.

Copyright © 2016-2026. The Stdlib Authors.

评论

暂无评论