image thumbnail

Fast & Detailed Multivariate OLS Regression

version 1.0.0.0 (166 KB) by Léon
Performs a fast multivariate OLS regression and gives detailed information at your fingertips

1.6K Downloads

Updated 30 Dec 2011

View License

This function performs a standard multivariate OLS regression with the given regressors in x. The regressors are supposed to be column vectors and the observations in rows.
The regressand should be given by y, as column vector respectively. There is no need to add a constant manually in x. It is added automatically.

The regression coefficients, estimates and residuals of the model are given in separate matrices. Additional information can be found in stats.

The main advantage over the standard regression codes provided by Matlab is that it is faster and offers more information at a comprehense place so you have all information needed at your fingertips.

Furthermore this function does not (!) require any additional toolboxes like the statistics toolbox to be installed.

This function offers as well heteroscedasticity consistent standard errors (White 1980) and will soon be further expanded in that matter.

Additionally the ability to perform a rolling window regression on the given data is provided. Use the provided wreg() function for this. The function will give the exact same information and results as the standard reg() function but stores the model information of each regression. Hence the detection of structural breaks will be simplified, e.g. testing for Beta stability of the CAPM. You can specify the window size and the step size as well. See help wreg() for detailed information. In fact all statistics of the reg() function are provided, as well as heteroscedasticity consistent standard errors.

If you have any questions or suggestions for improvements, feel free to contact me.

Cite As

Léon (2021). Fast & Detailed Multivariate OLS Regression (https://www.mathworks.com/matlabcentral/fileexchange/34394-fast-detailed-multivariate-ols-regression), MATLAB Central File Exchange. Retrieved .

MATLAB Release Compatibility
Created with R2009b
Compatible with any release
Platform Compatibility
Windows macOS Linux

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!