diff --git a/preprocessing/preprocessors.py b/preprocessing/preprocessors.py index b1d0a41f5..91db3d316 100644 --- a/preprocessing/preprocessors.py +++ b/preprocessing/preprocessors.py @@ -133,7 +133,7 @@ def calcualte_turbulence(df): hist_price = df_price_pivot[[n in unique_date[0:i] for n in df_price_pivot.index ]] cov_temp = hist_price.cov() current_temp=(current_price - np.mean(hist_price,axis=0)) - temp = current_temp.values.dot(np.linalg.inv(cov_temp)).dot(current_temp.values.T) + temp = current_temp.values.dot(np.linalg.pinv(cov_temp)).dot(current_temp.values.T) if temp>0: count+=1 if count>2: