Skip to content

API Reference

Caden Gobat edited this page Sep 2, 2022 · 2 revisions

asymmetric_uncertainty.a_u

class asymmetric_uncertainty.a_u(nominal, pos_err=0, neg_err=0)

Class for representing and handling propagation of asymmetric uncertainties assuming a pseudo-Gaussian probability distribution where the plus and minus errors in each direction of the nominal value are like modified 1-sigma standard deviations.

Parameters

nominal : numeric
Nominal value of the represented quantity

pos_err : numeric
Plus error on the value

neg_err : numeric
Minus error on the value

Attributes

value : numeric
The nominal value of the represented quantity

plus : numeric
The positive error on the value

minus : numeric
The negative error on the value

maximum : numeric
The negative error on the value

minimum : numeric
The negative error on the value

sign : 1 or -1
1 if value is positive or 0, -1 if value is negative

is_symmetric : bool
True if plus and minus are equal. False otherwise.

Methods

asymmetric_uncertainty.a_u.items

func asymmetric_uncertainty.a_u.items()

Returns a tuple of (value,plus,minus).

asymmetric_uncertainty.a_u.add_error

func asymmetric_uncertainty.a_u.add_error(delta, method='quadrature', inplace=False)

Adds delta to an instance's existing error. Possible methods are "quadrature", "straight", or "split". If inplace is True, the object's errors are modified in place. If it is False, a new instance is returned.

asymmetric_uncertainty.a_u.pdf

func asymmetric_uncertainty.a_u.pdf(x)

Computes and returns the values of the probability distribution function for the specified input.

asymmetric_uncertainty.a_u.cdf

func asymmetric_uncertainty.a_u.cdf(x)

Computes and returns the values of the cumulative distribution function for the specified input.

asymmetric_uncertainty.a_u.pdfplot

func pdfplot(num_sigma=5, discretization=100, **kwargs)

Plots the associated PDF over the specified number of sigma, using 2*discretization points. **kwargs are passed on to matplotlib for configuration of the resulting plot.

asymmetric_uncertainty.a_u.cdfplot

func cdfplot(num_sigma=5, discretization=100, **kwargs)

Plots the associated CDF over the specified number of sigma, using 2*discretization points. **kwargs are passed on to matplotlib for configuration of the resulting plot.

asymmetric_uncertainty.a_u.isna

func asymmetric_uncertainty.a_u.isna()

pandas-style NaN checker. Returns True if value is NaN or None, and False if neither.

asymmetric_uncertainty.a_u.notna()

func asymmetric_uncertainty.a_u.notna()

Inverse of isna(). Returns True if value is neither NaN nor None, and False if it is.


asymmetric_uncertainty.UncertaintyArray

class asymmetric_uncertainty.UncertaintyArray(array)

Class for representing an array of a_u objects. Mostly provides utilities for slicing and accessing various attributes.


asymmetric_uncertainty.pos_errors

func asymmetric_uncertainty.pos_errors(array)

Stand-alone function to return an array of the positive errors of an array of a_u objects. Functional equivalent to UncertaintyArray(array).plus.

asymmetric_uncertainty.neg_errors

func asymmetric_uncertainty.neg_errors(array)

Stand-alone function to return an array of the negative errors of an array of a_u objects. Functional equivalent to UncertaintyArray(array).minus.