Closed marc-vaisband closed 1 year ago
Thanks for the report. This is a consequence of some inappropriate behaviour by the crudeinits.msm
procedure for generating initial values. If there are no observed direct data for a particular allowed transition, the initial value was getting set to zero. The qconstraint
consistency check was being done after these initial values were set, which led to the error you saw. I have fixed this in the github version by using a small positive number for the initial value in this case. You can work around this in the CRAN version by using your own initial values in the msm
call, instead of gen.inits=TRUE
.
When specifying a model, there can be allowed transitions which are never explicitly observed in the data, but for which we would like to still estimate transition rates. For example, if we consider a four-state model, where we can have transitions (1, 2), (1, 3), (2, 4), (3, 4), we can additionally require that [(1, 2), (3, 4)] and [(1, 3), (2, 4)] each share a rate.
However, if we try to fit this,
it errors out with the message
Error in msm.form.qmodel(qmatrix, qconstraint, analyticp, use.expm, phase.states) : baseline intensity constraint of length 4, should be 3
.Presumably this is because the rate for the (3, 4) transition is automatically dropped somewhere, so as a result there are more constraints than parameters. However, we do have information about it since we know it must be equal to the (1, 2) rate.
And assuming that the transition (3, 4) is impossible would mis-specify the model, as it would change the likelihood of observing a (1, 4) transition.
How should this case be handled?