Skip to main content

R-style probability functions for Python with high-performance C linear regression

Project description

rthon

R-style probability functions for Python, providing familiar statistical distribution functions with R-compatible interfaces.

Features

Currently supports these probability distributions:

  • Normal Distribution: dnorm, pnorm, qnorm, rnorm
  • Uniform Distribution: dunif, punif, qunif, runif
  • Binomial Distribution: dbinom, pbinom, qbinom, rbinom
  • Poisson Distribution: dpois, ppois, qpois, rpois
  • Exponential Distribution: dexp, pexp, qexp, rexp
  • Gamma Distribution: dgamma, pgamma, qgamma, rgamma

TODO:

  • Implement the lm() function, which uses the QR decomposition (WIP)
    • It does something, but is very wrong. Maybe look into using basic numpy functions
    • or vibe code some C/C++ functions, starting with very basic building blocks

Installation

pip install rthon

Quick Start

from rprob import dnorm, pnorm, qnorm, rnorm

# Normal distribution examples
dnorm(0)        # PDF at x=0
pnorm(1.96)     # CDF at x=1.96
qnorm(0.975)    # Quantile for p=0.975
rnorm(10)       # 10 random samples

# All functions support R-style parameters
pnorm(1.96, lower_tail=False, log=True)
dnorm([0, 1, 2], mean=1, sd=2)

License

MIT License

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

rthon-0.4.0.tar.gz (36.5 kB view details)

Uploaded Source

Built Distribution

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

rthon-0.4.0-cp310-cp310-macosx_11_0_arm64.whl (44.3 kB view details)

Uploaded CPython 3.10macOS 11.0+ ARM64

File details

Details for the file rthon-0.4.0.tar.gz.

File metadata

  • Download URL: rthon-0.4.0.tar.gz
  • Upload date:
  • Size: 36.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.10.12

File hashes

Hashes for rthon-0.4.0.tar.gz
Algorithm Hash digest
SHA256 cee579b28e772b7549d780dffb3232b2484b94d84dbd8cc9b15939734746e1a8
MD5 3032ada0f8256083401b2e51770abeac
BLAKE2b-256 7f53d48e7b1741d9219ba5e1ab17f4b911530eddc373abed692e20463a7a3a40

See more details on using hashes here.

File details

Details for the file rthon-0.4.0-cp310-cp310-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for rthon-0.4.0-cp310-cp310-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 02371f0266429fa06ecb53a14aa11995ec9ea0bf9da2fe76265cf86699d3f6a4
MD5 0393c861254927585cca1b8d22934993
BLAKE2b-256 d54fb6befecd1264a5ce4b6b45adf973bfc52a325d8d4170f7a7913af03672d5

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