use ordinary solve() first to invert the W matrix in WLS; only ginv as a backup