I am using a RandomForest to forecast the power in a wind turbine. The results are improving, but i'm getting a slight "lag" between the forecast and the value itself. Is there any way to correct this?

I am using the values of Generated Power, Wind Speed and Direction, as well as moving averages of these values to predict a 10 minute forecast.

Here is a picture of what I'm describing10min Forecast

enter image description here

  • 1
    $\begingroup$ My guess is your model is suggesting generated power in the next hour will be close to generated power in the past hour, which is reasonable but perhaps not helpful and could explain the lag you are seeing. You might instead try to forecast the change in generated power; my guess is that it would appear to be a worse fit but might be more helpful $\endgroup$
    – Henry
    Jun 16, 2018 at 13:50
  • $\begingroup$ @Henry, thanks for the answer. When you say the change in power, do you mean the difference between the current and future power, or the derivate? or both? $\endgroup$ Jun 16, 2018 at 18:50

2 Answers 2


Your model seems to be generating a noisy naive forecast i.e.:

$\hat{Y}_{t+1} = Y_t + Noise(t)$,

I don't think RF is a good approach for this.

You might want to try a random walk model which would be a more "intelligent" way of doing a naive forecast.

Or better still you might want to use Bayesian Structural Time Series since you data seems to be composed of local trends combined with sudden shifts in direction (i.e. structural breaks).

  • $\begingroup$ Thank you, I'll try those approaches. I am working with R and only just begining in machine learning (this is my first project). Is there an R package that implements those models? Thank you in advance. $\endgroup$ Jun 16, 2018 at 18:40
  • $\begingroup$ @AndreMenor yes. rwf() is part of the forecast package for random walk models and there's a BSTS package released by Google. $\endgroup$
    – Skander H.
    Jun 18, 2018 at 2:56

Just to update on my own question from weeks ago:

I did manage to make a decent forecast with the randomForest, without the "lag". It was a matter of feeding it more moving averages and variable lags. I'll post a work about it here, eventually.

10minute Forecast


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.