amices / mice

Multivariate Imputation by Chained Equations
https://amices.org/mice/
GNU General Public License v2.0
437 stars 107 forks source link

Some problem with eigen value decomposition #145

Closed AbhishekVermaKT closed 5 years ago

AbhishekVermaKT commented 5 years ago

I am getting error from internal code of mice package. I tried imputation using different methods: `train1 <- mice(train1, m = 5, maxit = 50, meth = 'mean', seed = 500)

iter imp variable 1 1 clientdata.demo.genderError in while (eig$values[k]/eig$values[1] < eps) { : missing value where TRUE/FALSE needed

train1 <- mice(train1, m = 5, maxit = 50, meth = 'pmm', seed = 500)

iter imp variable 1 1 clientdata.demo.genderError in while (eig$values[k]/eig$values[1] < eps) { : missing value where TRUE/FALSE needed

train1 <- mice(train1, m = 5, maxit = 50, meth = 'rf', seed = 500)

iter imp variable 1 1 clientdata.demo.genderError in while (eig$values[k]/eig$values[1] < eps) { : missing value where TRUE/FALSE needed However it is not the problem with my LAPACK/BLAS installation I assume because: eigen(matrix(data = rnorm(100), nrow = 10, ncol = 10)) $values [1] 1.9184458+2.073613i 1.9184458-2.073613i -1.0486195+1.669464i -1.0486195-1.669464i -1.9361743+0.000000i -1.2795732+1.023680i -1.2795732-1.023680i [8] 1.2143559+0.331422i 1.2143559-0.331422i -0.3230304+0.000000i

$vectors [,1] [,2] [,3] [,4] [,5] [,6] [1,] -0.1797036+0.1205518i -0.1797036-0.1205518i -0.09055569+0.2927517i -0.09055569-0.2927517i -0.08909322+0i -0.32997432-0.04437684i [2,] 0.1736714+0.1196586i 0.1736714-0.1196586i -0.15785756+0.0955814i -0.15785756-0.0955814i -0.20307683+0i 0.00217855-0.09163559i [3,] 0.0466036-0.3959627i 0.0466036+0.3959627i 0.50785532+0.0000000i 0.50785532+0.0000000i -0.05901043+0i -0.04990162+0.30980176i [4,] -0.3083558+0.0466655i -0.3083558-0.0466655i -0.26566544+0.1565965i -0.26566544-0.1565965i -0.48511115+0i 0.02825023-0.26666534i [5,] 0.1096270-0.1950507i 0.1096270+0.1950507i -0.00059355-0.0548294i -0.00059355+0.0548294i 0.16455040+0i 0.03730732-0.02605633i [6,] -0.2322505-0.3218701i -0.2322505+0.3218701i 0.04328074-0.2331745i 0.04328074+0.2331745i 0.02621538+0i 0.06906915+0.08414852i [7,] 0.0876567-0.2227542i 0.0876567+0.2227542i -0.33951301-0.2107367i -0.33951301+0.2107367i 0.60290126+0i 0.42727701-0.13587441i [8,] -0.0084854+0.1631769i -0.0084854-0.1631769i 0.01475816-0.3804982i 0.01475816+0.3804982i -0.05351456+0i 0.56000482+0.00000000i [9,] 0.5529766+0.0000000i 0.5529766+0.0000000i 0.19048765-0.2195086i 0.19048765+0.2195086i 0.11151645+0i 0.31202685+0.22114341i [10,] 0.1784544-0.1524475i 0.1784544+0.1524475i 0.04891927+0.2612186i 0.04891927-0.2612186i -0.55267840+0i -0.03169632-0.18586293i [,7] [,8] [,9] [,10] [1,] -0.32997432+0.04437684i -0.04049707+0.03684882i -0.04049707-0.03684882i 0.25003040+0i [2,] 0.00217855+0.09163559i -0.47157547-0.03091588i -0.47157547+0.03091588i -0.10348247+0i [3,] -0.04990162-0.30980176i -0.11462573+0.05154422i -0.11462573-0.05154422i -0.27818820+0i [4,] 0.02825023+0.26666534i -0.26089790-0.02902338i -0.26089790+0.02902338i -0.17819236+0i [5,] 0.03730732+0.02605633i 0.23667822+0.11322249i 0.23667822-0.11322249i -0.28608461+0i [6,] 0.06906915-0.08414852i 0.56906641+0.00000000i 0.56906641+0.00000000i 0.28472750+0i [7,] 0.42727701+0.13587441i 0.38588546+0.06496511i 0.38588546-0.06496511i -0.15174402+0i [8,] 0.56000482+0.00000000i -0.27281084+0.10414088i -0.27281084-0.10414088i -0.52595972+0i [9,] 0.31202685-0.22114341i 0.15866720+0.16822862i 0.15866720-0.16822862i -0.58742289+0i [10,] -0.03169632+0.18586293i 0.06635385-0.00253049i 0.06635385+0.00253049i 0.09997653+0i`

Also once I got different error message: `train1 <- mice(train1, m = 5, maxit = 50, meth = 'rf', seed = 500)

iter imp variable 1 1 clientdata.demo.genderError in eigen(ncx) : BLAS/LAPACK routine 'DSTEIN' gave error code -6`

I am sorry that I can not share the data.

stefvanbuuren commented 5 years ago

For one thing, it seems a bit risky to overwrite your data with the results of mice. Is your train1 dataset still in good shape?

AbhishekVermaKT commented 5 years ago

Though there was no problem related to overwrite. However I was not able to replicate this issue on new version of R on a public dataset. So closing this issue. Sorry for some time lost in the process.