javascript - predict/estimate next number from a dataset
<p>Math isn't really my thing, but what I'm trying to figure out is how to predict/estimate the next number from a dataset.</p>

<p>Let's say I have an array:</p>

<pre><code>var values = new Array(1,4,3,5,6,10,4,15);
</code></pre>

<p>Does anyone know a formula in javascript that could guess the next number after 15 based off the previous values in the array.</p>

<p>Basically I have an array of total numbers from daily sales, each item in the array is the total for a single day. So I'd like something that could guess what tomorrow's sale might be.</p>
