Module cma :: Class Misc :: Class MathHelperFunctions
[hide private]
[frames] | no frames]

Class MathHelperFunctions

source code

object --+
         |
        Misc.MathHelperFunctions

static convenience math helper functions, if the function name is preceded with an "a", a numpy array is returned
Instance Methods [hide private]

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __init__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Static Methods [hide private]
 
aclamp(x, upper) source code
 
equals_approximately(a, b, eps=1e-12) source code
 
vequals_approximately(a, b, eps=1e-12) source code
 
expms(A, eig=<function eigh at 0x105962cf8>)
matrix exponential for a symmetric matrix
source code
 
amax(vec, vec_or_scalar) source code
 
max(vec, vec_or_scalar) source code
 
minmax(val, min_val, max_val) source code
 
aminmax(val, min_val, max_val) source code
 
amin(vec_or_scalar, vec_or_scalar2) source code
 
min(a, b) source code
 
norm(vec, expo=2) source code
 
apos(x, lower=0)
clips argument (scalar or array) from below at lower
source code
 
prctile(data, p_vals=[0, 25, 50, 75, 100], sorted_=False)
prctile(data, 50) returns the median, but p_vals can also be a sequence.
source code
 
sround(nb)
return stochastic round: floor(nb) + (rand()<remainder(nb))
source code
 
cauchy_with_variance_one() source code
 
standard_finite_cauchy(size=1) source code
Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

prctile(data, p_vals=[0, 25, 50, 75, 100], sorted_=False)
Static Method

source code 

prctile(data, 50) returns the median, but p_vals can also be a sequence.

Provides for small samples better values than matplotlib.mlab.prctile, however also slower.