Skip to main content

gen_surv

Coverage Docs

gen_surv is a Python package for simulating survival data under a variety of models, inspired by the R package genSurv. It supports data generation for:

  • Cox Proportional Hazards Models (CPHM)
  • Continuous-Time Markov Models (CMM)
  • Time-Dependent Covariate Models (TDCM)
  • Time-Homogeneous Hidden Markov Models (THMM)

📦 Installation

poetry install

✨ Features

  • Consistent interface across models
  • Censoring support (uniform or exponential)
  • Easy integration with pandas and NumPy
  • Suitable for benchmarking survival algorithms and teaching

🧪 Example

from gen_surv.cphm import gen_cphm

df = gen_cphm(
    n=100,
    model_cens="uniform",
    cens_par=1.0,
    beta=0.5,
    covar=2.0
)
print(df.head())

🔧 Available Generators

Function Description
gen_cphm() Cox Proportional Hazards Model
gen_cmm() Continuous-Time Multi-State Markov Model
gen_tdcm() Time-Dependent Covariate Model
gen_thmm() Time-Homogeneous Markov Model
genSurvPy/
├── gen_surv/             # Pacote principal
│   ├── __main__.py       # Interface CLI via python -m
│   ├── cphm.py
│   ├── cmm.py
│   ├── tdcm.py
│   ├── thmm.py
│   ├── censoring.py
│   ├── bivariate.py
│   ├── validate.py
│
├── tests/                # Testes automatizados
│   ├── test_cphm.py
│   ├── test_cmm.py
│   ├── test_tdcm.py
│   ├── test_thmm.py
│
├── examples/             # Exemplos de uso
│   ├── run_cphm.py
│   ├── ...
│
├── pyproject.toml        # Configurado com Poetry
├── README.md
├── LICENSE
├── .gitignore

🧠 License

MIT License. See LICENSE for details.

Download files

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

Source Distribution

gen_surv-0.6.1.tar.gz (6.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

gen_surv-0.6.1-py3-none-any.whl (10.4 kB view details)

Uploaded Python 3

File details

Details for the file gen_surv-0.6.1.tar.gz.

File metadata

  • Download URL: gen_surv-0.6.1.tar.gz
  • Upload date:
  • Size: 6.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.0.0 CPython/3.9.13 Darwin/24.4.0

File hashes

Hashes for gen_surv-0.6.1.tar.gz
Algorithm Hash digest
SHA256 b5efebacab4dc60280988b6a70e3b05a6a54225dbcd10b9b5eee844ecd5f8119
MD5 1164bf485e003ae6c071dc44bd06880c
BLAKE2b-256 8d0fd124a335cca6bbe80d4445884904e1c0aae9cdd6c9bfb05f3cc113cea387

See more details on using hashes here.

File details

Details for the file gen_surv-0.6.1-py3-none-any.whl.

File metadata

  • Download URL: gen_surv-0.6.1-py3-none-any.whl
  • Upload date:
  • Size: 10.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.0.0 CPython/3.9.13 Darwin/24.4.0

File hashes

Hashes for gen_surv-0.6.1-py3-none-any.whl
Algorithm Hash digest
SHA256 73d4782532af1e0cc4ce24f7802b627945e282283e2a41330bcfba6c93dd9329
MD5 b92446b5a40efd6f448649b50aaf6027
BLAKE2b-256 8d11976cd9ea173b79bf95872159c02ae21e35ba33e2c2b0040bbc1a605e838b

See more details on using hashes here.

Release history Release notifications | RSS feed

3.1.2

2 files

3.1.1

2 files

3.1.0

2 files

3.0.0

2 files

2.1.0

2 files

2.0.1

2 files

2.0.0

2 files

1.3.0

2 files

1.2.0

2 files

1.0.8

2 files

1.0.7

2 files

1.0.5

2 files

1.0.3

2 files

0.7.4

2 files

0.7.2

2 files

0.7.1

2 files

0.6.9

2 files

0.6.7

2 files

0.6.6

2 files

0.6.3

2 files

This release

0.6.1 This release

2 files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page