title: Modelfunction in STLM
body: <p>Hi I want to compute an <code>STLM</code> model from the <code>forecast</code> package using the <code>elm</code> function from the <code>nnfor</code> package on the seasonally adjusted time serie.</p>
  <p>I can do so by using then <code>modelfunction</code> argument.</p>
  <p>Let use this time serie:</p>
  <pre><code>y&lt;- ts(rnorm(300,mean=0,sd=1), start=c(2012,2), frequency=12)
  
  &gt; head(y,10)
               Feb         Mar         Apr         May         Jun
  2012  1.83672399  0.09163453  1.43897758 -0.06213232  0.21279124
               Jul         Aug         Sep         Oct         Nov
  2012  1.43642897  1.36854342 -0.38119914 -0.94666416  1.41982674
  </code></pre>
  <p>It works perfectly with functions from the <code>forecast</code> package (ex: <code>nnetar</code>)</p>
  <pre><code>model1 =stlm(y,modelfunction=forecast::nnetar)
  
  model$model
  Series: x.sa 
  Model:  NNAR(24,1,12)[12] 
  Call:   modelfunction(y = x.sa)
  
  Average of 20 networks, each of which is
  a 24-12-1 network with 313 weights
  options were - linear output units 
  
  sigma^2 estimated as 0.0004526
  </code></pre>
  <p>But not from forecasting models from other packages.</p>
  <pre><code>model2 =stlm(y,modelfunction=nnfor::elm)
  
  &gt; Error in `+.default`(fitted(fit), allseas) : 
    time-series/vector length mismatch
  </code></pre>
  <p>Which format we should use for the modelfunction argument ?</p>
  <p>Any ideas to help me ?
  Many thanks.</p>