drizopoulos / GLMMadaptive

GLMMs with adaptive Gaussian quadrature
https://drizopoulos.github.io/GLMMadaptive/
60 stars 14 forks source link

Error with zero_ind vector? #18

Closed bradleymecham closed 5 years ago

bradleymecham commented 5 years ago

Hello,

First off, thank you for this amazing library! It is so helpful, and it's also vital for the research we're doing. We really appreciate you making it available!!

Today I changed a little bit of my model/data and am now getting an error that looks like this:

Error in if (any(zero_ind <- p_yb == 0)) { : missing value where TRUE/FALSE needed.

Unfortunately, I get this error even if I download and build the library directly from GitHub. And so I searched to discover how it could be possible for the statement "zero_ind <- p_yb == 0.0" (found on line 133 in mixed_fit.R and on lines 32 and 74 in Fit_Funs.R) to return only NA or a list of NAs. If p_yb were all NAs, "any" would also return NA and the "if" statement would fail. Do you know how it is possible for p_yb to consist entirely of NAs? Or is there a recommended action to take when you have NAs in p_yb? Or as an alternative, can you catch the error before this test, perhaps, and help me know what to correct? I'd love to fix my data, but I'm not entirely sure what is wrong. Any chance you could take a look?

Thank you!!

Bradley

drizopoulos commented 5 years ago

Hello Bradley,

I’m glad my package is useful. Regarding your question, my guess is that something goes wrong during the optimization. You could use the option mixed_model(..., verbose = TRUE) to see if some parameters get illogical values.

Regarding remedies, you could have a look at the vignette for Optimization and Numerical Integration.