BudiajiMatrix
BudiajiMatrix adalah library Python untuk pengolahan matrix yang lengkap dan mudah digunakan. Cocok untuk keperluan analisis time series, GSTAR, VARIMA, dan berbagai analisis statistik lainnya.
🚀 Fitur Utama
- Operasi Dasar: Penjumlahan, pengurangan, perkalian, pembagian matrix
- Dekomposisi: Cholesky, QR, LU, SVD, Eigendecomposition, Schur
- Nilai Karakteristik: Determinant, trace, rank, norm, condition number, eigenvalues, eigenvectors
- Properti Matrix: Cek simetris, positif definit, orthogonal, singular, diagonal
- Statistik: Mean, variance, standard deviation, covariance, correlation
- Normalisasi: Normalisasi baris/kolom, standardisasi
- Solving Systems: Linear system solver, least squares
- Matrix Power: Pangkat, exponential, logarithm, square root
- Dan banyak lagi!
📦 Instalasi
pip install budiajimatrix
💡 Cara Penggunaan
Import Library
import numpy as np
from budiajimatrix import transpose, multiply, eigenvalues, inverse, covariance
Contoh Penggunaan Dasar
import numpy as np
from budiajimatrix import transpose, multiply, add
# Buat matrix
A = np.array([[1, 2], [3, 4]])
B = np.array([[5, 6], [7, 8]])
# Transpose
print("Transpose A:")
print(transpose(A))
# Output:
# [[1 3]
# [2 4]]
# Perkalian matrix
print("A × B:")
print(multiply(A, B))
# Output:
# [[19 22]
# [43 50]]
# Penjumlahan
print("A + B:")
print(add(A, B))
# Output:
# [[ 6 8]
# [10 12]]
Eigenvalues dan Eigenvectors
from budiajimatrix import eigenvalues, eigenvectors
A = np.array([[4, 2], [1, 3]])
# Hitung eigenvalues (akar ciri)
eig_vals = eigenvalues(A)
print("Eigenvalues:", eig_vals)
# Hitung eigenvectors (vektor ciri)
eig_vecs = eigenvectors(A)
print("Eigenvectors:")
print(eig_vecs)
Dekomposisi Matrix
from budiajimatrix import svd, qr_decomposition, cholesky
# Singular Value Decomposition
A = np.array([[1, 2], [3, 4], [5, 6]])
U, S, Vt = svd(A)
print("U:", U)
print("S:", S)
print("Vt:", Vt)
# QR Decomposition
A = np.array([[12, -51, 4], [6, 167, -68], [-4, 24, -41]])
Q, R = qr_decomposition(A)
print("Q:", Q)
print("R:", R)
# Cholesky (untuk matrix positif definit)
A = np.array([[4, 12], [12, 37]])
L = cholesky(A)
print("L:", L)
Statistik Matrix
from budiajimatrix import covariance, correlation, mean, std
# Data matrix (observasi × variabel)
data = np.array([[1, 2, 3],
[4, 5, 6],
[7, 8, 9],
[10, 11, 12]])
# Covariance matrix
cov_matrix = covariance(data)
print("Covariance Matrix:")
print(cov_matrix)
# Correlation matrix
corr_matrix = correlation(data)
print("Correlation Matrix:")
print(corr_matrix)
# Mean per kolom
print("Mean:", mean(data, axis=0))
# Standard deviation per kolom
print("Std:", std(data, axis=0))
Normalisasi dan Standardisasi
from budiajimatrix import standardize, normalize_rows
data = np.array([[1, 2, 3],
[4, 5, 6],
[7, 8, 9]])
# Standardisasi (mean=0, std=1)
standardized = standardize(data)
print("Standardized:")
print(standardized)
# Normalisasi per baris
normalized = normalize_rows(data)
print("Normalized Rows:")
print(normalized)
Properti Matrix
from budiajimatrix import is_symmetric, is_positive_definite, rank, determinant
A = np.array([[2, 1], [1, 2]])
# Cek simetris
print("Symmetric?", is_symmetric(A))
# Cek positif definit
print("Positive Definite?", is_positive_definite(A))
# Rank
print("Rank:", rank(A))
# Determinant
print("Determinant:", determinant(A))
Solving Linear Systems
from budiajimatrix import solve_linear_system, least_squares
# Solve Ax = b
A = np.array([[3, 1], [1, 2]])
b = np.array([9, 8])
x = solve_linear_system(A, b)
print("Solution x:", x)
# Least squares (untuk overdetermined system)
A = np.array([[1, 1], [1, 2], [1, 3]])
b = np.array([2, 3, 4])
x = least_squares(A, b)
print("Least Squares Solution:", x)
📚 Dokumentasi Lengkap
Operasi Dasar
add(matrix1, matrix2)- Penjumlahan matrixsubtract(matrix1, matrix2)- Pengurangan matrixmultiply(matrix1, matrix2)- Perkalian matrixelement_multiply(matrix1, matrix2)- Perkalian elemen per elemenscalar_multiply(matrix, scalar)- Perkalian dengan skalardivide(matrix, scalar)- Pembagian dengan skalar
Transformasi
transpose(matrix)- Transpose matrixinverse(matrix)- Inverse matrixpseudo_inverse(matrix)- Moore-Penrose pseudo-inverseconjugate(matrix)- Konjugat matrixadjoint(matrix)- Adjoint matrix
Dekomposisi
cholesky(matrix)- Dekomposisi Choleskyqr_decomposition(matrix)- Dekomposisi QRlu_decomposition(matrix)- Dekomposisi LUsvd(matrix)- Singular Value Decompositioneigendecomposition(matrix)- Dekomposisi Eigenschur(matrix)- Dekomposisi Schur
Nilai Karakteristik
determinant(matrix)- Determinantrace(matrix)- Tracerank(matrix)- Ranknorm(matrix, ord)- Norm matrixcondition_number(matrix)- Condition numbereigenvalues(matrix)- Eigenvalues (akar ciri)eigenvectors(matrix)- Eigenvectors (vektor ciri)
Properti Matrix
is_symmetric(matrix)- Cek simetrisis_positive_definite(matrix)- Cek positif definitis_orthogonal(matrix)- Cek orthogonalis_singular(matrix)- Cek singularis_diagonal(matrix)- Cek diagonal
Matrix Khusus
identity(n)- Identity matrix n×nzeros(shape)- Matrix nolones(shape)- Matrix satudiagonal(values)- Diagonal matrixrandom_matrix(shape, distribution)- Random matrix
Statistik
mean(matrix, axis)- Meanvariance(matrix, axis)- Variancestd(matrix, axis)- Standard deviationcovariance(matrix)- Covariance matrixcorrelation(matrix)- Correlation matrix
Operasi Baris/Kolom
row_sum(matrix)- Jumlah per bariscol_sum(matrix)- Jumlah per kolomrow_mean(matrix)- Mean per bariscol_mean(matrix)- Mean per kolomnormalize_rows(matrix)- Normalisasi per barisnormalize_cols(matrix)- Normalisasi per kolomstandardize(matrix)- Standardisasi matrix
Solving Systems
solve_linear_system(A, b)- Solve Ax = bleast_squares(A, b)- Least squares solution
Matrix Power
matrix_power(matrix, n)- Matrix pangkat nmatrix_exp(matrix)- Matrix exponentialmatrix_log(matrix)- Matrix logarithmmatrix_sqrt(matrix)- Matrix square root
Distance/Similarity
frobenius_distance(matrix1, matrix2)- Jarak Frobeniuscosine_similarity(vector1, vector2)- Cosine similarity
🛠️ Requirements
- Python >= 3.7
- NumPy >= 1.18.0
- SciPy >= 1.4.0
📝 License
This project is licensed under the MIT License - see the LICENSE file for details.
👨💻 Author
Budi Aji
🤝 Contributing
Contributions, issues, and feature requests are welcome!
⭐ Show your support
Give a ⭐️ if this project helped you!
Metadata
Release files for budiajimatrix 1.0.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| budiajimatrix-1.0.0.tar.gz | 8.0 kB | Without provenance | Details for budiajimatrix-1.0.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| budiajimatrix-1.0.0-py3-none-any.whl | Python 3 | none | any | Details for budiajimatrix-1.0.0-py3-none-any.whl |
Total release size: 16.0 kB
Release files / budiajimatrix-1.0.0.tar.gz
| Download URL | budiajimatrix-1.0.0.tar.gz |
|---|---|
| Size | 8.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
20f1aaf5f48c8598f73f88ee81d47a53463575273987612b5137d9a90dcf78ec
|
|
BLAKE2b-256 checksum How to use checksums |
18618434a13fb18fb3d83fbd194b49d3fcf3bd17c6533739fdbdc2d3d93529fc
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.13.7
|
Release files / budiajimatrix-1.0.0-py3-none-any.whl
| Download URL | budiajimatrix-1.0.0-py3-none-any.whl |
|---|---|
| Size | 7.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
5a51dd55a61f850271f1e84cdb24cdfd56bc90f6c5f41f97b1e402fd57793676
|
|
BLAKE2b-256 checksum How to use checksums |
5a96fa5c680f4be7c668725297220c75f9655235cc63143e282930655294c757
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.13.7
|
Security for budiajimatrix 1.0.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.