Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

think-bayes

Package Overview
Dependencies
Maintainers
1
Versions
10
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

think-bayes - npm Package Compare versions

Comparing version 0.1.3-alpha.2 to 0.1.3-alpha.3

cjs/Util.js

2

CHANGELOG.md

@@ -5,2 +5,4 @@ # Changelog

### [0.1.3-alpha.3](https://github.com/parksben/think-bayes/compare/v0.1.3-alpha.2...v0.1.3-alpha.3) (2020-01-30)
### [0.1.3-alpha.2](https://github.com/parksben/think-bayes/compare/v0.1.3-alpha.1...v0.1.3-alpha.2) (2020-01-30)

@@ -7,0 +9,0 @@

@@ -32,3 +32,3 @@ "use strict";

});
exports.makeSuiteFromCdf = exports.makeSuiteFromHist = exports.makeSuiteFromList = exports.makeSuiteFromDict = exports.makeCdfFromPmf = exports.makeCdfFromList = exports.makeCdfFromHist = exports.makeCdfFromDict = exports.makeCdfFromItems = exports.makeUniformPmf = exports.makeMixture = exports.makePmfFromCdf = exports.makePmfFromHist = exports.makePmfFromItems = exports.makePmfFromDict = exports.makePmfFromList = exports.makeHistFromDict = exports.makeHistFromList = exports.makeJoint = void 0;
exports.default = exports.makeSuiteFromCdf = exports.makeSuiteFromHist = exports.makeSuiteFromList = exports.makeSuiteFromDict = exports.makeCdfFromPmf = exports.makeCdfFromList = exports.makeCdfFromHist = exports.makeCdfFromDict = exports.makeCdfFromItems = exports.makeUniformPmf = exports.makeMixture = exports.makePmfFromCdf = exports.makePmfFromHist = exports.makePmfFromItems = exports.makePmfFromDict = exports.makePmfFromList = exports.makeHistFromDict = exports.makeHistFromList = exports.makeJoint = void 0;

@@ -161,3 +161,3 @@ var _Cdf = _interopRequireDefault(require("./Cdf"));

* Makes a histogram from a map from values to frequencies.
* @param {object/map} d dictionary that maps values to frequencies
* @param {object|map} d dictionary that maps values to frequencies
* @param {string} name string name for this histogram

@@ -192,3 +192,3 @@ * @returns Hist object

* Makes a PMF from a map from values to probabilities.
* @param {object/map} d dictionary that maps values to probabilities
* @param {object|map} d dictionary that maps values to probabilities
* @param {string} name string name for this PMF

@@ -448,3 +448,3 @@ * * @returns Pmf object

* Makes a CDF from a dictionary that maps values to frequencies.
* @param {object/mapt} d dictionary that maps values to frequencies.
* @param {object|map} d dictionary that maps values to frequencies.
* @param {string} name string name for the data.

@@ -502,3 +502,3 @@ * @returns Cdf object

* Makes a suite from a map from values to probabilities.
* @param {object/map} d dictionary that maps values to probabilities
* @param {object|map} d dictionary that maps values to probabilities
* @param {string} name string name for this suite

@@ -589,2 +589,24 @@ * @returns Suite object

exports.makeSuiteFromCdf = makeSuiteFromCdf;
var _default = {
makeJoint: makeJoint,
makeHistFromList: makeHistFromList,
makeHistFromDict: makeHistFromDict,
makePmfFromList: makePmfFromList,
makePmfFromDict: makePmfFromDict,
makePmfFromItems: makePmfFromItems,
makePmfFromHist: makePmfFromHist,
makePmfFromCdf: makePmfFromCdf,
makeMixture: makeMixture,
makeUniformPmf: makeUniformPmf,
makeCdfFromItems: makeCdfFromItems,
makeCdfFromDict: makeCdfFromDict,
makeCdfFromHist: makeCdfFromHist,
makeCdfFromList: makeCdfFromList,
makeCdfFromPmf: makeCdfFromPmf,
makeSuiteFromDict: makeSuiteFromDict,
makeSuiteFromList: makeSuiteFromList,
makeSuiteFromHist: makeSuiteFromHist,
makeSuiteFromCdf: makeSuiteFromCdf
};
exports.default = _default;
//# sourceMappingURL=convertors.js.map

