hatinv_byname function

Hatize and invert a vector