Math tools for private or personal use.
Project description
StatAssist
StatAssist is a python library that provides statistical and mathematical functions as well as built-in algorithms such as integration and linear regression.
Installation
You can install StatAssist using pip:
pip install StatAssist==1.0.6
Usage
Example 1:
from StatAssist import statistics_ as stats
import matplotlib.pyplot as plt
# Define data
x_data = [0, 1, 2, 3, 4, 5]
y_data = [0, 2, 4, 6, 8, 10]
# Get statistical information
averages = stats.get_means(x_data, y_data)
variances = stats.get_variance([x_data, y_data], averages)
covariance_xy = stats.get_covariance([x_data, y_data], averages)
correlation = stats.get_correlation_coefficient(covariance_xy, variances[0], variances[1])
# Get linear regression parameters
m = stats.get_linreg_slope(correlation, variances[0], variances[1])
b = stats.ml_linreg_1([x_data, y_data], slope=m)
y_reg = [m*x + b for x in x_data]
# Display plot
plt.scatter(x_data, y_data, color='b')
plt.plot(x_data, y_reg, color='r')
plt.show()
Example 2:
from StatAssist import algorithms_
import matplotlib.pyplot as plt
lin_reg = algorithms_.linear_regression
# Define data
x_data = [0, 1, 2, 3, 4, 5]
y_data = [0, 2, 4, 6, 8, 10]
# Linear regression of data
m, b = lin_reg([x_data, y_data])
y_reg = [m*x + b for x in x_data]
# Display plot
plt.scatter(x_data, y_data, color='b')
plt.plot(x_data, y_reg, color='r')
plt.show()
Contributing
Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.
Please make sure to update tests as appropriate.
Licencse
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file StatAssist-1.0.6.tar.gz.
File metadata
- Download URL: StatAssist-1.0.6.tar.gz
- Upload date:
- Size: 8.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.0 CPython/3.9.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
36621aeabdaf547644099ae38b171481f95d6a9606f391eb3daf9efb65836c48
|
|
| MD5 |
ffb567cdf70aa7e55ec6cd09ea06b023
|
|
| BLAKE2b-256 |
32daebb05dc8d69d54fa55828199d9be395f9cc94235496f0ac23fec1e2e9641
|
File details
Details for the file StatAssist-1.0.6-py3-none-any.whl.
File metadata
- Download URL: StatAssist-1.0.6-py3-none-any.whl
- Upload date:
- Size: 9.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.0 CPython/3.9.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e0045b7d6011ef98cd32b76776e4afe182e45b9dd1c2e5c132c1888806fe63a7
|
|
| MD5 |
0e262f8bd904c984c3773e1f27579c65
|
|
| BLAKE2b-256 |
e4b7bc1fdcd4ea73711621d22f2e38ef33036b3550cac4ab6fd8d42aba01f0b2
|