Mathematica Stack Exchange is a question and answer site for users of Mathematica. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top


<< NeuralNetworks`
data = {Sin[#]} & /@ Range[0, 4 Pi, 0.5];
learn = data[[1 ;; 15]];

Now, lets fit our neural network:

{model1, fitrecord} = NeuralARFit[learn, 3, FeedForwardNet, {}, 0, CriterionPlot -> False]
p = NetPredict[learn, model1, PredictHorizon -> 1]
ListLinePlot[Flatten[learn~Join~p]] (* Plot it! *)

In the result the Length@p == Length@learn == 15. Is it true, that we predict 15 values? How can you predict only 1 or 2 or 3 values (e.g. p[[1]], p[[1;;2]], p[[1;;3]]) or an arbitrary n values?

Is it right the idea to use NeuralARXFit[d1,d2,...] and Dimensions@First@d2 = {N,3} if we want to predict only 3 values ?

share|improve this question

migrated from Jun 6 '12 at 2:53

This question came from our site for professional and enthusiast programmers.

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.