title: Linear regression - accelerate framework in Swift
body: <p>My first question here at Stackoverflow... hope my question is specific enough.</p>
  
  <p>I have an array in Swift with measurements at certain dates. Like:</p>
  
  <pre><code>var myArray:[(day: Int, mW: Double)] = []
  myArray.append(day:0, mW: 31.98)
  myArray.append(day:1, mW: 31.89)
  myArray.append(day:2, mW: 31.77)
  myArray.append(day:4, mW: 31.58)
  myArray.append(day:6, mW: 31.46)
  </code></pre>
  
  <p>Some days are missing, I just didn't take a measurement... All measurements should be on a line, more or less. So I thought about linear regression. I found the Accelerate framework, but the documentation is missing and I can't find examples.</p>
  
  <p>For the missing measurements I would like to have a function, with as input a missing day and as output a best guess, based on the other measurements.</p>
  
  <pre><code>func bG(day: Int) -&gt; Double {
      return // return best guess for measurement
  }
  </code></pre>
  
  <p>Thanks for helping out.
  Jan</p>