ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   what is the max number of factors in Linest function (https://www.excelbanter.com/excel-worksheet-functions/50282-what-max-number-factors-linest-function.html)

apca

what is the max number of factors in Linest function
 
what is the max number of factors in Linest function. If I had to use a
larger number what alternative do I have?



Jerry W. Lewis

LINEST appears to have a hardcoded limit of 17 predictors if no
intercept is fitted or 16 predictors and an intercept. As a practical
matter, I would be highly suspicious of the numerical properties of far
smaller models in Excel versions prior to 2003.

Unless you know that your predictor columns are orthogonal, or nearly
so, I would strongly advise against going beyond that limit in Excel.
The normal equations for least squares are
=MMULT(MINVERSE(MMULT(TRANSPOSE(xMat),xMat))),MMUL T(TRANSPOSE(xMat),yVec))
Which will work for up to 52 predictors, but will easily produce
nonsense without warning if the X matrix is not orthogonal.

This method of calculation breaks down for non-orthogonal X matrices in
the sense that the the useful information often ends up well beyond the
accuracy of IEEE double precision. A numerically better approach is to
do a singular value decomposition (SVD) of the X matrix, so that much of
the numerical junk in (X'X)^-1 X'y can be canceled analytically instead
of needing far more precision than is available. However, you would
either have to write your own SVD routine or switch to something other
than Excel.

R is an open-source dialect of the S language which may be downloaded
freely from
http://www.r-project.org/
R has no hard-coded limit on the size of general linear models, uses a
numerically stable method, and warns if there might be accuracy problems.

There is an interface that allows R routines to be called from Excel
http://cran.r-project.org/contrib/ex...m/RSrv135.html

Jerry

apca wrote:

what is the max number of factors in Linest function. If I had to use a
larger number what alternative do I have?




All times are GMT +1. The time now is 10:15 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com