Sorry about the vagueness of my original question. Here is a revised and more detailed format of the same question.
The example I have below references this page: https://numerics.mathdotnet.com/regression.html
The page shows me how to get the slope and intercept of a simple regression that has two one-dimensional array inputs, namely xdata and ydata:
double[] xdata = new double[] { 10, 20, 30 };
double[] ydata = new double[] { 15, 20, 25 };
Tuple<double, double> p = Fit.Line(xdata, ydata);
double a = p.Item1; // == 10; intercept
double b = p.Item2; // == 0.5; slope
Based on the xdata and ydata inputs, I think I can get the coefficient by doing this:
var coefficient = GoodnessOfFit.R(xdata, ydata);
Now what I'm trying to figure out is, how do I get the intercept, slope and coefficient values if the xdata input is a two-dimensional array. Here are the xdata and ydata input values:
double[][] xdata = new[] { new[] { 1.0, 4.0 }, new[] { 2.0, 5.0 }, new[] { 3.0, 2.0 } };
double[] ydata = new[] { 15.0, 20, 10 };
There is a section on the math.net page above that talks about multiple regression but I'm not sure how I can extract the slope, intercept and coefficient values from it:
double[] p = Fit.MultiDim(xdata, ydata, intercept: true);
Please advise. Thanks!