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

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.0.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.0-py3-none-any.whl (7.8 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: robustbase_py_optimized-0.1.0.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.0.tar.gz
Algorithm Hash digest
SHA256 c31e5adcedec90d79bb87d88b252960372219da1907552d5aa068f644225a83b
MD5 f93365a05af22d8043b73d91a2796db6
BLAKE2b-256 7191bb42e29e611e92caee9e7cf8f090d4a2ca0747cb779a16339207473cc397

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for robustbase_py_optimized-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 ad5150622a4fffe98f1f39b3433cb78fb5dd54156a765f72e88dd887cfcd58ad
MD5 97ef940453cee32c30fbaf823e6336df
BLAKE2b-256 e7b244eacf5b3b9d4e9e534e4d6732e1e9ed9467fd1ff925ea89fa30cbbd4815

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