Open Huifang-Xu opened 2 years ago
Hi,
The following links contain the results, scripts, and log files for running bivariate analysis. https://github.com/Huifang-Xu/Practice/blob/main/mixer_bivariate_test_part1.tar.gz https://github.com/Huifang-Xu/Practice/blob/main/mixer_bivariate_test_part2.tar.gz https://github.com/Huifang-Xu/Practice/blob/main/mixer_bivariate_test_part3.tar.gz
Any help is appreciated. Thank you!
Best, Huifang
Hi Huifang-Xu,
I get that error too. What I do is that I call 'mixer_figures.py combine' in a loop, each time removing one of the rep file; e.g.:
for repID in `seq 1 20`; do
echo "============================"
# try merging without that rep file
mv -v fit.A_vs_B.rep${repID}.json xxx
python3 mixer_figures.py \
combine \
--json fit.A_vs_B.rep@.json \
--out fit.A_vs_B
mv xxx fit.A_vs_B.rep${repID}.json
done
Now suppose that without rep7 the combine function didn't yield the 'singular matrix' error, then remove it entirely, e.g.
mv fit.A_vs_B.rep7.json Xfit.A_vs_B.rep7.json
Then relaunch the combine like usual.
I wish I had a better solution. Kind of amazing to get a singular matrix with all that number crunching :-)
Hi,
Thank you for your reply! I found another solution. When I change the parameter allow_singular=False
in line 557 of the script precimed/mixer/figures.py
to allow_singular=True
, the error message does not appear again. But I don't know if changing this parameter will affect the results.
Thanks, Huifang
Ah, yes, much better answer!
I suppose you should change allow_singular=False to allow_singular=True in the following script:
python3.8/site-packages/scipy/stats/_multivariate.py
Got it, thank you!
Hi,
I tried to run bivariate analysis for multiple traits with MiXeR. One of the bivariate analyses fialed to produce results with the error meaasge "numpy.linalg.LinAlgError: singular matrix". No error message was generated in the two steps of fitting and applying model. All json files exist.
The codes I used:
I would like to know why this error message occured and how to fix it. Any help is appreciated. Thank you!
Huifang