Trendy icon indicating copy to clipboard operation
Trendy copied to clipboard

minitrend fixed

Open lymadvisors opened this issue 4 years ago • 2 comments

sorry for the way I do this, it is my first comment

only include this

x = x[window+1:] y = y[window+1:]

before

Find whether max's or min's

maxi = ((y[x[crit]] - y[x[crit] + window] > 0) & \
       (y[x[crit]] - y[x[crit] - window] > 0) * 1)
mini = ((y[x[crit]] - y[x[crit] + window] < 0) & \
       (y[x[crit]] - y[x[crit] - window] < 0) * 1)
maxi = maxi.astype(float)

image

lymadvisors avatar Feb 15 '21 12:02 lymadvisors

Hi @lymadvisors When running the minitrend, I get following error afbeelding

Are you having the same problem? Even with the fix you described, I still get same error.

glenn-boudaer1990 avatar Feb 16 '21 19:02 glenn-boudaer1990

dy is first derivative of size window, crit includes second derivative always of size 1. Hence, you need to adjust crit parameter by: crit = np.append(crit,[False]*(window+1))

smjure avatar Mar 24 '21 02:03 smjure