Skip to main content

A Python port of the R robustbase package with optimized performance using JAX

Project description

robustbase-py

A Python port of the R robustbase package.

Description

This package implements robust statistical methods, primarily focusing on robust regression (LMROB) as implemented in the R robustbase package. It provides MM-estimators initialized by S-estimators for high breakdown point and efficiency.

Installation

pip install robustbase-py-optimized

Usage

import numpy as np
from robustbase import LMROB

# Generate synthetic data with outliers
n = 100
p = 3
rng = np.random.default_rng(42)
X = rng.standard_normal((n, p))
beta_true = np.array([1.0, 2.0, 0.5])
y = X @ beta_true + rng.standard_normal(n)

# Contaminate data (outliers)
y[:10] = 100.0

# Fit Robust Linear Regression
model = LMROB(method='MM', psi='bisquare')
model.fit(X, y)

print("Estimated Coefficients:", model.coef_)
print("True Coefficients:", beta_true)
print("Robust Scale:", model.scale_)

Features

  • LMROB: MM-estimator regression (S-init).
  • Psi Functions: Bisquare, Huber.
  • Fast-S Algorithm: For robust scale estimation and initialization.

License

GPL-3.0

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

robustbase_py_optimized-0.1.1.tar.gz (10.1 kB view details)

Uploaded Source

Built Distribution

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

robustbase_py_optimized-0.1.1-py3-none-any.whl (7.8 kB view details)

Uploaded Python 3

File details

Details for the file robustbase_py_optimized-0.1.1.tar.gz.

File metadata

  • Download URL: robustbase_py_optimized-0.1.1.tar.gz
  • Upload date:
  • Size: 10.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.3

File hashes

Hashes for robustbase_py_optimized-0.1.1.tar.gz
Algorithm Hash digest
SHA256 f52d783e438e159f00e14bf96f4c1ff8fbdde84c6940055ceffef8fa04012cd3
MD5 83eee1c65546d259d87e5c169a67fd86
BLAKE2b-256 a5f23540cb476e505b8a6b663efb73da9ed44db106763d371ac9a5ff0f685b11

See more details on using hashes here.

File details

Details for the file robustbase_py_optimized-0.1.1-py3-none-any.whl.

File metadata

File hashes

Hashes for robustbase_py_optimized-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 3373fda1ff5d96253b1170844e092e7d87af2ddf8a50081b6eae946459dbce4d
MD5 04c6861984a21641f1f5575a791b6b9b
BLAKE2b-256 a94ced64d9879d328131eb882647d0e96e506c70d6c1e67913b0596371007d72

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