Skip to content

Gage estimator

daspi.statistics.estimation.GageEstimator(samples, reference, u_cal, tolerance, resolution, tolerance_ratio=0.2, strategy='eval', agreement=4, possible_dists=DIST.COMMON, evaluate=None, cg_limit=1.33, cgk_limit=1.33, resolution_ratio_limit=0.05, nan_policy='omit')

Bases: LocationDispersionEstimator

Estimates the process capability of a single measurement system using the Gage Study Type 1 method.

PARAMETER DESCRIPTION
samples

The samples used to estimate the process capability.

TYPE: NumericSample1D

reference

The reference value of the sample under test.

TYPE: float | None

u_cal

The measurement uncertainty of the gage used to measure the reference value. If a float is specified, it is assumed to be the expanded uncertainty with a coverage factor of k = 2.

TYPE: MeasurementUncertainty | float

tolerance

The tolerance range for the measurement.

TYPE: float | SpecLimits | Specification

resolution

The resolution of the measurement system. If None, the resolution is estimated from the samples.

TYPE: float | None

tolerance_ratio

The proportion of the tolerance range (between 0 and 1) used to calculate the adjusted limits, default is 0.2 (20%).

TYPE: float DEFAULT: 0.2

strategy

Which strategy should be used to determine the control limits (process spread): - eval: The strategy is determined according to the given evaluate function. If none is given, the internal evaluate method is used. - fit: First, the distribution that best represents the process data is searched for and then the agreed process spread is calculated - norm: it is assumed that the data is subject to normal distribution. The variation tolerance is then calculated as agreement * standard deviation - data: The quantiles for the process variation tolerance are read directly from the data.

Default is 'eval'.

TYPE: (eval, fit, norm, data) DEFAULT: 'eval'

agreement

The multiplier of the standard deviation for Cg and Cgk values. If an integer is given, the value is interpreted as the number of standard deviations (e.g., 4 for 4σ). If a float is given, it is interpreted as the acceptable proportion for the spread, e.g. 0.9544 (which corresponds to ~ 4 σ). Simply put, this is twice the coverage factor k. Default is 4, because a common coverage factor k is 2.

TYPE: int | float DEFAULT: 4

possible_dists

Distributions to which the data may be subject. Only continuous distributions of scipy.stats are allowed, by default DIST.COMMON

TYPE: tuple of strings or rv_continous DEFAULT: COMMON

evaluate

Provide a function that evaluates the strategy. If strategy is set to 'eval', this function is used to determine the strategy. The function should take the samples as input and return a string that corresponds to a valid strategy 'fit', 'norm', or 'data'. If not provided, the internal evaluate method is used. For more information on the evaluate method, see the class documentation. Default is None.

TYPE: Callable | None DEFAULT: None

cg_limit

The limit for the capability index, default is 1.33.

TYPE: float DEFAULT: 1.33

cgk_limit

The limit for the capability index, default is 1.33.

TYPE: float DEFAULT: 1.33

resolution_ratio_limit

The limit for the resolution proportion, default is 0.05.

TYPE: float DEFAULT: 0.05

nan_policy

How to handle NaN values in the samples. - 'propagate': NaN values are preserved in the analysis. - 'raise': Raises an error if NaN values are found. - 'omit': Omits NaN values from the analysis, default is 'omit'.

TYPE: (propagate, 'raise', omit) DEFAULT: 'propagate'

Examples:

import daspi as dsp

df = dsp.load_dataset('grnr_adjustment')
gage = dsp.GageEstimator(
    samples=df['result_gage'],
    reference=df['reference'][0],
    u_cal=df['U_cal'][0],
    tolerance=df['tolerance'][0],
    resolution=df['resolution'][0])
print(gage.describe())
                   result_gage
n_samples         6.000000e+01
n_missing         6.000000e+00
n_outlier         0.000000e+00
min               1.000700e+00
max               1.001600e+00
R                 9.000000e-04
mean              1.000809e+00
median            1.000800e+00
std               1.306999e-04
sem               1.778600e-05
p_ad              9.866969e-20
lower             9.870000e-01
upper             1.013000e+00
cg                3.315484e+01
cgk               3.109092e+01
bias              8.092593e-04
p_bias            3.723292e-44
T_min_cg          5.214925e-03
T_min_cgk         1.330752e-02
T_min_res         2.000000e-03
resolution_ratio  7.692308e-04
RAISES DESCRIPTION
ValueError

If NaN values are found in the samples and nan_policy is set to 'raise'.

UserWarning

If NaN values are found in the samples and nan_policy is set to 'omit' or 'propagate'. The warning indicates that NaN values will be omitted from the analysis or may lead to unexpected results.

References

[1] Dr. Bill McNeese, BPI Consulting, LLC (09.2012) https://www.spcforexcel.com/knowledge/measurement-systems-analysis-gage-rr/anova-gage-rr-part-1/

[2] VDA Band 5, Mess- und Prüfprozesse. Eignung, Planung und Management (Juli 2021) 3. überarbeitete Auflage

resolution property writable

The resolution of the measurement.

reference property writable

The calibrated value of the sample under test.

u_cal property

The expanded uncertainty of the calibration.

specification property writable

The specification holding the limits, nominal and tolerance of the process.

tolerance_ratio property writable

Gets the ratio of the tolerance range used in the calculation of adjusted limits. This value represents the proportion of the total tolerance that is allocated for adjustments.

resolution_ratio_limit property writable

The limit of the resolution ratio.

limits property

The adjusted specification limits of the process (read-only).

lower property

The adjusted lower specification limit (read-only).

upper property

The adjusted upper specification limit (read-only).

cg_limit property

The limit of the capability index (read-only).

cgk_limit property

The limit of the capability index (read-only).

process property

The process for which the measurement system is to be evaluated (read-only).

nominal property

The nominal value of the specification (read-only).

tolerance property

The tolerance of the specification (read-only).

tolerance_adj property

The adjusted tolerance of the specification (tolerance_ratio * tolerance) (read-only).

n_outlier property

The number of outliers in the measurement process (read-only).

cg property

The repeatability of the measuring system without taking bias into account (read-only).

cgk property

The repeatability of the measuring system taking into account the bias(read-only).

bias property

The bias of the process (read-only).

p_bias property

The probability of the bias being significant by performing a t-test (read-only).

T_min_cg property

The minimum allowed tolerance for this testing system based on the capability cg of the process (read-only).

T_min_cgk property

The minimum allowed tolerance for this testing system based on the capability cgk of the process (read-only).

T_min_res property

The minimum allowed tolerance for this testing system based on the resolution of the testing system (read-only).

check()

Perform a few checks to determine if the testing system is capable of measuring the process.

estimate_resolution()

Estimate the resolution of the testing system.