Lagged variables

Finally, the last set of features we are going to use is lagged variables. Lagged variables contain information about previous periods. For example, if we use the daily return value of a previous day as a feature for our model, then it is a lagged variable that lagged one period. We can also use the daily return of two days prior to the current date as a feature for our model. These types of variable are called lagged variables and are often used in time series modeling. We are going to use daily returns and previously built features as lagged variables. In this project, we look back as far as five periods, but you can experiment with longer or shorter look-back periods. The code to create lagged variables for daily returns ...

Get C# Machine Learning Projects now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.