title: How to compute a moving average using jq?
body: <p>Assume a Json array of numbers:</p>
  
  <pre><code>[ 1, 4, 6, 9, 8, 10, 5, 2]
  </code></pre>
  
  <p>I want to compute a 3 day moving average.  The resulting array is computed by averaging the previous 3 entries.</p>
  
  <p>So the first 3 entries don't care, the 4th is <code>(1+4+6)/3</code>, the 5th is <code>(4+6+9)/3</code> and so on.</p>
  
  <p>Conceptually, this is what I'm trying to do:</p>
  
  <pre><code>echo '[ 1, 4, 6, ... ]' | jq 'map(average(select(prev 3 array entries)))'
  </code></pre>