Package for econometric.
Project description
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é!)
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
econometrics-python-1.0.2.tar.gz
(15.9 kB
view details)
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 econometrics-python-1.0.2.tar.gz.
File metadata
- Download URL: econometrics-python-1.0.2.tar.gz
- Upload date:
- Size: 15.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.10.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0416b9e515c19134fd2f0ce847d0f9b3b98830749e24c628bb6034a03aa8fee0
|
|
| MD5 |
02faa40cb95e9e9ee3e4e0fec730af03
|
|
| BLAKE2b-256 |
9bf1b4c919ec95ec1fd5145b1b4a1597d707c7583e77562851cd9cc586bad734
|
File details
Details for the file econometrics_python-1.0.2-py3-none-any.whl.
File metadata
- Download URL: econometrics_python-1.0.2-py3-none-any.whl
- Upload date:
- Size: 18.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.10.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
bb8e59671c3c03dfc4c00385e4ce018101210bb524f70879519a78a1e6ebd73e
|
|
| MD5 |
cafebff025f0f38ec94adeac13e885b8
|
|
| BLAKE2b-256 |
e2edec4bb51ce5dca8c52e27d8fe929d398f1b6fb1a06eec98cafb0aff1bd199
|