Taking data till same day and predicting for the same day in multivariate LSTM stock market forecasting - time-series

In this below Github post, the author predicted the next "1" day with a multivariate LSTM model. But I think he is taking data till the same day and also predicting for the same day. I am not sure though.
Is it okay to take data including the same day to predict the day? What can I do to predict the next day's price without taking its own data in this code?
https://github.com/flo7up/relataly-public-python-tutorials/blob/master/007%20Time%20Series%20Forecasting%20-%20Multivariate%20Time%20Series%20Models.ipynb
Thanks in advance...

Related

How can i predict Time Series of more than one product using LSTM?

I made a LSTM model that predict total value per day, but i need to do a forecasting of sales per product. Someone can help me with some example?
This can be helpful: https://unit8co.github.io/darts/examples/01-multi-time-series-and-covariates.html#Training-a-Model-on-Multiple-Time-Series. You can change your code accordingly.

Time Series Data: Trend and Multi-Seasonality, SARIMA and TBATS predictions not working

I have ~2.6K hours of sales data with a positive linear trend as well as daily and weekly seasonality. See plotted data. I have tried to model the data using SARIMA and TBATS in python. In both cases, I cannot get the predictions to work as I intend.
For SARIMA, the in sample predictions look great, but when I try to forecast into the future, it looks completely wrong.See here for in sample SARIMA predictionsSee here for how poor the out of sample SARIMA predictions are.
For TBATS, the predicted values match the daily and weekly pattern, but is missing the positive trend, despite me forcing so that use_trend = True. See TBATS model prediction here
I have no idea what I'm doing wrong and have been stuck on this for days! Any advice greatly appreciated.

Python - How to predict feature sales value by feeding other parameters? Using LSTM or?

I am new to this Regression world and I have a nerd question, you may say.
Actually I was trying to solve a problem to predict future sales in my organization.
I have collected all the data for last year. My data includes (for each day):
Total Sales(count)
Temperature
Wind Direction
Precipitation
Day of week (i.e 1 or 2 or 3.. or 7)
Whether a working day or not.
etc.
My goal :
1. I will train a model so that if I give the input of all the values of 2 to 7 (i.e of data, of the day that I want to predict, which is neither in test nor test data) and it will give me the predicted value of 1 (i.e Total Sales).
I Tried :
1. 1st I tried with a Univariate LSTM model(i.e with total sales from past one year data, predict the next data). But, I couldn't feed the other data as input.
Then I tried a Multivariate LSTM model, but this would predict all of the data for the next series.
Then I searched for many tutorials to solve the problem. Such as : This video tutorial which uses LSTM for electricity bill consumption, but it only shows the model building and not how to implement it.
I came with another question : from stack overflow. But here, the user seems to be moving to reinforcement learning.
Conclusion : What should i do to solve such problems? How to predict future sales count by feeding the data for that day?

Time Series Forecasting: weekly vs daily predictions

I have some daily time series data. I am trying to predict the next 3 days from the historical daily set of data.
The historical data shows a definite trend based upon the day-of-week such as Monday, Tuesday, etc Monday and Tuesdays are high, Wednesday typically highest and then decreasing over the remaining part of the week.
If i group the data monthly or weekly, i can definitely see a trend over time going up that appears to be additive.
My goal is to predict the next 3 days only. My intuition is telling me to take one approach and I am hoping for some feedback on pros/cons versus other approaches.
My intuition tells me it might be better to group the data by week or month and then predict the next week or month. Suppose I predict the next week total by loading historical weekly data into ARIMA, train, test and predict the next week. Within a week, each Day-of-week typically contributes x percent to that weekly total. So, if Wednesday historically has on average contributed 50% of the weekly volume, and for the next week I am predicted 1000, then I would predict Wednesday to be 500. Is this a common approach?
Alternatively, I could load the historical daily values into ARIMA, train, test and let ARIMA predict the next 3 days. The big difference here is the whole "predict weekly" versus "predict daily".
In the time series forecasting space, is this a common debate and if so, perhaps someone can suggest some key words i can google to educate myself on pros/cons?
Also, perhaps there is a suggested algorithm to use when day of week is a factor?
Thanks in advance for any responses.
Dan
This is a standard daily time series problem where there is a day-of-week seasonality. If you are using R, you could make the time series a ts object with frequency = 7 and then use auto.arima() from the forecast package to forecast it. Any other seasonal forecasting method is also potentially applicable.

What machine learning technique can be used for multivariate time series?

I'm trying to predict the price of tomatoes, I've collected a data set that contains the previous tomato price along with which I've also added features that might affect the change in tomato price, for example, wages in agriculture over months, inflation rate over months, rainfall over months. Does this qualify as a multivariate time series? What machine learning technique can be used to solve this problem? The constraint is that there are only 48 data points (4 years *12 months). Also, can the test and train be pulled using Cross Validation ?
Columns in my dataset:
Year
Month
Tomato price
Wage
Inflation
Rainfall
Number of festivals in the month
Thanks in advance !!

Resources