ILNumerics - Technical Computing Tools

High Performance Framework for Visualization

and Computing in Industry and Science



Linear Regression in .NET (C# and Visual Basic)

A simple linear regression model aims to model a set of measurement data with a line. The slope and the offset of the line are directly computed from the measurement data. Here comes one variant, which utilizes ILMath.pinv in order to compute the slope and ILMath.mean to compute the offset.



Often, the solution of least squares problems is found by defining the problems in terms of a design matrix. This includes the measurement data and (optionally) powers of it (for polynomial regression).