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
Release history Release notifications | RSS feed
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)
Built Distribution
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
Algorithm | Hash digest | |
---|---|---|
SHA256 | ec7c53ac903f884bcc2fbd7d3c1150cee3177fdbf38c27486beb21825e01d5ce |
|
MD5 | ff5cfc0b3ecd5f77bcdc83c13b60ddf7 |
|
BLAKE2b-256 | 5d51c33b36e1b6234371c5d10c0fcf6fd580bfce7d7483b57fdcc9aa98a33079 |
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
Algorithm | Hash digest | |
---|---|---|
SHA256 | b557daa4da40dcec7016feec110ca643d6b5101627563e3d6af050965dd88d45 |
|
MD5 | 54ae65290cc8deff1b293135fe7ed79a |
|
BLAKE2b-256 | 28c676b2d9f6115fe2fa4fcf6d0f651a1d3844f34374c71aa6dc3cc9a59242dd |