Logo

Back to Blog

Underdetermined Systems and Ordinary Least Squares

Written by: Charles Flock
4/17/2025 12:59 PM

Multiple Linear Regression (aka Ordinary Least Squares) usually calculates the best fit for a series of independent x-value and dependent y-values. Most of these linear systems have more rows than columns which will generate a unique solution. Those systems are called overdetermined systems. In this article, we look at underdetermined systems (where the number of rows is less than the number columns) and compare how they are handled in XLeratorDB, Excel, Google Sheets, and R. You will be surprised at what we discovered.

A few weeks ago a client contacted us about the XLeratorDB LINEST function and whether or not it could a handle a linear system where the number of rows was less than the number of columns. I told him that in such a case the LINEST function would generate an error message because it requires that the number of rows to at least be equal to the number of regressors.

He then told me that he could do it in Excel, so I asked him to send me his workbook, which he did. After reviewing his workbook I discovered that his particular example wasn’t actually doing what he thought it was doing and that he actually did have a linear system that satisfied the requirements with regards to the number of rows and the number of regressors. Further, XLeratorDB and Excel produced identical results.

A few days later he came back to me and told me that he was able to get Excel to produce values in LINEST where the number of rows was less than the number of regressors. I really had a hard time believing this and because of the difference in time zones and language I started investigating on my own.

I use Google Sheets a lot more than I use Excel these days. I created a Sheet with 4 regressors plus the intercept but with only three rows of data:

See results in your own environment

Try it risk-free for 15 days

No sales calls. No credit card required. Install the full version of XLeratorDB and test it with your actual data and workloads. Within minutes, you'll be running advanced calculations that would typically require expensive third-party tools or complex custom development.

Performance benchmarks

Process millions of rows and compare speeds to your current methods

Accuracy validation

Verify calculations against your existing systems and trusted sources

Integration testing

Confirm compatibility with your SQL Server environment and workflows

Team evaluation

Let your analysts and developers explore the function library