I have this sample code for a multiple linear regression. Is this the correct way to approach getting a goodness-of-fit (R-squared) value? Or, for a multiple regression, is this R-squared unreliable, since it is perhaps meant only for simple linear regression?

```
double[][] xdata = new double[][] { new double[] { 2.2, 4.0 }, new double[] { 1.4, 6.2 }, new double[] { 3.0, 2.0 } };
double[] ydata = new double[] { 15, 20, 10 };
double[] p = Fit.MultiDim(xdata, ydata, intercept: true);
double a = p[0]; //intercept
double b = p[1];
double c = p[2];
var R2 = GoodnessOfFit.RSquared(xdata.Select(x => a + (b*x[0])+(c*x[1])), ydata);
```

Thanks