Get ARIMA white noise with known parameter in R
<p>I have a <code>MA(1)</code> model with known parameter <img src="https://latex.codecogs.com/gif.latex?%5Ctheta" alt="formula"> and known <img src="https://latex.codecogs.com/gif.latex?e_n" alt="formula">.</p>

<p><img src="https://latex.codecogs.com/gif.latex?e_n&space;=&space;%5Ctheta&space;%5Ccdot&space;%5Cepsilon_%7Bn-1%7D&space;&plus;&space;%5Cepsilon_n" alt="formula"></p>

<p>I'd like to know, is there a function in <code>R</code> that can return <img src="https://latex.codecogs.com/gif.latex?%5Cepsilon_n" alt="formula"> for me?</p>

<p>I also tried to get  <img src="https://latex.codecogs.com/gif.latex?%5Cepsilon_n" alt="formula"> by iteration:</p>

<p><img src="https://latex.codecogs.com/gif.latex?%5Ccentering&space;%5Cepsilon_1=e_1&amp;-%5Ctheta&space;%5Ccdot&space;%5Cepsilon_0&space;%5C%5C&space;%5Cepsilon_2=e_2&space;&amp;-&space;%5Ctheta&space;%5Ccdot&space;%5Cepsilon_1&space;%5C%5C&space;%5Ccentering&space;...&space;%5C%5C&space;%5Cepsilon_n=e_n&space;&amp;-&space;%5Ctheta&space;%5Ccdot&space;%5Cepsilon_%7Bn-1%7D" alt="formula"></p>

<p>However, in reality, <img src="https://latex.codecogs.com/gif.latex?%5Cepsilon_0" alt="formula">  is unknown and <img src="https://latex.codecogs.com/gif.latex?%5Cepsilon_1" alt="formula"> cannot be specified at the first place.</p>

<p>I'm having this question because I used <code>gnls</code> to estimate a nonlinear model with residuals being <code>MA(1)</code> process. The code is something like:</p>

<pre><code>model = gnls(y ~ c + log( x1^g + x2^g), start = list(c = 0.04, g = 0.3),
      correlation = corARMA(c(0.5), form = ~ 1, p = 0, q = 1, fixed = FALSE))
</code></pre>

<p>It returns every parameter estimation including <img src="https://latex.codecogs.com/gif.latex?%5Ctheta" alt="formula">. But <code>residuals(model)</code> returns <img src="https://latex.codecogs.com/gif.latex?e_n" alt="formula"> instead of <img src="https://latex.codecogs.com/gif.latex?%5Cepsilon_n" alt="formula">. </p>

<p>So any suggestions?</p>

<p>Thank you for the help in advance.</p>