LinearRegression.Pvalues 1.0.4

There is a newer version of this package available.
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
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="LinearRegression.Pvalues" Version="1.0.4" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="LinearRegression.Pvalues" Version="1.0.4" />
                    
Directory.Packages.props
<PackageReference Include="LinearRegression.Pvalues" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add LinearRegression.Pvalues --version 1.0.4
                    
#r "nuget: LinearRegression.Pvalues, 1.0.4"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package LinearRegression.Pvalues@1.0.4
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=LinearRegression.Pvalues&version=1.0.4
                    
Install as a Cake Addin
#tool nuget:?package=LinearRegression.Pvalues&version=1.0.4
                    
Install as a Cake Tool

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.

Installation

The library is a C# project that can be included in your .NET solution:

  1. Clone or download the repository.
  2. Add the project or source files (Regression.cs, PValue.cs) to your solution.
  3. Ensure the MathNet.Numerics NuGet package is installed for PValueStat (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 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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.1.2 166 8/8/2025
1.1.1 206 8/7/2025
1.1.0 207 8/7/2025
1.0.7 532 7/22/2025
1.0.6 533 7/22/2025
1.0.5 522 7/22/2025
1.0.4 197 6/8/2025
1.0.3 152 6/3/2025
1.0.1 148 6/3/2025
1.0.0 147 6/3/2025