Closed yushuf closed 6 years ago
I have recreated the error and will investigate.
This seems to be a case where "optim" did not find a true minimum in the negative log likelihood. If you try different initial values, it converges to a higher log likelihood with a positive definite Hessian. I tried many different starting values, and the convergence failure seems to happen most often when one of the starting values is far from zero.
I have revised the code so that all initial coefficients are zero by default. You should run some simulations to see if this has reduced the probability of getting negative variances. If so, I will close this issue.
Command:
unobs_tr <- transreg( Surv(start, stop, infset) ~ infx + susx + ext(external), sus = "susceptible", data = dat, subset = (trace == 1), dist = "weibull", xdist = "weibull" )
Warning message: In sqrt(diag(treg$var)[parm]) : NaNs produced
covariance matrix of coefficients providing negative variance of xintercept and log(xshape). It seems to me something wrong? This is happening frequently with Weibull option. xdata, pdata, coef were sent by email. Github does not attach .csv
coef.txt pdata.txt xdata.txt