Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def ar_model():
- # Wczytanie danych X
- dataframe = read_csv('ALIOR.mst', usecols=[2], engine='python', skipfooter=3)
- dataset = dataframe.values
- dataset = dataset.astype('float32')
- dataset_X = dataset[1:51, :]
- # print('dataset_X.shape =', dataset_X.shape)
- # print(dataset_X)
- # Wczytanie danych Y
- dataframe = read_csv('ALIOR.mst', usecols=[1], engine='python', skipfooter=3)
- dataset = dataframe.values
- dataset = dataset.astype('int')
- dataset_Y = dataset[1:51, :]
- # print('dataset_Y.shape =', dataset_Y.shape)
- # print(dataset_Y)
- y = dataset_X
- # normalize the dataset
- x = dataset_Y
- import datetime as dt
- # x = [dt.datetime.strptime([:,0], '%m/%d/%Y').date() for d in x]
- plt.gca().xaxis.set_major_formatter(mdates.DateFormatter('%Y%m%d'))
- plt.gca().xaxis.set_major_locator(mdates.DayLocator(interval=5))
- plt.plot(x,y)
- plt.gcf().autofmt_xdate()
- #
- # c = np.hstack([x * x * x, x * x, x, np.ones(x.shape)])
- # v = np.linalg.pinv(c) @ y
- #
- # c1 = np.hstack([1 / x, np.ones(x.shape)])
- # v1 = np.linalg.pinv(c1) @ y
- #
- #
- # plt.plot(y, 'ro')
- # plt.plot(x, v[0] * x * x * x + v[1] * x * x + v[2] * x + v[3], )
- # plt.plot(x, v1[0] / x + v1[1])
- plt.show()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement