title: Extracting p,d,q values from a fitted ARIMA model in R?
body: <p>I am running a time series forecast using <code>forecast::auto.arima</code>, and I was trying to see if there is a way to extract the values assigned to <code>p</code>, <code>d</code>, <code>q</code> (and seasonally as well if applicable) from the fitted time series object. Example:</p>
  
  <pre><code>fit &lt;- auto.arima(mydata)
  </code></pre>
  
  <p>Say <code>auto.arima()</code> picked an <code>ARIMA(1,1,0)(0,1,1)[12]</code> model. Is there a way to extract the values of <code>p</code>,<code>d</code>, <code>q</code> (and <code>P</code>, <code>D</code>, <code>Q</code>) from fit?  In the end I would like to have six variables automatically assigned as follows:</p>
  
  <pre><code>p=1, d=1, q=0, P=0, D=1, Q=1
  </code></pre>