RoheLab/vsp

rotate U and V together to make B diagonal.

karlrohe opened this issue · 2 comments

sometimes the B matrix is not strongly diagonal... even when it can be if we were to properly permute the columns of U and V.

Screen Shot 2020-06-07 at 6 53 11 AM

I think I have a way to fix this.

Before computing varimax(U) and varimax(V), first "pre-rotate" with

R_{u,v} = varimax(rbind(U,V))

to get U0 = U R_{u,v} and V0 = V R_{u,v}. Then, varimax(U0) and varimax(V0) as usual.

I think this does it... to line 106 in R/vsp.R, remove old R_U and R_V functions. Replace with this:

R_both <- varimax(rbind(U[rsA > 1, ],V[csA > 1, ]), normalize = FALSE)$rotmat
R_U <- R_both%*%varimax(U[rsA > 1, ]%*%R_both, normalize = FALSE)$rotmat
R_V <- R_both%*%varimax(V[csA > 1, ]%*%R_both, normalize = FALSE)$rotmat

In the example above, it makes B look pretty again (strong diagonal). I have not checked to see that changing this makes .... \hat Z \hat B \hat Y' wrong.

Screen Shot 2020-06-08 at 6 22 02 AM

Did you end up deciding this was a bad idea? If so, let's close the issue.