preprocessing

exception pydaddy.preprocessing.Error

Bases: Exception

Base class for exceptions in this module.

exception pydaddy.preprocessing.InputError(expression, message)

Bases: pydaddy.preprocessing.Error

Exception raised for errors in the input.

Attributes:

expression – input expression in which the error occurred message – explanation of the error

class pydaddy.preprocessing.Preprocessing(**kwargs)

Bases: pydaddy.analysis.GaussianTest

pass

_find_order(x)

Get expected order by elemination least likely to be values from all possble values. Then decides the order by looking at the R2 values.

_get_o1_o2(x)

Get o1 and o2 values for r2_adjusted multiple Dt

_o1(x, i=0)

All possible values of order

_o2(x)

Least likely values of order

_optimium_timescale(X, M_square, t_int, Dt='auto', max_order=10, t_lag=1000, inc=0.01)

Get timescale based on observed order of drift

_order(X, M_square, t_int, Dt='auto', dt=1, max_order=10, inc=0.01)

Find the order of drift and diffusion, and timescale based on drift order.

Notes

Time scale = autocorrelation time if drift order is 1, else its auto correaltion time.

_preprocess()
_r2_vs_order(op1, op2, avgDrift, avgDiff, max_order)

Get R2 for different order

_r2_vs_order_multi_dt(X, M_square, t_int, dt=1, max_order=10, inc=0.01)

Get R2 vs order for different Dt

_remove_nan(x, y, sample_size=10)

Removes NaN’s by deleting the indices where both x and y have NaN’s

Parameters
  • x (array) – first input

  • y (array) – second input

Returns

x, y - with all nan’s removed

Return type

array

_remove_outliers(xs, y, quantile=0.01)

Remove points corresponding to outliers in y. xs is a list of one or more arrays, indices corresponding to outliers in y will be removed from each array in xs as well.

_rms_variation(x)

Get rms variation of array

_timestep(t)
_validate_inputs()

Initailize and validate all inputs.