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

@lucasheight/shewhartcontrols

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@lucasheight/shewhartcontrols

Takes an array of numbers and applies shewhart control rules

  • 0.0.2
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
0
decreased by-100%
Maintainers
1
Weekly downloads
 
Created
Source

Shewhart Controls

A simple library that applies Shewhart chart rules to an array of numbers.

Install

npm install --save @lucaseheight/shewhartcontrols

Using

Create a new ShewhartControls object with an array of numbers.

    const data: IShewhartResult = new ShewhartControls([9, 2, 5, 4, 12, 7]);

Optionally:

  • Provide a boolean (useSampleStDev) to indicate standard deviation method to use. (defaults to true: Sample Standard Deviation)

Results

ShewhartControls: {
  data: [ 9, 2, 5, 4, 12, 7 ],
  useSampleStDev: true,
  points: [
    { value: 9, violations: [Object] },
    { value: 2, violations: [Object] },
    { value: 5, violations: [Object] },
    { value: 4, violations: [Object] },
    { value: 12, violations: [Object] },
    { value: 7, violations: [Object] }
  ],

  mean: 6.5,
  stDev: 3.6193922141707713,
  posSigma1: 10.119392214170771,
  posSigma2: 13.738784428341543,
  posSigma3: 17.358176642512312,
  negSigma1: 2.8806077858292287,
  negSigma2: -0.7387844283415426,
  negSigma3: -4.358176642512314,
  violations: {
    ThreeSigmaViolation: false,
    EightPointsAboveBelowMean: false,
    InnerThird15ConsecutiveViolation: false,
    SixPointTrend: false,
    TwoOfThreeOuterThirdViolation: false
  }
}

Violations Object

The violations object contains booleans when rules have been violated. These violations are indicated for the whole dataset and individually for each data point.

export interface IViolations {
  /** 1 Point Outside the +/−3 Sigma Limits */
  ThreeSigmaViolation: boolean;
  /** 8 Successive Consecutive Points Above (or Below) the Centerline */
  EightPointsAboveBelowMean: boolean;
  /** Six or More Consecutive Points Steadily Increasing or Decreasing */
  SixPointTrend: boolean;
  /** Two out of Three Successive Points in Zone A or Beyond */
  TwoOfThreeOuterThirdViolation: boolean;
  /** 15 Consecutive Points in Zone C on Either Side of the Centerline */
  InnerThird15ConsecutiveViolation: boolean;
}

Keywords

FAQs

Package last updated on 15 Dec 2020

Did you know?

Socket

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
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc