Socket
Socket
Sign inDemoInstall

normal-distribution

Package Overview
Dependencies
0
Maintainers
1
Versions
12
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    normal-distribution

A small javascript module for working with normal distributions


Version published
Weekly downloads
1.8K
decreased by-0.82%
Maintainers
1
Install size
11.5 kB
Created
Weekly downloads
 

Readme

Source

NormalDistribution

https://github.com/RichieAHB/normal-distribution

A small javascript module for working with normal distributions.

The class can be instantiated like so:

const normDist = new NormalDistribution(mean, standardDeviation);

With no arguments the distribution will be a standard normal distribution with mean = 0 and standardDeviation = 1.


The four main methods that can be called are:

#pdf(value)

Accepts an integer argument and returns the probability denisty at that point in the distribution; useful for drawing the curve.

#cdf(value)

Accepts an integer argument and returns the probability of a random variable being below the one argument passed to the method.

#probabilityBetween(value1, value2)

Accepts two integer arguments and returns the probability of a random variable being between the two arguments passed.

#zScore(value)

Accepts an integer argument and returns the z-score for that value.


Note: the z-table used in this module gives probabilities for up to 3.5 standard deviations from the mean

Keywords

FAQs

Last updated on 02 Jul 2021

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc