strange results - 1 var time series
Opened this issue · 0 comments
andrewcztrack commented
Hi @davidhallac .
I am trying your algorithm on 1 dimensional finanical tiem series but im getting very strange results. Has it got to do with the parameters?
from TICC_solver import TICC
import numpy as np
import sys
import yfinance as yf
import numpy as np
import matplotlib.pyplot as plt
import pandas as pd
data = yf.download("^GSPC", start="2016-01-01", end="2020-12-30")
dd=data['Close']
d=dd.to_numpy()
np.savetxt("foo.txt", d, delimiter=",")
ticc = TICC(window_size=30, number_of_clusters=3, lambda_parameter=11e-2, beta=600, maxIters=5, threshold=2e-1,
write_out_file=False, prefix_string="output_folder/", num_proc=1)
(cluster_assignment, cluster_MRFs) = ticc.fit(input_file='foo.csv')
print(cluster_assignment)
np.savetxt('Results.txt', cluster_assignment, fmt='%d', delimiter=',')
%matplotlib inline
import matplotlib.pyplot as plt
import datetime
import numpy as np
plt.plot(data['Close'])
plt.show()
plt.plot(cluster_assignment)
plt.show()
The above code gives the below.