linear_regression

HSTB.kluster.modules.wobble.linear_regression(x, y)

Wrap numpy’s polyfit (degree one) to also generate percent deviation from the standard error of y values

x and y inputs can be 1d or 2d

Parameters
  • x (array) – numpy array (2d ping/beam or 1d vals) for x vals

  • y (array) – numpy array (2d ping/beam or 1d vals) for y val

Returns

  • np.array – numpy array (ping) slope for each ping

  • np.array – numpy array (ping) y intercept from regression

  • np.array – numpy array (ping) standard deviation of the noise in z (standard error of the model)

  • np.array – numpy array (ping) percent deviation of the model