lppls
lppls copied to clipboard
add future days forecast for the fitted lines
I tried to extend the fitted line into future days. It would be useful to update the lppls_model.plot_fit() function.
# extend
new_dates = pd.date_range(start=data.index[-1] + pd.Timedelta(days=1), periods=500)
t = [pd.Timestamp.toordinal(timestamp) for timestamp in new_dates]
y = a + np.power(tc - t, m) * (b + ((c1 * np.cos(w * np.log(tc - t))) + (c2 * np.sin(w * np.log(tc - t)))))
plt.plot(new_dates, y)
plt.show()