# Evaluating type-B uncertainty¶

The prefix type_b (or the alias tb) is needed as to resolve the names of objects defined in this module.

## Real-valued problems¶

The following functions convert the half-width of a one-dimensional distribution to a standard uncertainty:

## Complex-valued problems¶

The following functions convert information about two-dimensional error distributions into standard uncertainties:

## A table of distributions¶

The mapping distribution allows the functions above to be selected by name. For example,

>>> a = 1.5
>>> ureal( 1, type_b.distribution['gaussian'](a) )
ureal(1,1.5,inf)
>>> ureal( 1, type_b.distribution['uniform'](a) )
ureal(1,0.8660254037844387,inf)
>>> ureal( 1, type_b.distribution['arcsine'](a) )
ureal(1,1.06066017177982,inf)


The names are (case-sensitive):

• ‘gaussian’
• ‘uniform’
• ‘triangular’
• ‘arcsine’ or ‘u_shaped’
• ‘uniform_ring’
• ‘uniform_disk’

## Module contents¶

uniform(a)

Return the standard uncertainty for a uniform distribution.

Parameters: a – the half-width

Example:

>>> x = ureal(1,type_b.uniform(1))
>>> summary(x)
'1.00, u=0.58, df=inf'

triangular(a)

Return the standard uncertainty for a triangular distribution.

Parameters: a – the half-width

Example:

>>> x = ureal(1,type_b.triangular(1))
>>> summary(x)
'1.00, u=0.41, df=inf'

u_shaped(a)

Return the standard uncertainty for an arcsine distribution.

Parameters: a – the half-width

Example:

>>> x = ureal(1,type_b.arcsine(1))
>>> summary(x)
'1.00, u=0.71, df=inf'

arcsine(a)

Return the standard uncertainty for an arcsine distribution.

Parameters: a – the half-width

Example:

>>> x = ureal(1,type_b.arcsine(1))
>>> summary(x)
'1.00, u=0.71, df=inf'

uniform_ring(a)

Return the standard uncertainty for a uniform ring

Convert the radius a of a uniform ring distribution (in the complex plane) to a standard uncertainty

See reference: B D Hall, Metrologia 48 (2011) 324-332

Example:

>>> z = ucomplex( 0, type_b.uniform_ring(1) )
>>> summary(z)
'(0.00+0.00j), u=[0.71,0.71], r=0.00, df=inf'

uniform_disk(a)

Return the standard uncertainty for a uniform disk

Convert the radius a of a uniform disk distribution (in the complex plane) to a standard uncertainty.

See reference: B D Hall, Metrologia 48 (2011) 324-332

Example:

>>> z = ucomplex( 0, type_b.uniform_disk(1) )
>>> summary(z)
'(0.00+0.00j), u=[0.50,0.50], r=0.00, 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 and u2 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) )
>>> summary(X)
'(0.000+0.000j), u=[0.014,0.014], r=0.000, df=inf'