geodat.signal

geodat.signal.detrend(y, x=None, axis=0)[source]

Make use of regress(y,x,axis) Return ydtd = y - slope*x[xtoy] - intercept

geodat.signal.ma_polyfit_fix(x, y, *args, **kwargs)[source]

Temporary work around for numpy.ma.polyfit

geodat.signal.princomp(data, numpc=0, var_dim=1, normalise=True)[source]

Compute the principal component for data Input: numpc - number of PC to be extracted (default - 0 = ALL PC) var_dim - the dimension corresponding to the variable (default 1 - col) normalise - whether the vectors are normalised (default - True) Return: evecs (eigenvectors), evals (eigenvalues), score (projection)

geodat.signal.regress(y, x, axis=0, reverse=False)[source]

Regress y with x (or x with y if reverse is True) where x is an 1D array

where x is 1D of shape (M,), y is (...,M,...) axis specifies where M is in y

Parameters:
  • y (numpy array) –
  • x (numpy array) –
  • axis (int) –
  • reverse (bool) – if False (default), then y = slope*x + intercept if True, then x = slope*y + intercept
Returns:

slope, intercept, p, corr

where p is the p-value of the correlation. corr is the correlation coefficient

Fork me on GitHub