title: Moving Average code in R ~ "ma" function
body: <p>I have some time series data points and I like to perform a simple Moving Average method on them. If I use the function "ma" from package "forecast", I get the following:</p>
  
  <pre><code>library(forecast)
  x&lt;-c(1,5,2,8,6,3,2,4,7)
  ma(x,order= 4)
  [1] NA    NA   4.625   5.000   4.750   4.250   3.875    NA    NA
  </code></pre>
  
  <p>Now can anybody please tell me what is the logic here? Because obviously this does not follow the usual rule of 4 point simple MA process here.</p>