title: Using average, standard dev, or regression to populate Javascript array?
body: <p>I have an array with 365 elements. Each index can be thought of as one day in the past year. The value stored at each index represents the number of times that an item was purchased on that day. array[0] is the number of times an item was purchased 365 days ago, and array[364] is the number of times an item has been purchased so far today. </p>
  
  <p>Alright, so what I want to do is populate the array with random values. However, I want to simulate real-world data. If I just use random number, an item might be purchased 80 times one day, and 2 times the next, which is unrealistic. More realistic would be 80 purchases one day, then 75 the next, then 82, then 76, etc. I am wondering if there is a way I can use arithmetic mean, standard deviation, regression, correlation, or similar tools to quickly generate arrays with realistic data simulations using Javascript. </p>