LinearRegression.Pvalues
1.0.4
See the version list below for details.
dotnet add package LinearRegression.Pvalues --version 1.0.4
NuGet\Install-Package LinearRegression.Pvalues -Version 1.0.4
<PackageReference Include="LinearRegression.Pvalues" Version="1.0.4" />
<PackageVersion Include="LinearRegression.Pvalues" Version="1.0.4" />
<PackageReference Include="LinearRegression.Pvalues" />
paket add LinearRegression.Pvalues --version 1.0.4
#r "nuget: LinearRegression.Pvalues, 1.0.4"
#:package LinearRegression.Pvalues@1.0.4
#addin nuget:?package=LinearRegression.Pvalues&version=1.0.4
#tool nuget:?package=LinearRegression.Pvalues&version=1.0.4
Linear Regression Library
A robust and lightweight C# library for performing 2D (bivariate) linear regression analysis. This project calculates statistical properties such as slope, y-intercept, correlation coefficient, and p-value for paired x, y data. It is designed for technical users, including data scientists, statisticians, and developers working on statistical modeling.
Overview
The library provides a Regression
class for computing 2D regression statistics and a PValueStat
class for calculating the p-value of the regression slope. It supports adding, removing, and merging data points, with robust handling of edge cases like insufficient data or NaN values.
Lineage
- Originated from 1978 TI-58 and TI-59 calculator algorithms.
- Ported to C in 1982, then to Perl 3 in 1987.
- Modernized in C# with updates in 2001, 2002, 2003, 2008, 2012, 2016, 2018, 2019, 2022, 2025
- Copyright © Jillian England, 2001–2022.
Features
- Data Management:
- Add individual (x, y) data points or merge multiple regression datasets.
- Remove data points (decrement) with support for both explicit y-values and implicit y (based on sample count).
- Track minimum and maximum x and y values.
- Statistical Calculations:
- Sum of x, y, x², y², and x*y.
- Mean of x and y.
- Standard deviation and variance for x and y (with N or N-1 weighting for population or sample studies).
- Slope, y-intercept, and correlation coefficient.
- P-value for the regression slope (via
PValueStat
class).
- Robustness:
- Handles edge cases (e.g., insufficient samples, division by zero, NaN, or infinite values).
- Returns
double.NaN
for invalid computations instead of throwing exceptions in most cases.
- Serialization:
- The
Regression
class is marked[Serializable]
for persistence.
- The
Installation
The library is a C# project that can be included in your .NET solution:
- Clone or download the repository.
- Add the project or source files (
Regression.cs
,PValue.cs
) to your solution. - Ensure the
MathNet.Numerics
NuGet package is installed forPValueStat
(for t-distribution calculations).
dotnet add package MathNet.Numerics
License
This project is licensed under the Affero General Public License (AGPL-3.0). See the LICENSE
file for full details.
Contact
Jillian England
- Email: jill.england@comcast.net
- X: @Firefox_XB9R
- FB: Jillian England Seattle
- Any omissions or errors in this software specification are unintentional and should be reported for correction.
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net8.0 is compatible. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. net9.0 was computed. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 was computed. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
-
net8.0
- MathNet.Numerics (>= 5.0.0)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.