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
DESCRIPTION |NEWS
card.svg |card.png
msmbayes/json (API)

# 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.17 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-arm64WARNING482
linux-devel-x86_64WARNING489
source / vignettesOK675
linux-release-arm64OK469
linux-release-x86_64OK494
macos-release-arm64OK288
macos-release-x86_64OK1017
macos-oldrel-arm64OK373
macos-oldrel-x86_64OK1315
windows-develWARNING424
windows-releaseOK556
windows-oldrelOK566
wasm-releaseFAIL164

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

Semi-Markov models with msmbayes
Phase-type shape-scale distributions | Implementation in msmbayes | Specifying a basic semi-Markov model | Summarising shape parameters | Choice of priors | Comparing the Gamma and Weibull | Sojourn distribution | Specifying a semi-Markov model with covariates | Time acceleration factors | Outputs from fitted models by covariates | Semi-Markov models with competing risks | Summarising covariate effect parameters | Summarising outputs by covariates

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

Advanced phase-type models in msmbayes
Phase-type semi-Markov models | Fitting phase-type models in msmbayes | Example: data simulated from a standard Markov model | Example: data simulated from a phase-type model

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

Misclassification multi-state models in msmbayes
Multi-state models with misclassification | Specifiying prior distributions for misclassification probabilities | Fixed misclassification probabilities

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

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