Skip to main content

No project description provided

Project description

PySurvMC

PySurvMC is a Python package designed for Bayesian survival analysis using Markov Chain Monte Carlo (MCMC) methods. This package provides a user-friendly interface to build survival models with left, right, and interval censoring, and allows for the integration of arbitrary prior distributions.

Features

  • Support for Multiple Censoring Types: Handle left, right, and interval-censored data efficiently.
  • Flexible Prior Specification: Users can specify their own prior distributions for model parameters.
  • Built-in Models: Includes common survival models like the proportional hazard and accelerated failure time models.
  • Advanced MCMC Sampling: Utilizes the No-U-Turn Sampler (NUTS), a variant of the Hamiltonian Monte Carlo (HMC), for efficient parameter estimation.

Installation

PySurvMC is available on PyPI and can be installed using pip:

pip install PySurvMC

Usage

Below is a simple example of how to use PySurvMC to fit a Weibull proportional hazard model:

from PySurvMC import WeibullPH
import pymc as pm

# Define priors
priors = {
    "coeff": pm.Normal.dist(mu=0, sigma=100, shape=len(covariates)),
    "shape": pm.HalfNormal.dist(sigma=100),
    "scale": pm.HalfNormal.dist(sigma=100)
}

# Initialize model
weiph = WeibullPH(lb=lb, ub=ub, event=event, covariates=covariates, priors=priors)

# Fit model
weiph_mcmc.fit(draws=10000, cores=8)

Documentation

For more detailed documentation, please visit our GitHub repository.

Examples

The package includes examples and a detailed simulation study that evaluates its performance against frequentist approaches, as well as a real-world case study using the North Central Cancer Treatment Group Lung cancer dataset.

Contributing

Contributions to PySurvMC are welcome! Please read our contribution guidelines on our GitHub repository to get started.

License

Distributed under the MIT License. See LICENSE for more information.

Authors

  • [Yueht23] - Initial work - GitHub

Acknowledgments

  • Thanks to the contributors of the PyMC libraries which are extensively used in this project.

Project details


Release history Release notifications | RSS feed

This version

1.0

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pysurvmc-1.0.tar.gz (2.5 kB view details)

Uploaded Source

File details

Details for the file pysurvmc-1.0.tar.gz.

File metadata

  • Download URL: pysurvmc-1.0.tar.gz
  • Upload date:
  • Size: 2.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.11.9

File hashes

Hashes for pysurvmc-1.0.tar.gz
Algorithm Hash digest
SHA256 08f6650e8155c46bc3700e103310974b63ec0c0241252d42beb7a74da21250c4
MD5 81afe19b1ad8a919dd6b0cf87aa3e035
BLAKE2b-256 07b32acbcfcf33e4d0546be44007330597e9512765950c66d7f582901f79a397

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page