@@ -32,3 +32,3 @@ "use strict";

});
exports.evalPoissonPmf = exports.evalBinomialPmf = exports.makeGaussianPdf = exports.evalGaussianPdf = exports.sampleSum = exports.randomSum = exports.pmfProbEqual = exports.pmfProbGreater = exports.pmfProbLess = exports.credibleInterval = exports.percentile = exports.probability2 = exports.probability = exports.odds = void 0;
exports.default = exports.evalPoissonPmf = exports.evalBinomialPmf = exports.makeGaussianPdf = exports.evalGaussianPdf = exports.sampleSum = exports.randomSum = exports.pmfProbEqual = exports.pmfProbGreater = exports.pmfProbLess = exports.credibleInterval = exports.percentile = exports.probability2 = exports.probability = exports.odds = void 0;

@@ -484,2 +484,19 @@ var _utils = require("./utils");

exports.evalPoissonPmf = evalPoissonPmf;
var _default = {
odds: odds,
probability: probability,
probability2: probability2,
percentile: percentile,
credibleInterval: credibleInterval,
pmfProbLess: pmfProbLess,
pmfProbGreater: pmfProbGreater,
pmfProbEqual: pmfProbEqual,
randomSum: randomSum,
sampleSum: sampleSum,
evalGaussianPdf: evalGaussianPdf,
makeGaussianPdf: makeGaussianPdf,
evalBinomialPmf: evalBinomialPmf,
evalPoissonPmf: evalPoissonPmf
};
exports.default = _default;
//# sourceMappingURL=helpers.js.map

