mctad
所属分类:数学计算
开发工具:JavaScript
文件大小:222KB
下载次数:0
上传日期:2014-12-18 03:08:27
上 传 者:
sh-1993
说明: 中心趋势和分散的度量:概率和统计的JavaScript库
(Measures of Central Tendency And Dispersion: A JavaScript library for probability & statistics)
文件列表:
.jshintrc (77, 2014-07-26)
.travis.yml (49, 2014-07-26)
Gruntfile.js (2233, 2014-07-26)
LICENSE (1077, 2014-07-26)
Makefile (475, 2014-07-26)
doc (0, 2014-07-26)
doc\assets (0, 2014-07-26)
doc\assets\behavior.js (210425, 2014-07-26)
doc\assets\style.css (29546, 2014-07-26)
doc\index.html (4987, 2014-07-26)
doc\src (0, 2014-07-26)
doc\src\confidence_intervals (0, 2014-07-26)
doc\src\confidence_intervals\on_difference_between_two_means.html (16101, 2014-07-26)
doc\src\confidence_intervals\on_difference_between_two_proportions.html (9846, 2014-07-26)
doc\src\confidence_intervals\on_mean.html (11785, 2014-07-26)
doc\src\confidence_intervals\on_proportion.html (8381, 2014-07-26)
doc\src\confidence_intervals\z.html (2557, 2014-07-26)
doc\src\continuous (0, 2014-07-26)
doc\src\continuous\chi-squared.html (53911, 2014-07-26)
doc\src\continuous\chi_squared.html (59295, 2014-07-26)
doc\src\continuous\erf.html (3688, 2014-07-26)
doc\src\continuous\exponential.html (9628, 2014-07-26)
doc\src\continuous\inverse_erf.html (4214, 2014-07-26)
doc\src\continuous\lognormal.html (13725, 2014-07-26)
doc\src\continuous\mixins.html (1747, 2014-07-26)
doc\src\continuous\normal.html (14722, 2014-07-26)
doc\src\continuous\students_t.html (12598, 2014-07-26)
doc\src\continuous\tables (0, 2014-07-26)
doc\src\continuous\tables\t_distribution_table.html (54177, 2014-07-26)
doc\src\continuous\triangular.html (19622, 2014-07-26)
doc\src\continuous\uniform.html (9729, 2014-07-26)
doc\src\continuous\weibull.html (12334, 2014-07-26)
doc\src\core (0, 2014-07-26)
doc\src\core\combination.html (4076, 2014-07-26)
doc\src\core\combinations.html (2565, 2014-07-26)
doc\src\core\constants.html (1459, 2014-07-26)
doc\src\core\core.html (952, 2014-07-26)
... ...
[![Travis CI Build Status](https://travis-ci.org/erictheise/mctad.js.svg?branch=master)](https://travis-ci.org/erictheise/mctad.js)
[![Dependency Status](https://gemnasium.com/erictheise/mctad.js.svg)](https://gemnasium.com/erictheise/mctad.js)
mctad.js
========
Measures of Central Tendency And Dispersion: A JavaScript library for probability & statistics
### About
__mctad.js__ is a JavaScript library for probability and statistics. A goal is to provide functionality missing from
other such libraries, including the ability to generate random variables from many common discrete and continuous
probability distributions, and having a basic implementation of directional statistics.
### Use
You'll want either the file `mctad.min.js` or the file `mctad.js` in the root of this repository.
### Documentation
See the [GitHub pages](http://erictheise.github.io/mctad.js/) for examples of using _mctad.js_. In addition,
_mctad.js_ runs [groc](http://nevir.github.io/groc/) as a [grunt](http://gruntjs.com/) task to automatically generate
html documentation from comments in the source code. Access that documentation by opening a browser on your local copy of
`/doc/index.html` after you `git clone` this repository or look at the [`/doc/`
directory](http://erictheise.github.io/mctad.js/doc/) of the GitHub pages.
#### Continuous and Discrete Probability Distributions
Distributions can be called by their common names and required parameters, e.g., `mctad.poisson(7)`. This returns an
object containing:
* statistics on the distribution, including
* _mean_
* _median_
* _mode_
* _variance_
* _skewness_
* _entropy_
* _pdf_, the _probability density function_ (continuous distributions), or _pmf_, the _probability mass function_
(discrete distributions)
* _cdf_, the _cumulative_distribution_function_
* convenience methods to access _pmf_ as _P(X)_ and _cdf_ as _F(X)_
* _generate(n)_, a method for generating _n_ random variables from the distribution
making it possible to say things such as
* `mctad.poisson(7).mean`
* `mctad.poisson(7).P(5)`
* `mctad.poisson(7).F(2)`
* `mctad.triangular(3, 9, 4).generate(36)`
* `mctad.normal(60.2, 4.5).generate(100)`
Statistics on the distributions will return `undefined` if not implemented (this _is_ version 0.0.X after all ) or if
actually not defined for the distribution. Since there need not be a single mode, `mode` always returns an Array.
### Tests
_mctad.js_ uses [mocha]() with [chai assertions]() as a [grunt](http://gruntjs.com/) task to run the test suite. The
general format of the tests is to test exceptions before testing functionality. When possible, test data is taken from a
wikipedia article or other hopefully long-lived reference. If these are not available, hand-worked examples are used for
testing.
### Conventions
The ability to use Greek letters directly in code appeals to me, and they are used internally. I am still considering
the extent to which they should be exposed externally. In an ideal world, it would be reliable to use constructions such
as p-hat (p) and x-bar (x) as variable names.
You will come across examples of _type hinting_, e.g., in the form of 1 versus 1.0, to help clarify whether quantities
are expected to take integer or real values.
### To Do
* "self-estimating" distributions
* chi square goodness of fit
* analysis of variance
近期下载者:
相关文件:
收藏者: