Open AustinMichael2418 opened 2 months ago
First off, sorry for using my other old account for creating this issue, but in addition to this error, sonf
throws The number of observations of y (72) should be greater than the number or predictors of xfd (116).
I am not sure if this should be a check on the data or if there is simply not enough data to run FCQS on the data set reliably.
The first issue is resolved: add the symmetric = T option on the eigenvalue decomposition. As far as the second comment, you are right. Since we are performing dimension reduction, I don't think we need n > p. I will look more into it though.
While working on test data, I found that when
fcqs
is run on the real data from the Dropbox, it results in complex eigenvalues inrigpower
, resulting in an error ineval
.This is the code I ran to analyze the data:
And this gives the error,
Error in max(eval) : invalid 'type' (complex) of argument
The error can be found here:
https://github.com/elianachristou/fquantdr/blob/main/R/rigpower.R#L63
Precious' pull request, #82 , should provide a temporary fix preventing the error from showing up, but additional consideration should likely be taken to determine why complex eigenvalues appear and how to deal with these, whether by finding the real part as Precious did, finding the magnitude, or otherwise modifying the eigenvalues before they are used.