You can do this by creating a 'lag' column for each of the columns in your dataset and then use the 'pred_rate' equation to calculate the predicted rate. Here is how to do this: 1. Create the lag columns for each of the columns in the dataset. The lag column should contain the values from the previous period_dt. 2. Use the pred_rate equation to calculate the predicted rate for each period_dt. 3. Use the predicted rate for the next period_dt in the pred_rate equation instead of the actual rate. 4. Repeat steps 2 and 3 for all period_dt in the dataset. For example, for period_dt 1-Mar-19, the equation would be: pred_rate= rate_lag1 -0.68944167689726*rate_diff_lag1-0.4791311284*rate_diff_lag2; where, rate= volume/fee; rate_lag1 = lag(rate); rate_lag2=lag2(rate); rate_diff = rate - rate_lag1; rate_diff_lag1 = lag(rate_diff); rate_diff_lag2=lag2(rate_diff); For the next period 1-June-19, the equation will be: pred_rate= pred_rate_lag1 -0.68944167689726*pred_rate_diff_lag1-0.4791311284*pred_rate_diff_lag2; where, pred_rate = predicted rate, pred_rate_lag1 = lag(pred_rate); pred_rate_lag2 = lag2(pred_rate); pred_rate_diff = pred_rate - pred_rate_lag1; pred_rate_diff_lag1 = lag(pred_rate_diff); pred_rate_diff_lag2 = lag2(pred_rate_diff); You can then repeat this process for all the period_dt in the dataset. If i get it right.
... View more