I'm not sure what percusse is talking about, but yes, that's how these invariants of quadratic forms are defined. In more detail, changing variables in the quadratic form corresponds to changing the matrix $A$ by congruence: $A\mapsto P^TAP$. Any quadratic form over $\mathbb R$ can be diagonalized by an orthogonal matrix to $q(x_1,\ldots,x_n)=x_1^2+\cdots+x_k^2-x_{k+1}^2-\cdots -x_n^2$. The signature of such a quadratic form is defined to be $(k,n-k)$, which is also the signature of the diagonal matrix with k $+1$'s and $n-k$ $-1$'s on the diagonal. It is a well-defined invariant by Sylvester's Law of Inertia. See <