mqr.spc.rules.
n_1side#
- mqr.spc.rules.n_1side(n)#
Rule monitoring the count on one side the centreline.
This function returns an alarm rule that alarms when n statistics in a row fall on one side of the centreline.
This function generates a rule. The result of this function is another function that can be passed to
mqr.plot.spc.alarms
orcombine
.- Parameters:
- nint
Number of consecutive statistics falling on one side of the centreline required to trigger an alarm.
- Returns:
- Callable[(ControlStatistic, ControlParams), pandas.Series[bool]]
A function taking a control statistic and the params used to create them, and returning a series with True marking alarms.
Examples
data = pd.DataFrame({ 'Xbar': np.array([9, 10, 11, 13, 12, 8]) # ^^^^^^^^^^ (3 > target) }) params = mqr.spc.XBarParams(centre=10, sigma=1) stat = params.statistic(data) rule = mqr.spc.rules.n_1side(3) fig, ax = plt.subplots(figsize=(7, 3)) mqr.plot.spc.chart(stat, params, ax=ax) mqr.plot.spc.alarms(stat, params, rule, ax=ax)
(
Source code
,png
,pdf
)