@@ -78,2 +78,8 @@ "use strict";

});
Object.defineProperty(exports, "Util", {
enumerable: true,
get: function get() {
return _Util.default;
}
});
Object.defineProperty(exports, "convertors", {

@@ -128,2 +134,4 @@ enumerable: true,

var _Util = _interopRequireDefault(require("./Util.js"));
var _convertors = _interopRequireDefault(require("./convertors.js"));

@@ -130,0 +138,0 @@

2

package.json
{
"name": "think-bayes",
"version": "0.1.3-alpha.2",
"version": "0.1.3-alpha.3",
"description": "An algorithm framework of probability and statistics for browser and Node.js environment.",

@@ -5,0 +5,0 @@ "scripts": {

@@ -1265,3 +1265,4 @@ # think-bayes

```js
import { odds, probability, percentile } from 'think-bayes/helpers';
import { Util } from 'think-bayes';
const { odds, probability, percentile } = Util;
```

@@ -1509,4 +1510,318 @@

<details>
<summary><b>makeJoint(pmf1, pmf2)</b></summary>
Joint distribution of values from pmf1 and pmf2.
**@Params:**
| param | type | description |
|-------|------|-------------|
| pmf1 | pmf | Pmf object |
| pmf2 | pmf | Pmf object |
**@Returns:** Joint pmf of value pairs
</details>
<details>
<summary><b>makeHistFromList(t, name)</b></summary>
Makes a histogram from an unsorted sequence of values.
**@Params:**
| param | type | description |
|-------|--------|--------------------------------|
| t | array | sequence of numbers |
| name | string | string name for this histogram |
**@Returns:** Hist object
</details>
<details>
<summary><b>makeHistFromDict(d, name)</b></summary>
Makes a histogram from a map from values to frequencies.
**@Params:**
| param | type | description |
|-------|--------------|--------------------------------------------|
| d | object | map | dictionary that maps values to frequencies |
| name | string | string name for this histogram |
**@Returns:** Hist object
</details>
<details>
<summary><b>makePmfFromList(t, name)</b></summary>
Makes a PMF from an unsorted sequence of values.
**@Params:**
| param | type | description |
|-------|--------|--------------------------|
| t | array | sequence of numbers |
| name | string | string name for this PMF |
**@Returns:** Pmf object
</details>
<details>
<summary><b>makePmfFromDict(d, name)</b></summary>
Makes a PMF from a map from values to probabilities.
**@Params:**
| param | type | description |
|-------|--------------|------------------------------------------------|
| d | object | map | dictionary that maps values to probabilities |
| name | string | string name for this PMF * @returns Pmf object |
</details>
<details>
<summary><b>makePmfFromItems(t, name)</b></summary>
Makes a PMF from a sequence of value-probability pairs
**@Params:**
| param | type | description |
|-------|--------|------------------------------------------------|
| t | array | sequence of value-probability pairs |
| name | string | string name for this PMF * @returns Pmf object |
</details>
<details>
<summary><b>makePmfFromHist(hist, name)</b></summary>
Makes a normalized PMF from a Hist object.
**@Params:**
| param | type | description |
|-------|--------|-------------|
| hist | hist | Hist object |
| name | string | string name |
**@Returns:** Pmf object
</details>
<details>
<summary><b>makePmfFromCdf(cdf, name)</b></summary>
Makes a normalized Pmf from a Cdf object.
**@Params:**
| param | type | description |
|-------|--------|-----------------------------|
| cdf | cdf | Cdf object |
| name | string | string name for the new Pmf |
**@Returns:** Pmf object
</details>
<details>
<summary><b>makeMixture(metapmf, name = 'mix')</b></summary>
Make a mixture distribution.
**@Params:**
| param | type | description |
|---------|--------|-----------------------------------|
| metapmf | pmf | Pmf that maps from Pmfs to probs. |
| name | string | string name for the new Pmf |
**@Returns:** Pmf object
</details>
<details>
<summary><b>makeUniformPmf(low, high, n)</b></summary>
Make a uniform Pmf.
**@Params:**
| param | type | description |
|-------|--------|---------------------------|
| low | number | lowest value (inclusive) |
| high | number | highest value (inclusize) |
| n | number | number of values |
</details>
<details>
<summary><b>makeCdfFromItems(items, name = '')</b></summary>
Makes a cdf from an unsorted sequence of (value, frequency) pairs.
**@Params:**
| param | type | description |
|-------|--------|-----------------------------------------------|
| items | array | unsorted sequence of (value, frequency) pairs |
| name | string | string name for this CDF |
**@Returns:** cdf: list of (value, fraction) pairs
</details>
<details>
<summary><b>makeCdfFromDict(d, name)</b></summary>
Makes a CDF from a dictionary that maps values to frequencies.
**@Params:**
| param | type | description |
|-------|--------------|---------------------------------------------|
| d | object | map | dictionary that maps values to frequencies. |
| name | string | string name for the data. |
**@Returns:** Cdf object
</details>
<details>
<summary><b>makeCdfFromHist(hist, name)</b></summary>
Makes a CDF from a Hist object.
**@Params:**
| param | type | description |
|-------|--------|---------------------------|
| hist | hist | Hist object |
| name | string | string name for the data. |
**@Returns:** Cdf object
</details>
<details>
<summary><b>makeCdfFromList(seq, name)</b></summary>
Creates a CDF from an unsorted sequence.
**@Params:**
| param | type | description |
|-------|--------|--------------------------------------|
| seq | array | unsorted sequence of sortable values |
| name | string | string name for the cdf |
**@Returns:** Cdf object
</details>
<details>
<summary><b>makeCdfFromPmf(pmf, name)</b></summary>
Makes a CDF from a Pmf object.
**@Params:**
| param | type | description |
|-------|--------|---------------------------|
| pmf | pmf | Pmf object |
| name | string | string name for the data. |
**@Returns:** Cdf object
</details>
<details>
<summary><b>makeSuiteFromDict(d, name)</b></summary>
Makes a suite from a map from values to probabilities.
**@Params:**
| param | type | description |
|-------|--------------|----------------------------------------------|
| d | object | map | dictionary that maps values to probabilities |
| name | string | string name for this suite |
**@Returns:** Suite object
</details>
<details>
<summary><b>makeSuiteFromList(t, name)</b></summary>
Makes a suite from an unsorted sequence of values.
**@Params:**
| param | type | description |
|-------|--------|----------------------------|
| t | array | sequence of numbers |
| name | string | string name for this suite |
</details>
<details>
<summary><b>makeSuiteFromHist(hist, name)</b></summary>
Makes a normalized suite from a Hist object.
**@Params:**
| param | type | description |
|-------|--------|-------------|
| hist | hist | Hist object |
| name | string | string name |
</details>
<details>
<summary><b>makeSuiteFromCdf(cdf, name)</b></summary>
Makes a normalized Suite from a Cdf object.
**@Params:**
| param | type | description |
|-------|--------|-------------------------------|
| cdf | cdf | Cdf object |
| name | string | string name for the new Suite |
**@Returns:** Suite object
</details>
## Q&A

@@ -1513,0 +1828,0 @@

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc