Am 23.12.2020 um 02:09 schrieb Riccardo (Jack) Lucchetti:
On Tue, 22 Dec 2020, Sven Schreiber wrote:
> So I'm wondering whether hansl/gretl might benefit from a specialized
> ginv function for symmetric input. Below is a proposal in hansl based on
> standard algebra. Perhaps we even discussed something similar before?
Your function looks fine to me. Out of curiosity: what was the original
problem?
FWIW, I later found out that for example in Python's Scipy there is a
very similar linalg.pinvh for that (h for hermitian).
The original code uses the product of some conditional scores that then
leads to the rank-deficient matrix. Not sure yet whether there is a
deeper problem, but in principle it seems OK.
BTW, as this stems from Gauss, does anybody remember whether Gauss
dropped back automatically to some g-inverse in its 'inv' function if
necessary?
thanks
sven