Hi, I fitted two different ZINB models on count data representing gene expression. The only difference between the two models is the group-level effect. For one model, the grouping factor is gene. For the other model, the group factor is gene:cell type. Then I want to know which model has a better fit of the data. I tried loo(), loo_compare(), bayes_R2(), etc. All of them returned this error:
Error in h(simpleError(msg, call)) :
error in evaluating the argument ‘x’ in selecting a method for function ‘as.matrix’: Cholmod error ‘problem too large’ at file …/Core/cholmod_dense.c, line 105
Error: Something went wrong (see the error message above). Perhaps you transformed numeric variables to factors or vice versa within the model formula? If yes, please convert your variables beforehand. Or did you use a grouping factor also for a different purpose? If yes, please make sure that its factor levels are correct also in the new data you may have provided.
Does anyone know what is the problem? Is it because the dataset is too big? The file size of the two saved models is around 50MB and 250MB, respectively. There are 237541 data points in both data. The data points are from 157 genes and 1513 cells from 8 cell types. For the model with gene as grouping factor, there are 157 levels. For the other model, there are 157*8=1256 levels. And there is only one predictor and one offset in the model. For overdispersion and zero inflation parameter of the ZINB distribution, I chose them to be the same across all genes and all cell types. I checked the forum and it seems that this is not super big compared to other people’s models. Is there any input on what caused this problem?
If it is indeed due to the file/data size, is there any suggestion on how to reduce the file size of the fitted model and then do model comparison?