Gage study model
daspi.anova.model.GageStudyModel(source, target, reference, tolerance, resolution, u_cal, u_bi=None, u_lin=None, u_rest=None, k=2, tolerance_ratio=0.2, q_ms_limit=0.15, cg_limit=1.33, cgk_limit=1.33, resolution_ratio_limit=0.05, alpha=0.05, bias_corrected=False)
¶
Bases: LinearModel
Calculates uncertainties for a measurement system (MSA Type 1 study), supporting one or multiple GageEstimator instances. If multiple are provided, the uncertainty for linearity is also calculated.
| PARAMETER | DESCRIPTION |
|---|---|
source
|
Pandas DataFrame as tabular data in a long format used for the model.
TYPE:
|
target
|
Column name for source data holding the measurement values.
TYPE:
|
reference
|
Column name holding the reference values for the measured parts.
This column is also used to identify which measured
values belong to which reference part. If the column has missing
values, the pandas method
TYPE:
|
tolerance
|
The specification limits for the measurement system. This can
be a float, a
TYPE:
|
resolution
|
The resolution of the measurement system. If None, the resolution is estimated from the data. If a float is given, it is interpreted as the resolution (e.g., 0.01 for a resolution of 0.01).
TYPE:
|
u_cal
|
The measurement uncertainty of the gage used to measure the
reference value. This parameter quantifies the uncertainty
associated with the measurement device itself, reflecting how
much the measured value could vary due to the inherent
limitations of the gage. If a float is specified, it is assumed
to be the expanded uncertainty with a coverage factor of
TYPE:
|
u_bi
|
The uncertainty for bias
TYPE:
|
u_lin
|
The measurement uncertainty for linearity
TYPE:
|
u_rest
|
The uncertainty for further uncertainties not covered by the parameters above. This parameter accounts for all additional sources of uncertainty that may affect the overall measurement but are not specifically addressed by the default uncertainties provided here. It provides a more comprehensive assessment of measurement uncertainty by considering factors that may arise from environmental conditions, operator influences, or other unknown variables. If known, it can be specified here; otherwise, the default value is None.
TYPE:
|
k
|
The coverage factor for expanded uncertainty. It is used as a
multiplier to determine the expanded uncertainty based on the
standard uncertainty. The value of
TYPE:
|
tolerance_ratio
|
The ratio of the tolerance to the standard deviation of the measurement system. If the ratio is below this limit, the measurement system is considered unacceptable. Default is 0.2.
TYPE:
|
q_ms_limit
|
The limit for the Q_MS value. If the Q_MS is below this limit, the measurement system is considered acceptable. Default is 0.15.
TYPE:
|
cg_limit
|
The limit for the Gage R&R study's Cg value. If the Cg value below this limit, the measurement system is considered unacceptable. Default is 1.33.
TYPE:
|
cgk_limit
|
The limit for the Gage R&R study's Cgk value. If the Cgk value is below this limit, the measurement system is considered unacceptable. Default is 1.33.
TYPE:
|
resolution_ratio_limit
|
The ratio of the resolution to the standard deviation of the measurement system. If the ratio is below this limit, the measurement system is considered unacceptable. Default is 0.05.
TYPE:
|
bias_corrected
|
Indicates whether the bias is corrected for the Gage R&R study. If True, the bias is not included in the measurement uncertainty; otherwise, it is included. Default is False.
TYPE:
|
Examples:
Run the following command in a jupyter notebook to get the html
output of gage or you can also use print(repr(gage)) instead:
import daspi as dsp
df = dsp.load_dataset('grnr_layer_thickness')
gage = dsp.GageStudyModel(
source=df,
target='result_gage',
reference='reference',
u_cal=df['U_cal'][0],
tolerance=df['tolerance'][0],
resolution=df['resolution'][0],)
chart = dsp.GageStudyCharts(
gage, stretch_figsize=1.5
).plot(
).stripes(
).label(
) # .save('path/to/file.png')
gage # or print(repr(gage))
Notes
If only one reference is provided, the uncertainty for linearity (LIN) will be 0.0. If multiple references are provided, the uncertainty for linearity will be calculated based on the standard deviation of the biases of the GageEstimator instances.
gage
property
¶
Returns the GageEstimator instances (read-only).
ref_gages
property
¶
Returns a list of GageEstimator instances used in the model (read_only).
If only one reference is used, it returns a list containing one GageEstimator of that reference. If multiple references are used, it returns a list of GageEstimator instances for each reference part measured.
bias_corrected
property
¶
Whether the bias is corrected for the Gage R&R study. If True, the bias itself is not included in the measurement uncertainty; otherwise, it is.
bias
property
¶
Returns the bias of the Gage study (read-only).
n_samples
property
¶
The number of samples used in the Gage study (read-only).
n_references
property
¶
Get the amount of references used in the study (read-only).
n_replications
property
¶
Get the number of replications for each reference (read-only).
tolerance
property
¶
Returns the tolerance of the first GageEstimator instance (read-only).
resolution
property
¶
Returns the resolution of the first GageEstimator instance (read-only).
k
property
writable
¶
Get the coverage factor k used in uncertainty
calculations.
This property returns the coverage factor, which is a multiplier
used to determine the expanded uncertainty based on the standard
uncertainty. The value of k is typically set to reflect the
desired confidence level in the measurement results.
Set the coverage factor with a positive number, typical values are: - k=2 corresponds to a confidence interval of 95.45% - k=3 corresponds to a confidence interval of 99.73%
u_cal
property
¶
The expanded uncertainty of the calibration.
u_re
property
¶
The uncertainty of the resolution of the testing system (read-only).
u_bi
property
¶
The uncertainty of the bias of the testing system (read-only).
u_lin
property
¶
The uncertainty of linearity of the measurement system (read-only).
u_evr
property
¶
The uncertainty of the expanded variance ratio of the testing system (read-only).
u_rest
property
¶
The uncertainty of the repeatability of the testing system (read-only).
u_ms
property
¶
The uncertainty of the measurement system (read-only).
q_ms_limit
property
¶
Get the provided limit for the Q_MS as float between 0 and 1 (read-only).
T_min_UMS
property
¶
The minimum allowed tolerance for this testing system based on the uncertainty (read-only).
from_gage_estimators(gages, k=2, bias_corrected=False)
staticmethod
¶
Create a GageStudyModel from a list of GageEstimator instances. This method is useful when you already have GageEstimator instances and want to create a GageStudyModel without needing to provide the source DataFrame and other parameters again.
| PARAMETER | DESCRIPTION |
|---|---|
gages
|
A list of GageEstimator instances to create the model from.
TYPE:
|
k
|
The coverage factor for expanded uncertainty. It is used as
a multiplier to determine the expanded uncertainty based on
the standard uncertainty. The value of
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
GageStudyModel
|
A new GageStudyModel instance created from the provided GageEstimator instances. |
references_analysis()
¶
Returns a DataFrame with the analysis of the reference parts.
The analysis includes the GageEstimator statistics for each reference part, such as Cg, Cgk, resolution ratio, and bias.
| RETURNS | DESCRIPTION |
|---|---|
DataFrame
|
Analysis of the reference parts with GageEstimator statistics. |
Examples:
capabilities()
¶
Returns a DataFrame with the capabilities of the measurement system.
The capabilities include Cg, Cgk, and the ratio of resolution the .
| RETURNS | DESCRIPTION |
|---|---|
DataFrame
|
Capabilities for Cp, Cpk, Cg, Cgk and the ratio of resolution to standard deviation. |
Examples:
uncertainties()
¶
Returns a DataFrame with the uncertainties for the measurement system.
The table contains the following rows:
- CAL: Calibration uncertainty
- RE: Resolution uncertainty
- BI: Bias uncertainty
- LIN: Linearity uncertainty
- EVR: Equipment Variation on the Reference
- REST: Other known and provided uncertainty
- MS: Measurement System uncertainty
The table contains the following columns:
- u: The measurement uncertainty for the respective components
- U: The expanded uncertainty as k * u
- Q: The Quality Indicator serves as a quality indicator for the measurement process, reflecting how well the measurement system performs in relation to the specified requirements and tolerances.
- rank: The rank of the uncertainty component, where a lower rank indicates a more significant contribution to the overall uncertainty.
| RETURNS | DESCRIPTION |
|---|---|
DataFrame
|
Uncertainties for CAL, RE, BI, LIN, EVR, REST, MS. |
Examples: