-
Notifications
You must be signed in to change notification settings - Fork 26
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Handling of NAs and get_weights_nonmetric() for non-reflective blocks #2
Comments
Hi Guillaume Thanks a lot for your emails and bug reports, I'll forward the information to Giorgio Russolillo, and hopefully we'll be All the best, Gaston On Mon, Mar 17, 2014 at 11:25 AM, guilhemchalancon <notifications@github.com
_G_aston _S_anchez, PhD |
Dear Gaston,
I run into a bug when using NAs for non reflective blocks (in 30aaec0 as well as in the 0.4.1 stable version).
For instance, introducing NAs in
data(russa)
as you shown here https://github.com/gastonstat/plspm,plspm()
works fine with A or NewA modes, but fails with B, PLSCORE or PLSCOW.To verify this, I loaded the toy dataset with 3 NAs being introduced:
Then running
plspm()
with non reflective modes:...which in all cases leads to an error due to non-conformable elements in
get_weights_nonmetric
.After digging out what the issue was, I found out that the reason is in the format of
get_PLSR_NA()
outputs.Specifically, if we look at the what happens for non-reflective modes when NAs are detected, we can see that
w[[q]]
is obtained byget_PLSR_NA
:It turns out that
get_PLSR_NA()
renders a 1-column matrix, although a numeric vector is needed for the productQQ[[q]])*w[[q]]
to work. As a result the function fails to assign values toY[,q]
.Note that the only cases in
get_weights_nonmetric()
wherew[[q]]
is not a numeric vector is precisely whenmissing_data(q) == T
andspecs$modes[q]
is either PLSCORE, PLSCOW or B. In other words, wheneverget_PLSR_NA()
is called.I found that converting
w[[q]]
to the right format (i.e.w[[q]] = t( get_PLSR_NA(Y=...) )[1,]
was sufficient in my context (because I didn't check whetherget_PLSR_NA
was used in other contexts where a 1-column matrix might be expected).However, it might be better to change the output format of
get_PLSR_NA()
instead.Best regards,
G
The text was updated successfully, but these errors were encountered: