title: R neuralnet does not converge within stepmax for time series
body: <p>I'm writing a neural network for prediction of elements in a time series <code>x + sin(x^2)</code> in R, using the <code>neuralnet</code> package. This is how training data is being generated, assuming a window of 4 elements, and that the last one is the one that has to be predicted:</p>
  
  <pre><code>nntr0 &lt;- ((1:25) + sin((1:25)^2))
  nntr1 &lt;- ((2:26) + sin((2:26)^2))
  nntr2 &lt;- ((3:27) + sin((3:27)^2))
  nntr3 &lt;- ((4:28) + sin((4:28)^2))
  nntr4 &lt;- ((5:29) + sin((5:29)^2))
  </code></pre>
  
  <p>Then, I turn these into a data.frame:</p>
  
  <pre><code>nntr &lt;- data.frame(nntr0, nntr1, nntr2, nntr3, nntr4)
  </code></pre>
  
  <p>Then, I proceed to train the NN:</p>
  
  <pre><code>net.sinp &lt;- neuralnet(nntr4 ~ nntr0 + nntr1 + nntr2 + nntr3, data=nntr, hidden=10, threshold=0.04, act.fct="tanh", linear.output=TRUE, stepmax=100000)
  </code></pre>
  
  <p>Which, after a while, gives me the message </p>
  
  <pre><code>Warning message:
  algorithm did not converge in 1 of 1 repetition(s) within the stepmax 
  Call: neuralnet(formula = nntr4 ~ nntr0 + nntr1 + nntr2 + nntr3, data = nntr,     hidden = 10, threshold = 0.04, stepmax = 100000, act.fct = "tanh", linear.output = TRUE)
  </code></pre>
  
  <p>Can anyone help me figure out why it is not converging? Many thanks</p>