Package: msmbayes 0.3

msmbayes: Bayesian Multi-State Models for Intermittently-Observed Data

Bayesian multi-state models for intermittently-observed data. Markov and phase-type semi-Markov models, and misclassification hidden Markov models.

Authors:Christopher Jackson [aut, cre]

msmbayes_0.3.tar.gz
msmbayes_0.3.zip(r-4.7)msmbayes_0.3.zip(r-4.6)msmbayes_0.3.zip(r-4.5)
msmbayes_0.3.tgz(r-4.6-x86_64)msmbayes_0.3.tgz(r-4.6-arm64)msmbayes_0.3.tgz(r-4.5-x86_64)msmbayes_0.3.tgz(r-4.5-arm64)
msmbayes_0.3.tar.gz(r-4.7-arm64)msmbayes_0.3.tar.gz(r-4.7-x86_64)msmbayes_0.3.tar.gz(r-4.6-arm64)msmbayes_0.3.tar.gz(r-4.6-x86_64)
manual.pdf |manual.html
card.svg |card.png
msmbayes/json (API)
NEWS

# Install 'msmbayes' in R:
install.packages('msmbayes', repos = c('https://chjackson.r-universe.dev', 'https://cloud.r-project.org'))

Bug tracker:https://github.com/chjackson/msmbayes/issues

Uses libs:
  • c++– GNU Standard C++ Library v3
Datasets:
  • bigdat - A simulated multistate dataset with lots of observations and covariates
  • illdeath_data - A simulated dataset from an illness-death model
  • infsim - Simulated infection testing data
  • infsim_model - Example fitted model objects used for testing msmbayes
  • infsim_modelc - Example fitted model objects used for testing msmbayes
  • infsim_modelp - Example fitted model objects used for testing msmbayes
  • infsim_modelpc - Example fitted model objects used for testing msmbayes
  • infsim2 - Simulated infection testing data

On CRAN:

Conda:

cpp

5.23 score 7 stars 6 scripts 48 exports 64 dependencies

Last updated from:80e2bd7f52. Checks:3 WARNING, 9 OK, 1 FAIL. Indexed: yes.

TargetResultTimeFilesSyslog
linux-devel-arm64WARNING527
linux-devel-x86_64WARNING548
source / vignettesOK656
linux-release-arm64OK536
linux-release-x86_64OK516
macos-release-arm64OK430
macos-release-x86_64OK661
macos-oldrel-arm64OK486
macos-oldrel-x86_64OK795
windows-develWARNING666
windows-releaseOK548
windows-oldrelOK668
wasm-releaseFAIL175

Exports:canpars_to_ratesdnphaseedfematrixgamma_shape_in_boundshnphasehrloghrlogliklogoddsnextlogrrnextlogtafmean_nphasemean_sojournmsmbayesmsmbayes_prior_samplemsmbayes_priorpred_samplemsmhistmsmhist_bardatamsmpriorn3_moment_boundsncmoment_nphasenphase_Qphaseapprox_parspmatrixpmatrixdfpnextpnphaseqdfqmatrixqnphaseqphaseapproxrates_to_canparsrnphaserrnextshape_uboundshapescale_to_ratessim_2state_smmskewness_nphasesoj_probsoj_quantilestandardise_tostandardize_tostatetabletaftotlosvar_nphaseweibull_shape_in_bounds

Dependencies:abindarrayhelpersbackportsBHcallrcheckmateclicodacpp11descdistributionaldplyrexpmfarvergenericsggdistggplot2gluegridExtragtablehardhatinlineisobandlabelinglatticelifecycleloomagrittrMatrixmatrixStatsnumDerivpillarpkgbuildpkgconfigposteriorprocessxpspurrrquadprogQuickJSRR6RColorBrewerRcppRcppEigenRcppParallelrlangrstanrstantoolsS7scalessparsevctrsStanHeadersstringistringrsvUnittensorAtibbletidybayestidyrtidyselectutf8vctrsviridisLitewithr

Advanced phase-type models in msmbayes

Rendered fromnphase.Rmdusingknitr::rmarkdownon May 06 2026.

Last update: 2025-07-09
Started: 2024-12-20

Misclassification multi-state models in msmbayes

Rendered frommisclass.Rmdusingknitr::rmarkdownon May 06 2026.

Last update: 2024-12-20
Started: 2024-12-20

Semi-Markov models with msmbayes

Rendered fromsemimarkov.Rmdusingknitr::rmarkdownon May 06 2026.

Last update: 2025-07-22
Started: 2024-12-19

Readme and manuals

Help Manual

Help pageTopics
The 'msmbayes' package for Bayesian multi-state modelling of intermittently-observed datamsmbayes-package
A simulated multistate dataset with lots of observations and covariatesbigdat
Convert between canonical parameters and rates for a phase-type distributioncanpars_to_rates rates_to_canpars
Misclassification error probabilities from an msmbayes modeledf
Matrix of misclassification error probabilities from an msmbayes modelematrix
Example fitted model objects used for testing msmbayesexample_models infsim_model infsim_modelc infsim_modelp infsim_modelpc
A simulated dataset from an illness-death modelilldeath_data
Simulated infection testing datainfsim infsim2
(Log) hazard ratios for covariates on transition intensitieshr loghr
Log likelihood from an msmbayes modelloglik logLik.msmbayes
Summarise posteriors for log odds of transitions from phase-type stateslogoddsnext
(Log) time acceleration factors in semi-Markov modelslogtaf taf
Mean sojourn times from an msmbayes modelmean_sojourn
Bayesian multi-state models for intermittently-observed datamsmbayes
Generate a sample from the prior distribution in a msmbayes modelmsmbayes_prior_sample
Generate a dataset from the prior predictive distribution in a msmbayes modelmsmbayes_priorpred_sample
Illustrate the empirical distribution of states against time in intermittently-observed multistate datamsmhist
Estimate state occupation probabilities to be illustrated by a bar plot in 'msmhist'msmhist_bardata
Constructor for a prior distribution in msmbayesmsmprior
Bounds on normalised moments for phase-type approximationsn3_moment_bounds
Density, probability distribution, quantile, moment, hazard and random number generation functions for the Coxian phase-type distribution with any number of phases.dnphase hnphase mean_nphase ncmoment_nphase nphase pnphase qnphase rnphase skewness_nphase var_nphase
Given a phase-type sojourn distribution, return the corresponding Markov intensity matrix where the last state is the absorbing state, and the the time to absorption is the sojourn distribution.nphase_Q
Summarise posteriors for shape and scale parameters for the sojourn distribution in a semi-Markov msmbayes modelphaseapprox_pars
Transition probability matrix from an msmbayes modelpmatrix
Transition probabilities from an msmbayes model, presented as a tidy data framepmatrixdf
Probabilities for the next state in a multi-state modelpnext
Transition intensities from an msmbayes model, presented as a tidy data frameqdf
Transition intensity matrix from an msmbayes modelqmatrix
Phase-type expansion of a transition intensity matrix to create a non-Markov multi-state modelqphaseapprox
Effects of covariates on competing exit transitions in phase type modelslogrrnext rrnext rrnextdoc
Test whether a shape parameter of is in the bounds required for a valid phase-type approximationgamma_shape_in_bounds shape_in_bounds weibull_shape_in_bounds
Upper bound for shape parameter in moment-based phase-type approximationsshape_ubound
Determine parameters of a phase-type model that approximate a parametric shape-scale distributionshapescale_to_rates
Simulate intermittently-observed data from a semi-Markov multi-state model with two states and reversible transitions.sim_2state_smm
Sojourn probability in a state of a msmbayes modelsoj_prob
Quantiles of the sojourn distribution in a state of a msmbayes modelsoj_quantile
Constructor for a standardising population used for model outputsstandardise_to standardize_to
Summarise intermittenly-observed multi-state datastatetable
Summarise basic parameter estimates from an msmbayes modelsummary.msmbayes
Total length of stay in each state over an intervaltotlos