Skip to main content

An implementation of a few weighted statistics

Project description

Weighted statistics

What?

We've re-implemented some weighted statistics inspired by the weights R package (https://github.com/cran/weights/tree/master). At the moment, it's just the weighted t-test, but this may expand.

How?

import numpy as np
from wstats import wtd_t_test

# Example data for testing
x = np.random.normal(0, 1, 100)
y = np.random.normal(0.5, 1, 100)
wx = np.random.rand(100)
wy = np.random.rand(100)

# Execute tests
# Without bootstrapping
result_no_boot = wtd_t_test(x, y, wx, wy, alternative="two-sided", bootse=False)
# With bootstrapping
result_boot = wtd_t_test(x, y, wx, wy, alternative="two-sided", bootse=True, bootn=int(1e4))

(result_no_boot, result_boot)

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

wstats-0.0.99.tar.gz (3.4 kB view details)

Uploaded Source

Built Distribution

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

wstats-0.0.99-py3-none-any.whl (5.2 kB view details)

Uploaded Python 3

File details

Details for the file wstats-0.0.99.tar.gz.

File metadata

  • Download URL: wstats-0.0.99.tar.gz
  • Upload date:
  • Size: 3.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.11.5

File hashes

Hashes for wstats-0.0.99.tar.gz
Algorithm Hash digest
SHA256 ec7c53ac903f884bcc2fbd7d3c1150cee3177fdbf38c27486beb21825e01d5ce
MD5 ff5cfc0b3ecd5f77bcdc83c13b60ddf7
BLAKE2b-256 5d51c33b36e1b6234371c5d10c0fcf6fd580bfce7d7483b57fdcc9aa98a33079

See more details on using hashes here.

File details

Details for the file wstats-0.0.99-py3-none-any.whl.

File metadata

  • Download URL: wstats-0.0.99-py3-none-any.whl
  • Upload date:
  • Size: 5.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.11.5

File hashes

Hashes for wstats-0.0.99-py3-none-any.whl
Algorithm Hash digest
SHA256 b557daa4da40dcec7016feec110ca643d6b5101627563e3d6af050965dd88d45
MD5 54ae65290cc8deff1b293135fe7ed79a
BLAKE2b-256 28c676b2d9f6115fe2fa4fcf6d0f651a1d3844f34374c71aa6dc3cc9a59242dd

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