seg1d.optimized_funcs.vcor

seg1d.optimized_funcs.vcor(x, y)[source]

Rolling correlation between two arrays. Optimized by numba if available

Parameters:
x1D array

array to use as static data

y1D array

array to use as rolling data

Returns:
1D array

correlations at each increment

size = (size(x) - size(y)) + 1

Notes

Required: size(x) > size(y) This will try to use numba for optimization.

Examples

>>> import numpy as np
>>> import seg1d.optimized_funcs as optF
>>> x = np.sin( np.linspace(-3, 3, 25) )
>>> y = np.sin( np.linspace(-3, 3, 20) )
>>> optF.vcor(x,y)
array([0.83212194, 0.90933756, 0.94493014, 0.94493014, 0.90933756,
       0.83212194])