title: How to simulate an AR(1) process with arima.sim and an estimated model?
body: <p>I want to do the following two steps:</p>
  
  <ol>
  <li>Based on a given time series, I want to calibrate an AR(1) process, i.e. I want to estimate the parameters.</li>
  <li>Based on the estimated parameters, I want to simulate an AR(1) processes.</li>
  </ol>
  
  <p>Here was my approach:</p>
  
  <pre><code>set.seed(123)
  #Just generate random AR(1) time series; based on this, I want to estimate the parameters
  ts_AR &lt;- arima.sim(n=10000, list(ar=c(0.5)))
  #1. Estimate parameters with arima()
  model_AR &lt;- arima(ts_AR, order=c(1,0,0))
  #Looks actually good
  model_AR
  Series: ts_AR 
  ARIMA(1,0,0) with non-zero mean 
  
  Coefficients:
    ar1  intercept
  0.4891    -0.0044
  s.e.  0.0087     0.0195
  
  sigma^2 estimated as 0.9974:  log likelihood=-14176.35
  AIC=28358.69   AICc=28358.69   BIC=28380.32  
  
  #2. Simulate based on model
  arima.sim(model=model_AR, n = 100)
  Error in arima.sim(model = model_AR, n = 100) : 
    'ar' part of model is not stationary
  </code></pre>
  
  <p>I'm not the biggest time-series expert, but I'm pretty sure that an AR(1) process with a persistence parameter of below one should result in a stationary model. However, the error message tells me somethings
  different. So do I do something stupid here? If so, why and what should I do to simulate the AR(1) process based on my estimated parameters. Or can't you just pass the output of <code>arima</code> as the model input into <code>arima.sim</code>? Then, however, I don't understand how I get such an error message...I would expect something like <em>"model input cannot be read. It should be something like ..."</em></p>