Evaluating type-B uncertainty¶
The shorter name tb
has been defined as an alias for type_b
, to resolve the
names of objects in this module.
Real-valued problems¶
Functions are provided that convert the half-width of a one-dimensional distribution to a standard uncertainty:
Complex-valued problems¶
The following functions convert information about two-dimensional distributions into standard uncertainties:
A table of distributions¶
The mapping
distribution
is provided so that the functions above can be selected by name. For example,>>> a = 1.5 >>> ureal( 1, type_b.distribution['gaussian'](a) ) ureal(1.0,1.5,inf) >>> ureal( 1, type_b.distribution['uniform'](a) ) ureal(1.0,0.8660254037844387,inf) >>> ureal( 1, type_b.distribution['arcsine'](a) ) ureal(1.0,1.0606601717798212,inf)Keys to
distribution
are (case-sensitive):
- gaussian
- uniform
- triangular
- arcsine
- u_shaped
- uniform_ring
- uniform_disk
Module contents¶
-
uniform
(a)¶ Return the standard uncertainty for a uniform distribution.
Parameters: a (float) – the half-width Example:
>>> x = ureal(1,type_b.uniform(1)) >>> x ureal(1.0,0.5773502691896258,inf)
-
triangular
(a)¶ Return the standard uncertainty for a triangular distribution.
Parameters: a (float) – the half-width Example:
>>> x = ureal(1,type_b.triangular(1)) >>> x ureal(1.0,0.4082482904638631,inf)
-
u_shaped
(a)¶ Return the standard uncertainty for an arcsine distribution.
Parameters: a (float) – the half-width Example:
>>> x = ureal(1,type_b.arcsine(1)) >>> x ureal(1.0,0.7071067811865475,inf)
-
arcsine
(a)¶ Return the standard uncertainty for an arcsine distribution.
Parameters: a (float) – the half-width Example:
>>> x = ureal(1,type_b.arcsine(1)) >>> x ureal(1.0,0.7071067811865475,inf)
-
uniform_ring
(a)¶ Return the standard uncertainty for a uniform ring
Parameters: a (float) – the radius Convert the radius of a uniform ring distribution
a
to a standard uncertaintySee reference: B D Hall, Metrologia 48 (2011) 324-332
Example:
>>> z = ucomplex( 0, type_b.uniform_ring(1) ) >>> z ucomplex((0+0j), u=[0.7071067811865475,0.7071067811865475], r=0.0, df=inf)
-
uniform_disk
(a)¶ Return the standard uncertainty for a uniform disk
Parameters: a (float) – the radius Convert the radius of a uniform disk distribution
a
to a standard uncertainty.See reference: B D Hall, Metrologia 48 (2011) 324-332
Example:
>>> z = ucomplex( 0, type_b.uniform_disk(1) ) >>> z ucomplex((0+0j), u=[0.5,0.5], r=0.0, df=inf)
-
unknown_phase_product
(u1, u2)¶ Return the standard uncertainty for a product when phases are unknown
Parameters: - u1 – the standard uncertainty of the first multiplicand
- u2 – the standard uncertainty of the second multiplicand
Obtains the standard uncertainty associated with a complex product when estimates have unknown phase.
The arguments
u1
andu2
are the standard uncertainties associated with each multiplicand.See reference: B D Hall, Metrologia 48 (2011) 324-332
Example:
# X = Gamma1 * Gamma2 >>> X = ucomplex( 0, type_b.unknown_phase_product(.1,.1) ) >>> X ucomplex((0+0j), u=[0.014142135623730954,0.014142135623730954], r=0.0, df=inf)