Econometrics
Author : Tran Minh Tam
Installation
You can install the package via pip:
pip install econometrics_python
Linear Regression
A simple econometrics package for linear regression and plotting.
Run with the package Linear Regression
python LinearRegression/run_regression.py linear_regression.csv
hoặc python -m LinearRegression.run_regression linear_regression.csv
To get the values of the model's parameters
import statsmodels.api as sm
import pandas as pd
# Giả sử bạn có một DataFrame data với cột 'X' và 'Y'
data = pd.read_csv("linear_regression.csv", sep=';') # Đọc dữ liệu từ CSV
X = data['X']
y = data['Y']
# Thêm một cột intercept (hệ số tự do) vào X
X = sm.add_constant(X)
# Huấn luyện mô hình OLS
model = sm.OLS(y, X).fit()
# Trích xuất các giá trị từ kết quả mô hình
print(model.summary()) # Hiển thị tóm tắt kết quả
# Truy xuất các giá trị cụ thể
slope = model.params[1] # Hệ số góc (slope)
intercept = model.params[0] # Hệ số chặn (intercept)
r_squared = model.rsquared # R-squared
p_values = model.pvalues # P-values của các hệ số
# Hiển thị các giá trị trích xuất
print(f"Slope: {slope}")
print(f"Intercept: {intercept}")
print(f"R-squared: {r_squared}")
print(f"P-values: {p_values}")
Multiple Linear Regression
Run with the package Multiple Linear Regression
python MultipleRegression/run_regression.py <data_file.csv> <target_column_name>
Example:
python MultipleRegression/run_regression.py du_lieu_2_bien_doc_lap.csv Giá
Time Series Regression
Run TSR with LSTM model
Chạy câu lệnh : python TimeSeriesRegression\run_lstm.py time_series_data.csv (Bạn thay tên time_series_data.csv bằng tên file data của bạn nhé!)
Release files for econometrics-python 1.0.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| econometrics-python-1.0.2.tar.gz | 15.9 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| econometrics_python-1.0.2-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 34.3 kB
Release files / econometrics-python-1.0.2.tar.gz
| Download URL | econometrics-python-1.0.2.tar.gz |
|---|---|
| Size | 15.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
0416b9e515c19134fd2f0ce847d0f9b3b98830749e24c628bb6034a03aa8fee0
|
|
BLAKE2b-256 checksum How to use checksums |
9bf1b4c919ec95ec1fd5145b1b4a1597d707c7583e77562851cd9cc586bad734
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.10.0
|
Release files / econometrics_python-1.0.2-py3-none-any.whl
| Download URL | econometrics_python-1.0.2-py3-none-any.whl |
|---|---|
| Size | 18.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
bb8e59671c3c03dfc4c00385e4ce018101210bb524f70879519a78a1e6ebd73e
|
|
BLAKE2b-256 checksum How to use checksums |
e2edec4bb51ce5dca8c52e27d8fe929d398f1b6fb1a06eec98cafb0aff1bd199
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.10.0
|