Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix #4

Closed
KatIsHere opened this issue Nov 7, 2018 · 1 comment
Closed

Fix #4

KatIsHere opened this issue Nov 7, 2018 · 1 comment

Comments

@KatIsHere
Copy link

Hello, Sir,
I would like to question you about this part in "hurst":
"
elif kind == 'change':
incs = series
_series = np.hstack([[0.],np.cumsum(incs)])
mean_inc = (series[-1] - series[0]) / len(incs)
deviations = incs - mean_inc
Z = np.cumsum(deviations)
R = max(Z) - min(Z)
S = np.std(incs, ddof=1)
"
shouldn't it be there like this
"mean_inc = (_series[-1] - _series[0])/len(incs)"?
Sorry in advance if I am wrong.

@Mottl
Copy link
Owner

Mottl commented Nov 8, 2018

Thanks for the notification!
Previous code was overcomplicated. I improved it a bit.

hurst/hurst/__init__.py

Lines 93 to 99 in bfcd29f

elif kind == 'change':
incs = series
mean_inc = np.sum(incs) / len(incs)
deviations = incs - mean_inc
Z = np.cumsum(deviations)
R = max(Z) - min(Z)
S = np.std(incs, ddof=1)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants