hazard ratio for different covariate unit? or encourage people to store meaningful unit in data?

option to log hazard ratios, or log intens

put in format for mstate

Go over basic usage again in manual with new print format, attention to variable naming and initial values.

Show convergence codes from optim

Common interface to different optimisation methods

Total length of stay with piecewise-constant time-dependent covariates.

Probability of passage (document clearly as different from pmatrix)

EFPT with time dependent covs?

Give informative error if initprobs not changed from default, but observed initial states other than 1.

No point printing CIs for fixed parameters?

Make sure all components of msm objects are documented properly, e.g. paramdata.
No need to duplicate stuff like deriv

More developer documentation - comments for definitions of variables
   in internal data structures like qmodel, emodel etc.

In extractor functions, warn that polynomial contrasts not supported,
only treatment contrasts. (factorcov2numeric.msm)
store in covdata whether model matrix built using treat/poly for factors



POSSIBLE MAJOR DEVELOPMENTS

Random effects models.  Could be done by translating a msm model to
corresponding JAGS or Stan code, inserting the random effects
then using MCMC for estimation.  HMMs would probably be better in
Stan.

Phase-type models.  Build appropriate parameter constraints in.

Time-inhomogeneous models with smoothly-varying intensities.  Product
integral method looks easy, e.g. for predictable covariates like age.
Alternatively, numerically integrate the Kolmogorov equations, as in
Titman (Biometrics 2011).  deSolve package could be used for this in C.
Difficult .Call type mechanism needed for using user-defined R functions
in C. See Writing R Extensions 5.11.1 for a possible starting point.
Or Rcpp.

Multicore bootstrapping using "parallel" package.  Must work cross-platform, including Windows.
http://stackoverflow.com/questions/18588896/custom-package-using-parallel-or-doparallel-for-multiple-os-as-a-cran-package
gives alternatives: compare these for speed.



SOME OTHER SUGGESTIONS: not all may be sensible.

More intelligent use of model frames and formulae when forming data, e.g. na.action to omit NAs.  expand.model.frame should be useful here

Turnbull method to non-parametrically estimate time to interval-censored event.

Viterbi algorithm.  Probability of each hidden state at each time, instead of just most probable.
To compute this, need probabilities of all paths ending in state L at time ti: i.e. be sum_k instead of max_k in formula in Sec2.17 of PDF manual.

Bureau survival plots

Particle swarm optimisation?  ppso  http://www.rforge.net/ppso/index.html, or hydroPSO

Other optimisers (Nash) Rvmmin is modern BFGS with bounds. Bounds recommended to avoid silly solutions. (compute unbounded hessian by hand at solution?). Lots of parameters: Rcgmin much better than CG.   bobyqa (package minqa) for fast derivative free.

Multiple realisations from same hidden trace, and/or multivariate HMM outcomes (major change to data structures needed).
cf. multiple multi-state processes with shared random effects?

For hidden models, cache Pmatrix once for frequently-occurring each from, to, time combinations

Investigate forward algorithm for fitting HMMs - is this more efficient?

Truncated observations.

.Call for passing data to C?  Rcpp package facilitates this.

Steady state probabilities

Use S_alloc instead of Calloc as in Viterbi - no need to free. Can't use on.exit to free on interrupt unless pointer declared globally.
