Skip to main content

Pseudo-likelihood Markov random fields for discrete multistate data

Project description

plgpm

Pseudo-likelihood Generalized Potts Model for discrete multistate data.

Installation

pip install plgpm

Quick Start

from plgpm import PLGPM

K_list = [12, 12, 12]
model = PLGPM(K_list)
model.fit(S_train)

pll = model.score_pseudologlik(S_test)
samples = model.sample(n_samples=10000, burn=1000, thin=5)
C = model.coupling_matrix()

Streamlined post-fit analysis

from plgpm import PLGPM, mi, plots

model = PLGPM(obj.components).fit(micro_states)
analysis = model.analyze(
    data_states=micro_states,
    pair=(0, 1),  # optional residue pair for joint probabilities
    sample_kwargs={"n_samples": 50_000, "burn": 5_000, "thin": 10},
)

# Couplings
plots.plot_coupling_heatmap(analysis.coupling)

# Pair joint probabilities (model vs empirical)
plots.plot_probability_heatmap(analysis.pair["prob_model"], title="Model P(x0, x1)")
plots.plot_probability_heatmap(analysis.pair["prob_data"], title="MD P(x0, x1)")

# Pairwise MI agreement (model vs empirical)
mi.plot_mi_comparison(analysis.mi_data, analysis.mi_model, title_prefix="Dialanine Tripeptide: ")
mi.plot_mi_scatter(analysis.mi_data, analysis.mi_model, title="Dialanine Tripeptide: MRF vs MD pairwise MI")
print(analysis.mi_summary)

What this package does

plgpm fits node-conditional multinomial logistic models for discrete graphical modeling and provides coupling summaries, Gibbs sampling, and evaluation utilities.

Project details


Download files

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

Source Distribution

plgpm-0.1.0.tar.gz (12.8 kB view details)

Uploaded Source

Built Distribution

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

plgpm-0.1.0-py3-none-any.whl (12.2 kB view details)

Uploaded Python 3

File details

Details for the file plgpm-0.1.0.tar.gz.

File metadata

  • Download URL: plgpm-0.1.0.tar.gz
  • Upload date:
  • Size: 12.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.7

File hashes

Hashes for plgpm-0.1.0.tar.gz
Algorithm Hash digest
SHA256 be790a80f6a0dae073d6a56d7b7c9a6a9cc975cd5c93a80e878c5830a2f98490
MD5 f02af134dbb501a9f97706307ec30972
BLAKE2b-256 2f1bed24d96c5736c7f4e89aca327aca92ba5b7abdb7acb5f9a8524fa95832db

See more details on using hashes here.

File details

Details for the file plgpm-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: plgpm-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 12.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.7

File hashes

Hashes for plgpm-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 b7b1cdb6a3e5a2d5c7fe595cc3dac8fcf2fbf449a5bfb1889f821e2396932338
MD5 b75419947b3cb6101849ff316338e36f
BLAKE2b-256 3e84b8549810d6673291a937db93df842224077e08818fcdba7ecd00f771e922

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