Skip to content

SP5: Improve descriptive statistics class #3055

@swharden

Description

@swharden

First, we can use Average() here:

return values.Sum() / values.Length;

Next, all those double[] arguments should be changed to IEnumerable<double> if possible

public static double Mean(double[] values)

https://github.com/ScottPlot/ScottPlot/blob/443a60668e415b5b4ca975c5fb023cbe9e5b3ff6/src/ScottPlot5/ScottPlot5/Statistics/Descriptive.cs#L15C24-L15C24
public static double StDev(double[] values, double mean)

Third, there should be a StdErr() that returns standard deviation divided by the square root of the sample count https://en.wikipedia.org/wiki/Standard_error

Metadata

Metadata

Assignees

No one assigned

    Labels

    Good First IssueThis issue has limited complexity and may be a good start for new contributorsHelp WantedScott won't do this soon, but PRs from the community are welcome!

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions