Quantcast
Channel: Active questions tagged r - Stack Overflow
Viewing all articles
Browse latest Browse all 201839

How to use NeuralNet to predict future exchange rate

$
0
0

I have the following data set which extends to 500 values and I would like to create a neural network to predict the future prices. I am using the first 400 for training data and the final 100 to test against.

https://imgur.com/a/BMOLFOU

The normalization function results in num NaN so I have used scaling instead.

I am stuck on the EX_NN <- neuralnet() function as im not sure what function to enter, usually I get an error for object not found. What I would like to do is read in the first 400 values and use this to predict and then compare against the next 100 exchange rate values.

I have tried converting the data to numeric values. Also I have tried with a timeseries.

Ex_Train <- ExchangeUSD[1:400,]
Ex_Test <- ExchangeUSD[401:500,]
normalize <- function(x) {
     return ((x - min(x)) / (max(x) - min(x)))
 }
Ex_norm2<-scale(ExchangeUSD$`USD/EUR`)
ExchangeUSD$Wdy <- recode(ExchangeUSD$Wdy, 
                          "Mon"="0",
                          "Tues"="1",
                          "Wed"="2",
                          "Thurs"="3",
                          "Fri"="4",
                          "Sat"="5",
                          "Sun"="6")

EX.timeseries <- ts(ExchangeUSD$`USD/EUR`,start = c(2011,13,10),frequency = 500)
EX_NN <- neuralnet(FORMULA HERE, data = EX_train)

Viewing all articles
Browse latest Browse all 201839

Trending Articles