Calculate the pseudoinverse of array A over the last 2 axes
(broadcasting the first axes)
A* = ((A’.A)^(-1)).A’
where X’ is the transpose of X and X^-1 is the inverse of X
Calculate the weighted pseudoinverse of array A over the last 2 axes
(broadcasting the first axes)
W is the weight matrix (diagonal)
A* = ((A’.W.A)^(-1)).A’.W