The problem is the same as the following:-
In R, this works.
vcov.matrix <- var.est * (v %*% d^(-2) %*% t(v))
But as mentioned "assumption is that X is full-rank and n≥p throughout. If this is not the case, you'll have to make minor modifications to the above"
In my case, n<p (no of variables more than data points) so I want to know what should be modifications to the formula?