Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

problem running function aucJM() in JMbayes package: Error in eigen #41

Closed
quzhouxiachuan opened this issue May 13, 2019 · 9 comments
Closed

Comments

@quzhouxiachuan
Copy link

quzhouxiachuan commented May 13, 2019

I used aucJM() before and it was fine. However, when I included 4 longitudinal outcomes in the linear mixed model and used aucJM() to evaluate the joint model, it gives me the following error:

aucJM(JMFit7, newdata=ND, Tstart=15, Thoriz = NULL, Dt = 10, idVar = 'ID_d') Error in eigen(Sigma, symmetric = TRUE) : infinite or missing values in 'x'

I do not have missing data or infinite in the ND dataset. Any idea on what is going on here? Also, I have warning messages when fitting the mvJointModelBayes() function, I am not sure if this should be any concern.

Thanks

@quzhouxiachuan quzhouxiachuan changed the title problem running function aucJM() in JMbayes package problem running function aucJM() in JMbayes package: Error in eigen May 13, 2019
@drizopoulos
Copy link
Owner

drizopoulos commented May 13, 2019 via email

@quzhouxiachuan
Copy link
Author

Hi,
Thanks for your quick reply! Here is the output from traceback:

traceback()
8: stop("infinite or missing values in 'x'")
7: eigen(Sigma, symmetric = TRUE)
6: (function (n, mu, Sigma, df)
{
p <- length(mu)
if (is.list(Sigma)) {
ev <- Sigma$values
evec <- Sigma$vectors
}
else {
ed <- eigen(Sigma, symmetric = TRUE)
ev <- ed$values
evec <- ed$vectors
}
X <- drop(mu) + tcrossprod(evec * rep(sqrt(pmax(ev, 0)),
each = p), matrix(rnorm(n * p), n))/rep(sqrt(rchisq(n,
df)/df), each = p)
if (n == 1L)
drop(X)
else t.default(X)
})(mu = dots[[1L]][[35L]], Sigma = dots[[2L]][[35L]], n = 100,
df = 4)
5: mapply(rmvt, mu = split(modes.b, row(modes.b)), Sigma = Vars.b,
MoreArgs = list(n = M, df = 4), SIMPLIFY = FALSE)
4: survfitJM.mvJMbayes(object, newdata = newdata2, idVar = idVar,
survTimes = Thoriz, M = M)
3: survfitJM(object, newdata = newdata2, idVar = idVar, survTimes = Thoriz,
M = M)
2: aucJM.mvJMbayes(JMFit7, newdata = NDD, Tstart = 15, Thoriz = NULL,
Dt = 10, idVar = "ID_d")
1: aucJM(JMFit7, newdata = NDD, Tstart = 15, Thoriz = NULL, Dt = 10,
idVar = "ID_d")

@drizopoulos
Copy link
Owner

drizopoulos commented May 13, 2019 via email

@quzhouxiachuan
Copy link
Author

quzhouxiachuan commented May 13, 2019

Thanks! I will try to simplify it and see if the error gets solved. Right now, I only have a random slope:

#add more longitudinal outcomes
multMixedFit2 <- mvglmer(list(ln(TOTCHL) ~ Time + (Time | ID_d),
ln(HDLCHL) ~ Time + (Time | ID_d),
HXDIAB ~ Time + (Time | ID_d),
SMOKER ~ Time + (Time | ID_d) ), data = D, families = list(gaussian, gaussian,binomial, binomial))

@quzhouxiachuan
Copy link
Author

quzhouxiachuan commented May 16, 2019

Hi
I changed the model to a simpler version:
multMixedFit3 <- mvglmer(list(ln(TOTCHL) ~ Time + (Time | ID_d),
ln(HDLCHL) ~ Time + (Time | ID_d),
HXDIAB ~ Time + (1 | ID_d)
), data = D, families = list(gaussian, gaussian,binomial))

However, same error still exists. Please let me know if there is a way around this.


an update on the same topic, I used a even simpler version of joint model:
coxfit3 = coxph(Surv(ttocvd,cvd) ~ ln(base_age)+ (ln(base_age))^2 + SBP_RXHYP + SBP_RXHYP_N + ageSmoker , data=D.id,model = TRUE)
multMixedFit3 <- mvglmer(list(ln(TOTCHL) ~ Time + (Time | ID_d),
#ln(HDLCHL) ~ Time + (Time | ID_d),
HXDIAB ~ Time + (1 | ID_d)
), data = D, families = list(gaussian, binomial))

The same error still exists somehow. Any advice would be appreciated!

Thanks!

@quzhouxiachuan
Copy link
Author

I also had this error when using aucJM(). I am not sure what is going on here.

aucJM(JMFit6, newdata=ND, Tstart=16, Thoriz = NULL, Dt = 10, idVar = 'ID_d')
Error in solve.default(opt$hessian) :
system is computationally singular: reciprocal condition number = 0

I am wondering if you have any thoughts on this? Any advice would be appreciated!

@drizopoulos
Copy link
Owner

drizopoulos commented Jul 10, 2019 via email

@quzhouxiachuan
Copy link
Author

quzhouxiachuan commented Aug 15, 2019

Hi Thanks so much for the comments! Both my longitudinal variables are binary. I am afraid center predictors wouldn't work. The model works fine with continuous variables.
I only have two longitudinal outcomes, so I wouldn't say the model is too complicated? See the code below:
multMixedFit1 <- mvglmer(list(HXDIAB ~ Time + (Time | ID_d), SMOKER ~ Time + (Time | ID_d)), data = D, families = list(binomial, binomial))
JMFit1 <- mvJointModelBayes(multMixedFit1, coxfit1, timeVar = "Time")

@quzhouxiachuan
Copy link
Author

actually, the error only occurs at some time points:
Screen Shot 2019-08-15 at 11 55 10 AM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants