2

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?

Bastiaan Quast
  • 2,802
  • 1
  • 24
  • 50
learning-man
  • 119
  • 2
  • 11
  • Thanks for the reply. I agree with you that data was properly prepared. However the network does not achieve the target to predict time series in advance. I prepared the following example to show it: [link](https://github.com/mg64ve/ML/blob/master/appfx2.R). In this example I do not use the web interface. Even if I put a gap of 3, the time series is just imitated because it just follow the already known timeseries: [link](https://github.com/mg64ve/ML/blob/master/rnn2.jpeg). Could you please tell me why? – learning-man Nov 26 '16 at 17:14

1 Answers1

2
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.