start.pos.par: Positions within full parameters vector of starting point for each sub-parameters vector corresponding to each transition intensity specification.
l.short.formula: Number of transitions.
whereQ: Positions within Q matrix of not-null transition intensities.
firstD: Whether the first derivative of the Q matrix should be computed.
secondD: Whether the second derivative of the Q matrix should be computed.
bound.eta: Whether to bound the additive predictor, defaults to FALSE. This is only used for debugging purposes, do not change.
pos.optparams: Vector with positions of parameters vector in the form used by the optimization algorithm (i.e. when one or more parameters are constrained to be equal these will only appear once).
pos.optparams2: Like pos.optparams but the count is not stopped at the constrained parameters.
Returns
Q matrix and its first and second derivatives with respect to the parameters vector.