[R-SIG-Finance] Eman NN using RSNNS package

Abhay Bhadani abhadani at gmail.com
Fri Jun 12 13:26:15 CEST 2015


Dear all,

I am trying to use elman function in package RSNNS to train and test a
neural network model for stock price prediction.

Based on my limited understanding from the manual and a research article on
RSNNS package, I interpret that the network can be trained using

model <- elman(patterns$inputsTrain, patterns$targetsTrain,
size = c(8, 8), learnFuncParams = c(0.1), maxit = 1000,
inputsTest = patterns$inputsTest, targetsTest = patterns$targetsTest,
linOut = FALSE)

and the values for the new dataset can be obtained using prediction <-
predict(model, newdataset).

I am trying predict the future stock price using its past value as input (I
am considering the univariate case). How do I go about the case of
out-of-sample prediction? For instance, I have 400 data points. Suppose I
train and test the model using 300 and 100 data points, respectively. Now
how do I predict the 401th data point using elman function in RSNNS
package?

Your suggestions are much appreciated!

Thanks!

	[[alternative HTML version deleted]]



More information about the R-SIG-Finance mailing list