On Mon, 11 Jan 2021, Riccardo (Jack) Lucchetti wrote:
On Mon, 11 Jan 2021, Alecos Papadopoulos wrote:
> gretl 2020e Windows 64
>
> I created a "residual maker" matrix M = I - X*inv(X'X)*X', which is
> symmetric, non-invertible and idempotent. Below I have copied its
> properties as printed out by gretl. It clearly states that the matrix is
> "Not idempotent".
>
> But It is, in theory and it is in practice: I performed the operation M*M -
> M, and I got a matrix with zeros or numbers raised to the 10^{-16} or even
> smaller.
>
> *What does it take for gretl to characterize a matrix as idempotent?*
You're right, we were not taking finite precision into account. Here's a
minimal script for creating a falsely not idempotent matrix:
<hansl>
set seed 123
n = 10
k = 3
X = mnormal(n, k)
M = I(n) - qform(X, invpd(X'X))
</hansl>
I just committed to git a fix which seems to work.
@Allin: my fix changes the signature of a libgretl function; I'm fairly
confident I ran all the checks so it doesn't break anything, but please
review.
Your fix looks good to me!
Allin