sasdata.data_util.uncertainty module

Uncertainty propagation class for arithmetic, log and exp.

Based on scalars or numpy vectors, this class allows you to store and manipulate values+uncertainties, with propagation of gaussian error for addition, subtraction, multiplication, division, power, exp and log.

Storage properties are determined by the numbers used to set the value and uncertainty. Be sure to use floating point uncertainty vectors for inplace operations since numpy does not do automatic type conversion. Normal operations can use mixed integer and floating point. In place operations such as a *= b create at most one extra copy for each operation. By contrast, c = a*b uses four intermediate vectors, so shouldn’t be used for huge arrays.

class sasdata.data_util.uncertainty.Uncertainty(x, variance=None)

Bases: object

__abs__()
__add__(other)
__and__(other)
__coerce__()
__complex__()
__delitem__(key)
__dict__ = mappingproxy({'__module__': 'sasdata.data_util.uncertainty', '_getdx': <function Uncertainty._getdx>, '_setdx': <function Uncertainty._setdx>, 'dx': <property object>, '__init__': <function Uncertainty.__init__>, '__len__': <function Uncertainty.__len__>, '__getitem__': <function Uncertainty.__getitem__>, '__setitem__': <function Uncertainty.__setitem__>, '__delitem__': <function Uncertainty.__delitem__>, '__add__': <function Uncertainty.__add__>, '__sub__': <function Uncertainty.__sub__>, '__mul__': <function Uncertainty.__mul__>, '__truediv__': <function Uncertainty.__truediv__>, '__pow__': <function Uncertainty.__pow__>, '__radd__': <function Uncertainty.__radd__>, '__rsub__': <function Uncertainty.__rsub__>, '__rmul__': <function Uncertainty.__rmul__>, '__rtruediv__': <function Uncertainty.__rtruediv__>, '__rpow__': <function Uncertainty.__rpow__>, '__iadd__': <function Uncertainty.__iadd__>, '__isub__': <function Uncertainty.__isub__>, '__imul__': <function Uncertainty.__imul__>, '__itruediv__': <function Uncertainty.__itruediv__>, '__ipow__': <function Uncertainty.__ipow__>, '__div__': <function Uncertainty.__div__>, '__rdiv__': <function Uncertainty.__rdiv__>, '__idiv__': <function Uncertainty.__idiv__>, '__neg__': <function Uncertainty.__neg__>, '__pos__': <function Uncertainty.__pos__>, '__abs__': <function Uncertainty.__abs__>, '__str__': <function Uncertainty.__str__>, '__repr__': <function Uncertainty.__repr__>, '__floordiv__': <function Uncertainty.__floordiv__>, '__mod__': <function Uncertainty.__mod__>, '__divmod__': <function Uncertainty.__divmod__>, '__lshift__': <function Uncertainty.__lshift__>, '__rshift__': <function Uncertainty.__rshift__>, '__and__': <function Uncertainty.__and__>, '__xor__': <function Uncertainty.__xor__>, '__or__': <function Uncertainty.__or__>, '__rfloordiv__': <function Uncertainty.__rfloordiv__>, '__rmod__': <function Uncertainty.__rmod__>, '__rdivmod__': <function Uncertainty.__rdivmod__>, '__rlshift__': <function Uncertainty.__rlshift__>, '__rrshift__': <function Uncertainty.__rrshift__>, '__rand__': <function Uncertainty.__rand__>, '__rxor__': <function Uncertainty.__rxor__>, '__ror__': <function Uncertainty.__ror__>, '__ifloordiv__': <function Uncertainty.__ifloordiv__>, '__imod__': <function Uncertainty.__imod__>, '__idivmod__': <function Uncertainty.__idivmod__>, '__ilshift__': <function Uncertainty.__ilshift__>, '__irshift__': <function Uncertainty.__irshift__>, '__iand__': <function Uncertainty.__iand__>, '__ixor__': <function Uncertainty.__ixor__>, '__ior__': <function Uncertainty.__ior__>, '__invert__': <function Uncertainty.__invert__>, '__complex__': <function Uncertainty.__complex__>, '__int__': <function Uncertainty.__int__>, '__long__': <function Uncertainty.__long__>, '__float__': <function Uncertainty.__float__>, '__oct__': <function Uncertainty.__oct__>, '__hex__': <function Uncertainty.__hex__>, '__index__': <function Uncertainty.__index__>, '__coerce__': <function Uncertainty.__coerce__>, 'log': <function Uncertainty.log>, 'exp': <function Uncertainty.exp>, '__dict__': <attribute '__dict__' of 'Uncertainty' objects>, '__weakref__': <attribute '__weakref__' of 'Uncertainty' objects>, '__doc__': None, '__annotations__': {}})
__div__(other)
__divmod__(other)
__doc__ = None
__float__()
__floordiv__(other)
__getitem__(key)
__hex__()
__iadd__(other)
__iand__(other)
__idiv__(other)
__idivmod__(other)
__ifloordiv__(other)
__ilshift__(other)
__imod__(other)
__imul__(other)
__index__()
__init__(x, variance=None)
__int__()
__invert__()
__ior__(other)
__ipow__(other)
__irshift__(other)
__isub__(other)
__itruediv__(other)
__ixor__(other)
__len__()
__long__()
__lshift__(other)
__mod__(other)
__module__ = 'sasdata.data_util.uncertainty'
__mul__(other)
__neg__()
__oct__()
__or__(other)

Return self|value.

__pos__()
__pow__(other)
__radd__(other)
__rand__(other)
__rdiv__(other)
__rdivmod__(other)
__repr__()

Return repr(self).

__rfloordiv__(other)
__rlshift__(other)
__rmod__(other)
__rmul__(other)
__ror__(other)

Return value|self.

__rpow__(other)
__rrshift__(other)
__rshift__(other)
__rsub__(other)
__rtruediv__(other)
__rxor__(other)
__setitem__(key, value)
__str__()

Return str(self).

__sub__(other)
__truediv__(other)
__weakref__

list of weak references to the object

__xor__(other)
_getdx()
_setdx(dx)
property dx

standard deviation

exp()
log()
sasdata.data_util.uncertainty.exp(val)
sasdata.data_util.uncertainty.log(val)
sasdata.data_util.uncertainty.test()