Useful Functions#
Here are some useful functions to use with PBA objects.
- pba.core.env(*args)#
Warning
Deprecated function, use envelope() instead.
- pba.core.envelope(*args: Interval | Pbox | float) Interval | Pbox #
Allows the envelope to be calculated for intervals and p-boxes.
The envelope is the smallest interval/pbox that contains all values within the arguments.
- Parameters:
*args
: The arguments for which the envelope needs to be calculated. The arguments can be intervals, p-boxes, or floats.- Returns:
Pbox|Interval
: The envelope of the given arguments, which can be an interval or a p-box.
Error
ValueError
: If less than two arguments are given.TypeError
: If none of the arguments are intervals or p-boxes.
- pba.core.mean(*args: list | tuple, method='f')#
Allows the mean to be calculated for intervals and p-boxes
Parameters:
l : list of pboxes or intervals
method : pbox addition method to be used
Output:
Interval | Pbox
: mean of interval or pbox objects within*args
Important
Implemented as
>>> pba.sum(*args,method = method)/len(args)
- pba.core.mul(*args, method=None)#
- pba.core.sqrt(a)#
- pba.core.sum(*args: list | tuple, method='f')#
Allows the sum to be calculated for intervals and p-boxes
Parameters:
*args
: pboxes or intervalsmethod
(f,i,o,p
): addition method to be usedReturns:
Interval | Pbox
: sum of interval or pbox objects within*args
Note
If a list or tuple is given as the first argument, the elements of the list or tuple are used as arguments. If only one (non-list) argument is given, the argument is returned.