-
Notifications
You must be signed in to change notification settings - Fork 981
Closed
Labels
Good First IssueThis issue has limited complexity and may be a good start for new contributorsThis issue has limited complexity and may be a good start for new contributors
Description
... to make it easier to get a regression line from List<Coordinates> instead of requiring Coordinates[]
ScottPlot/src/ScottPlot5/ScottPlot5/Statistics/LinearRegression.cs
Lines 14 to 24 in fb3b1c8
| public LinearRegression(Coordinates[] coordinates) | |
| { | |
| if (coordinates.Length < 2) | |
| { | |
| throw new ArgumentException($"{nameof(coordinates)} must have at least 2 points"); | |
| } | |
| double[] xs = coordinates.Select(x => x.X).ToArray(); | |
| double[] ys = coordinates.Select(x => x.Y).ToArray(); | |
| (Slope, Offset, Rsquared) = GetCoefficients(xs, ys); | |
| } |
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
Good First IssueThis issue has limited complexity and may be a good start for new contributorsThis issue has limited complexity and may be a good start for new contributors