Skip to content

Instantly share code, notes, and snippets.

@FlorianHeinrichs
Created November 22, 2020 10:21
Show Gist options
  • Select an option

  • Save FlorianHeinrichs/7cce8db8df49720ad1a850cac4c080e2 to your computer and use it in GitHub Desktop.

Select an option

Save FlorianHeinrichs/7cce8db8df49720ad1a850cac4c080e2 to your computer and use it in GitHub Desktop.
log_returns = np.log(ticker_df['Open']).diff()[1:]
n = log_returns.shape[0]
test_statistic = n**(1/2) * max(abs(calculate_cusum(log_returns)))
lrv_estimator = estimate_lrv(log_returns)
if test_statistic > quantile * lrv_estimator**(1/2):
print('The null hypothesis can be rejected.')
else:
print('The null hypothesis cannot be rejected.')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment