Closed gezelle-d closed 6 days ago
There won't necessarily be a way to "force" it to converge - sometimes the model is just not identifiable from the data. This commonly happens in models like this one where there are lots of transitions allowed in continuous time but the state is only observed intermittently.
I guess you are modelling smoking behaviour (or something like that), and the states match how your data are measured? A challenge here is that msm
uses a continuous-time model, but in this sort of application, it is difficult to define the exact moment in continuous time when a person changes state.
Would it be possible to interpret the state as representing a quantity that has to change smoothly over time, say "intensity of smoking"? You could then disallow the direct transition from "never" to "daily", and from "daily" to "non-current". However, this model would still allow these transitions for any discrete time unit (e.g. from one day to the next).
To represent covariate effects, although this model wouldn't give hazard ratios on the never-daily transition intensity, you could still calculate the never-daily transition probability (for the time unit of your choice) for different values of the covariate.
Thank you for your prompt response. I removed the direct transitions from never to daily, and from daily to non-current, however I'm now encountering a different warning message: "Optimisation has probably not converged to the maximum likelihood - Hessian is not positive definite." I tried running it without the covariate and just get the same warning message that I was initially getting "Iteration limit in optim() reached without convergence." Any further suggestions?
Try also removing the non-current -> daily direct transition, because you could also assume this goes via "occasional". Look at the confidence intervals in your original output - these three rates are those for which there is no information in the data. If that doesn't work, play around with fixing some rates at sensible values and see if you can estimate the others, and/or explore fitting subsets of the model to subsets of the data.
Removal of non-current to daily seems to have fixed things! Thank you so much for your help.
Hi there,
I'm hoping to get some advice on this convergence issue. I've read previous posts regarding similar issues and have tried a number of things to resolve it including removing participants with minimal data, scaling my variables, using months instead of years, increasing the maxit (up to 50000) and adjusting the fnscale to the log-likelihood value. Some advice on this would be much appreciated! Thank you :)
Created on 2024-09-26 with reprex v2.1.1