spc

package
v2.10.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 9, 2026 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Overview

Package spc is statistical process control for a measure read once a period (TAXONOMY.md D58): the individuals and moving range chart, its natural process limits, the signals that the process has changed, and how capable it is of meeting its specification limits. It is pure arithmetic over readings.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func XmR

func XmR(cc *Chart)

XmR works out a chart's limits, the signals that the process has changed, and, where it has specification limits, its capability. The points are in the order they were read.

Types

type Chart

type Chart struct {
	KPI    string  `json:"kpi"`
	Points []Point `json:"points"`
	// Centre is the mean; Lower and Upper the natural process limits,
	// the centre less and plus 2.66 average moving ranges.
	Centre float64 `json:"centre"`
	Lower  float64 `json:"lower"`
	Upper  float64 `json:"upper"`
	// Sigma is the process's spread estimated from the moving ranges.
	Sigma float64 `json:"sigma"`
	// Stable is no reading signalling; Enough is twenty readings or more,
	// the fewest the limits are usually trusted from.
	Stable bool `json:"stable"`
	Enough bool `json:"enough"`
	// SpecLower and SpecUpper are the KPI's specification limits, when it
	// has them; Cp and Cpk its capability against them, and SigmaLevel
	// the short-term sigma level, three times Cpk.
	SpecLower  *float64 `json:"specLower,omitempty"`
	SpecUpper  *float64 `json:"specUpper,omitempty"`
	Cp         *float64 `json:"cp,omitempty"`
	Cpk        *float64 `json:"cpk,omitempty"`
	SigmaLevel *float64 `json:"sigmaLevel,omitempty"`
	// Note says what the chart cannot yet tell.
	Note string `json:"note,omitempty"`
}

Chart is a measure's readings with their limits: an individuals and moving range (XmR) chart.

type Point

type Point struct {
	Period string  `json:"period"`
	Value  float64 `json:"value"`
	// Signals are the rules it breaks: beyond (a limit), run (the eighth
	// in a row on one side of the centre), trend (the sixth rising or
	// falling in a row).
	Signals     []string `json:"signals,omitempty"`
	Provisional bool     `json:"provisional,omitempty"`
}

Point is one reading on the chart.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL