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.6-arm64)msmbayes_0.3.tar.gz(r-4.6-x86_64)msmbayes_0.3.tar.gz(r-4.5-arm64)msmbayes_0.3.tar.gz(r-4.5-x86_64)
msmbayes.pdf |msmbayes.html
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.20 score 7 stars 6 scripts 46 exports 64 dependencies

Last updated from:57321bd2f5. Checks:12 OK, 1 FAIL. Indexed: yes.

TargetResultTimeFilesSyslog
linux-devel-arm64OK531
linux-devel-x86_64OK533
source / vignettesOK719
linux-release-arm64OK501
linux-release-x86_64OK540
macos-release-arm64OK354
macos-release-x86_64OK614
macos-oldrel-arm64OK330
macos-oldrel-x86_64OK628
windows-develOK687
windows-releaseOK632
windows-oldrelOK593
wasm-releaseFAIL188

Exports:canpars_to_ratesdnphaseedfematrixgamma_shape_in_boundshnphasehrloghrlogliklogoddsnextlogrrnextlogtafmean_nphasemean_sojournmsmbayesmsmbayes_prior_samplemsmbayes_priorpred_samplemsmhistmsmhist_bardatamsmpriorn3_moment_boundsncmoment_nphasenphase_Qphaseapprox_parspmatrixpmatrixdfpnextpnphaseqdfqmatrixqnphaseqphaseapproxrates_to_canparsrnphaserrnextshape_uboundshapescale_to_ratesskewness_nphasesoj_probstandardise_tostandardize_tostatetabletaftotlosvar_nphaseweibull_shape_in_bounds

Dependencies:abindarrayhelpersbackportsBHcallrcheckmateclicodacpp11descdistributionaldplyrexpmfarvergenericsggdistggplot2gluegridExtragtablehardhatinlineisobandlabelinglatticelifecycleloomagrittrMatrixmatrixStatsnumDerivpillarpkgbuildpkgconfigposteriorprocessxpspurrrquadprogQuickJSRR6RColorBrewerRcppRcppEigenRcppParallelrlangrstanrstantoolsS7scalessparsevctrsStanHeadersstringistringrsvUnittensorAtibbletidybayestidyrtidyselectutf8vctrsviridisLitewithr

Advanced phase-type models in msmbayes

Rendered fromnphase.Rmdusingknitr::rmarkdownon Apr 12 2026.

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

Misclassification multi-state models in msmbayes

Rendered frommisclass.Rmdusingknitr::rmarkdownon Apr 12 2026.

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

Semi-Markov models with msmbayes

Rendered fromsemimarkov.Rmdusingknitr::rmarkdownon Apr 12 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 data"test (i.e. -1 0). 1 1-2 10 180 2 2-1 50 a age and are Baseline covariates, data, days defined female, For for hazard In in infsim infsim2 intensities is log male mean model negative negative" of on positive" positive. ratios simulation sojourn state state. The the time transition transition, transition. used using with `age10=` `age10`
(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
Sojourn probability in a state of a msmbayes modelsoj_prob
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