4.6.6 pde.tools.math module

Auxiliary mathematical functions

class OnlineStatistics(*args, **kwargs)[source]

Bases: OnlineStatistics

class for using an online algorithm for calculating statistics

class_type = jitclass.OnlineStatistics#7f178cd20750<min:float64,max:float64,mean:float64,_mean2:float64,count:uint64>
count: int

recorded number of items

Type:

int

mean: float

recorded mean

Type:

float

class SmoothData1D(x, y, sigma=None)[source]

Bases: object

allows smoothing data in 1d using a Gaussian kernel of defined width

The data is given a pairs of x and y, the assumption being that there is an underlying relation y = f(x).

initialize with data

Parameters:
  • x – List of x values

  • y – List of y values

  • sigma (float) – The size of the smoothing window in units of x. If omitted, the average distance of x values multiplied by sigma_auto_scale is used.

property bounds: tuple[float, float]

return minimal and maximal x values

derivative(xs)[source]

return the derivative of the smoothed values for the positions xs

Note that this value

Parameters:

xs (list of ndarray) – the x-values

Returns:

The associated values of the derivative

Return type:

ndarray

sigma_auto_scale: float = 10

scale for setting automatic values for sigma

Type:

float