title: Simple linear regression for data set
body: <p>I am looking to create a trend function in C# for a set of data and it seems like using a big math library is a bit overkill for my needs.</p>
  
  <p>Given a list of values such as 6,13,7,9,12,4,2,2,1. I would like to get the slope of the simple linear regression (to see if it is decreasing or increasing) and the next estimated value. I know that there are massive libraries out there that can do that and more, but I wanted a more simple approach.</p>
  
  <p>I'm not big into statistics, so if someone could lead me in a way to do this, it would be appreciated. </p>