Am 06.04.2026 um 11:25 schrieb Ramki S:
I agree that se's are large but can we have an option to agree
with results of other softwares? stata, r, spss are all producing similar results.
Thanks for another interesting test case. Here's my summary of the
situation in (lib)gretl as I understand it. The default numerical
approach for ols estimation is the Cholesky decomposition. If the
variables turn out to be too collinear, I believe gretl automatically
falls back to the QR decomposition which is numerically more robust in
that respect. Whether or not exact collinearity is "announced" to the
user and the corresponding variable is dropped automatically depends on
the threshold for the rank-determination code, and that threshold
appears to be defined in lib/src/gretl_matrix.h, let me quote lines
30-33 here:
/* minimum value of diagonal element of R (as in X = QR) that counts
as non-zero for the purpose of determining the rank of X */
#define R_DIAG_MIN 1.0e-8
So it seems to me that this is currently hard-coded as 1e-8. This is a
very reasonable number I think, but apparently the other programs you
tried are more tolerant here. So for comparison with other software one
may wish to adjust it.
I'm not aware that this is currently possible short of editing this
piece of C source and re-compiling gretl yourself, which is not for the
average user.
Two possible exceptions:
- For the matrix-oriented mols() function you can force the SVD instead
of QR decomp with the script command "set svd on". Not sure whether this
also affects the regular ols estimation command.
- gretl also has the multiple-precision mpols() function (also
matrix-oriented) which may have different thresholds.
Thanks again for pointing to the relevant data, so more testing is
possible. (Can't do that right now, though.)
cheers
sven