hredestig / pcaMethods

Perform PCA on data with missing values in R
GNU General Public License v2.0
45 stars 10 forks source link

PPCA error #17

Closed CreaperLost closed 1 year ago

CreaperLost commented 2 years ago

I get this error when fitting a ppca model the following way : ppca1=pca(df_train,method="ppca", nPcs=pcs,scale = 'none',center=FALSE)

where npcs = min(dim(data))-1

Error in if (rel_ch < threshold & count > 5) { : missing value where TRUE/FALSE needed

Any ideas?

CreaperLost commented 2 years ago

Additionally I get the following warning messages : 1: In orth(C) : Precision for components 11 - 11 is below .Machine$double.eps. Results for those components are likely to be inaccurate!!

2: In orth(C) : Precision for components 9 - 11 is below .Machine$double.eps. Results for those components are likely to be inaccurate!!

3: In orth(C) : Precision for components 18 - 19 is below .Machine$double.eps. Results for those components are likely to be inaccurate!!

4: In ppca(prepres$data, nPcs = nPcs, ...) : stopped after max iterations, but rel_ch was > threshold 5: In orth(C) : Precision for components 23 - 35 is below .Machine$double.eps. Results for those components are likely to be inaccurate!!

6: In ppca(prepres$data, nPcs = nPcs, ...) : stopped after max iterations, but rel_ch was > threshold 7: In orth(C) : Precision for components 24 - 35 is below .Machine$double.eps. Results for those components are likely to be inaccurate!!

8: In orth(C) : Precision for components 13 - 19 is below .Machine$double.eps. Results for those components are likely to be inaccurate!!

9: In ppca(prepres$data, nPcs = nPcs, ...) : stopped after max iterations, but rel_ch was > threshold 10: In orth(C) : Precision for components 22 - 35 is below .Machine$double.eps. Results for those components are likely to be inaccurate!!

11: In ppca(prepres$data, nPcs = nPcs, ...) : stopped after max iterations, but rel_ch was > threshold 12: In orth(C) : Precision for components 17 - 35 is below .Machine$double.eps. Results for those components are likely to be inaccurate!!

13: In orth(C) : Precision for components 15 - 19 is below .Machine$double.eps. Results for those components are likely to be inaccurate!

hredestig commented 2 years ago

Looks to me like matrix is deflated such that there is no more variation to fit, and the rel_ch then becomes missing. Try to reduce the number of components?