MATLAB and Statistics Toolbox provide a variety of ways to perform a regression. For example, if I am performing a simple linear regression I could use
- The backslash command
Each of these functions requires a different amount of time to run. The primary difference in execution speed is the amount of information that each function provides.
For example, backslash runs wicked fast, but the only output is a set of regression coefficients.
At the other end of the spectrum, regstats provides all sorts of useful information as standard output. Consequently, it requires a lot more time to run.
I'd recommend determining what is the minimum set of information you need from the regressions and then determine which algorithm you should use.
If you just need regression coefficients and R^2 your best option is to use backslash and hand code a routine to calculate R^2.
Regress is the next fastest with regstats and LinearModel bringing up the rear.