Regression Analysis

Regression Analysis

Whether you’re using C#, Visual Basic (VB.NET) or F#, Numerics.NET makes it easy to include regression functionality in your .NET applications. Numerics.NET is a complete math, linear algebra and statistics package for the Microsoft .NET framework. The statistics functionality extends to probability distributions, random number generation, hypothesis testing, time series analysis, and multivariate models.

Many types of regression are supported, including:

  • Simple linear, multi-linear and polynomial regression.
  • Logistic regression.
  • Nonlinear regression.
  • Poisson regression.
  • Logit and probit regression.
  • Generalized linear models.

In addition, you can take advantage of the following:

  • Use R-style formulas to define your models.
  • Automatically create indicator or dummy variables for categorical data.
  • Remove outliers and impose other filter conditions.
  • Assign weights to observations.
  • Compute significance tests and confidence intervals for parameters.
  • Run validation tests.

Regression classes

The classes that implement the regression functionality live in the Numerics.NET.Statistics namespace. The main classes are:

Regression Models

  • SimpleRegressionModel Represents a model where the dependent variable is a linear function of the independent variable.
  • LinearRegressionModel Represents a model where the dependent variable is a linear combination of multiple independent variables. Includes polynomial regression as a special case.

  • LogisticRegressionModel Represents a model that predicts the probability of two or more outcomes occurring.
  • NonlinearRegressionModel Represents a model where the relationship between the dependent variable and the independent variables is nonlinear.
  • GeneralizedLinearModel Represents a generalization of a regression model where the dependent variable is related to the independent variables through a link function, and the variance of each observation is dependent on the predicted value. Logistic, Poisson and probit regression are specific examples.

The Regression Analysis section of the Mathematics Library User’s Guide explains their use in detail.

Regression Sample Application

With only a few lines of code, you can include advanced regression functions in your applications. This sample shows you how.

For more information, click on the image to the right. This sample is also part of our trial version.

Regression QuickStart Samples

Our library comes with a large number of QuickStart samples that help you to get started in minutes. The following samples illustrate how to use the curve fitting functionality:

Project Description
Simple Regression in C#
Simple Regression in VB.NET
Illustrates the use of the SimpleRegressionModel class to perform simple linear regression.
Multiple Regression in C#
Multiple Regression in VB.NET
Illustrates the use of the LinearRegressionModel class to perform multiple linear regression.
Polynomial Regression in C#
Polynomial Regression in VB.NET
Illustrates how to use the PolynomialRegressionModel class (Extreme.Statistics namespace) to perform a polynomial regression.
Logistic Regression in C#
Logistic Regression in VB.NET
Illustrates how to use the LogisticRegressionModel class (Extreme.Statistics namespace) to perform logistic regression.
Generalized Linear Models C#
Generalized Linear Models VB.NET
Illustrates how to use the GeneralizedLinearModel class to create generalized linear models used in Poisson regression and probit regression.

Trial version

If you would like to evaluate Numerics.NET, you can download a free, fully functional 30-day trial version. In addition to the code samples discussed here, it includes about 70 other samples as well as complete documentation for the entire library.