Reputation: 169
I have been experimenting with a R package called RNN. The following is the code site: https://github.com/bquast/rnn It has a very nice example for financial time series prediction. I have read the code and I understand it uses the sequence of the time series to predict in advance the value of next day instrument. The following is an example of run with 10 hidden nodes and 200 epochs
RNN financial time series prediction
What I would expect as result is that the algorithm succeed, at least in part, to predict in advance the value of the instrument. From what I can see, apparently is only approximating the value of the time series at the current day, not giving any prediction on the next day. Is my expectation wrong? This code is very simple, how would you improve it?
Upvotes: 2
Views: 3708
Reputation: 41
y <- X[,1:input$training_amount+input$prediction_gap,as.numeric(input$target)]
matrix(y, ncol=input$training_amount)
y.train moves all the data forward by a day so that is what is being trained on - next day data for the currency pair you care about. With ncol = training_amount when there are too many columns (with them now equal to training_amount + prediction_gap), the first data points fall off; hence all the data gets moved forward by the prediction_gap.
Upvotes: 2