├── 运行结果 └── 运行细节.txt ├── data ├── 测试数据.xlsx ├── 运行细节.txt ├── output.xlsx └── Sup_wald_lag.xlsx ├── pyqt5界面 ├── uic.bat ├── GUI │ ├── images │ │ ├── 122.bmp │ │ ├── 206.bmp │ │ ├── 324.bmp │ │ ├── 400.bmp │ │ ├── 406.bmp │ │ ├── 704.bmp │ │ ├── 724.bmp │ │ └── 728.bmp │ ├── res.qrc │ ├── MainWindow.h │ ├── MainWindow.cpp │ ├── GUI.pro │ └── MainWindow.ui ├── child_GUI │ ├── Qtapp │ │ ├── image │ │ │ ├── 122.bmp │ │ │ ├── 212.bmp │ │ │ ├── 704.bmp │ │ │ ├── 706.bmp │ │ │ └── 724.bmp │ │ ├── test.cpp │ │ ├── icon.qrc │ │ ├── read_data.cpp │ │ ├── main.cpp │ │ ├── read_data.h │ │ ├── QVAR.cpp │ │ ├── QVAR.h │ │ ├── read_data.ui │ │ ├── .gitignore │ │ ├── Qtapp.pro │ │ ├── test.ui │ │ └── QVAR.ui │ ├── read_data.ui │ ├── ui_read_data.py │ ├── read_windows.py │ ├── QVAR_windows.py │ ├── ui_QVAR.py │ └── QVAR.ui ├── icon_rc.py ├── res_rc.py ├── ui_MainWindow.py └── MainWindow.ui ├── .gitattributes ├── beauty_UI.py ├── LICENSE ├── .gitignore ├── main.py ├── README.md └── func.py /运行结果/运行细节.txt: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /data/测试数据.xlsx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lei940324/Quantile/HEAD/data/测试数据.xlsx -------------------------------------------------------------------------------- /data/运行细节.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lei940324/Quantile/HEAD/data/运行细节.txt -------------------------------------------------------------------------------- /data/output.xlsx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lei940324/Quantile/HEAD/data/output.xlsx -------------------------------------------------------------------------------- /pyqt5界面/uic.bat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lei940324/Quantile/HEAD/pyqt5界面/uic.bat -------------------------------------------------------------------------------- /data/Sup_wald_lag.xlsx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lei940324/Quantile/HEAD/data/Sup_wald_lag.xlsx -------------------------------------------------------------------------------- /pyqt5界面/GUI/images/122.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lei940324/Quantile/HEAD/pyqt5界面/GUI/images/122.bmp -------------------------------------------------------------------------------- /pyqt5界面/GUI/images/206.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lei940324/Quantile/HEAD/pyqt5界面/GUI/images/206.bmp -------------------------------------------------------------------------------- /pyqt5界面/GUI/images/324.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lei940324/Quantile/HEAD/pyqt5界面/GUI/images/324.bmp -------------------------------------------------------------------------------- /pyqt5界面/GUI/images/400.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lei940324/Quantile/HEAD/pyqt5界面/GUI/images/400.bmp -------------------------------------------------------------------------------- /pyqt5界面/GUI/images/406.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lei940324/Quantile/HEAD/pyqt5界面/GUI/images/406.bmp -------------------------------------------------------------------------------- /pyqt5界面/GUI/images/704.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lei940324/Quantile/HEAD/pyqt5界面/GUI/images/704.bmp -------------------------------------------------------------------------------- /pyqt5界面/GUI/images/724.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lei940324/Quantile/HEAD/pyqt5界面/GUI/images/724.bmp -------------------------------------------------------------------------------- /pyqt5界面/GUI/images/728.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lei940324/Quantile/HEAD/pyqt5界面/GUI/images/728.bmp -------------------------------------------------------------------------------- /pyqt5界面/child_GUI/Qtapp/image/122.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lei940324/Quantile/HEAD/pyqt5界面/child_GUI/Qtapp/image/122.bmp -------------------------------------------------------------------------------- /pyqt5界面/child_GUI/Qtapp/image/212.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lei940324/Quantile/HEAD/pyqt5界面/child_GUI/Qtapp/image/212.bmp -------------------------------------------------------------------------------- /pyqt5界面/child_GUI/Qtapp/image/704.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lei940324/Quantile/HEAD/pyqt5界面/child_GUI/Qtapp/image/704.bmp -------------------------------------------------------------------------------- /pyqt5界面/child_GUI/Qtapp/image/706.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lei940324/Quantile/HEAD/pyqt5界面/child_GUI/Qtapp/image/706.bmp -------------------------------------------------------------------------------- /pyqt5界面/child_GUI/Qtapp/image/724.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lei940324/Quantile/HEAD/pyqt5界面/child_GUI/Qtapp/image/724.bmp -------------------------------------------------------------------------------- /pyqt5界面/child_GUI/Qtapp/test.cpp: -------------------------------------------------------------------------------- 1 | #include "test.h" 2 | #include "ui_test.h" 3 | 4 | test::test(QWidget *parent) : 5 | QMainWindow(parent), 6 | ui(new Ui::test) 7 | { 8 | ui->setupUi(this); 9 | } 10 | 11 | test::~test() 12 | { 13 | delete ui; 14 | } 15 | -------------------------------------------------------------------------------- /pyqt5界面/child_GUI/Qtapp/icon.qrc: -------------------------------------------------------------------------------- 1 | 2 | 3 | image/704.bmp 4 | image/706.bmp 5 | image/122.bmp 6 | image/212.bmp 7 | image/724.bmp 8 | 9 | 10 | -------------------------------------------------------------------------------- /pyqt5界面/child_GUI/Qtapp/read_data.cpp: -------------------------------------------------------------------------------- 1 | #include "read_data.h" 2 | #include "ui_MainWindow.h" 3 | 4 | MainWindow::MainWindow(QWidget *parent) 5 | : QMainWindow(parent) 6 | , ui(new Ui::MainWindow) 7 | { 8 | ui->setupUi(this); 9 | } 10 | 11 | MainWindow::~MainWindow() 12 | { 13 | delete ui; 14 | } 15 | 16 | -------------------------------------------------------------------------------- /pyqt5界面/child_GUI/Qtapp/main.cpp: -------------------------------------------------------------------------------- 1 | #include "read_data.h" 2 | 3 | #include 4 | 5 | int main(int argc, char *argv[]) 6 | { 7 | #if (QT_VERSION >= QT_VERSION_CHECK(5,9,0)) 8 | QApplication::setAttribute(Qt::AA_EnableHighDpiScaling); 9 | #endif 10 | QApplication a(argc, argv); 11 | MainWindow w; 12 | w.show(); 13 | return a.exec(); 14 | } 15 | -------------------------------------------------------------------------------- /pyqt5界面/GUI/res.qrc: -------------------------------------------------------------------------------- 1 | 2 | 3 | images/122.bmp 4 | images/724.bmp 5 | images/728.bmp 6 | images/704.bmp 7 | images/324.bmp 8 | images/400.bmp 9 | images/206.bmp 10 | images/406.bmp 11 | 12 | 13 | -------------------------------------------------------------------------------- /pyqt5界面/child_GUI/Qtapp/read_data.h: -------------------------------------------------------------------------------- 1 | #ifndef MAINWINDOW_H 2 | #define MAINWINDOW_H 3 | 4 | #include 5 | 6 | QT_BEGIN_NAMESPACE 7 | namespace Ui { class MainWindow; } 8 | QT_END_NAMESPACE 9 | 10 | class MainWindow : public QMainWindow 11 | { 12 | Q_OBJECT 13 | 14 | public: 15 | MainWindow(QWidget *parent = nullptr); 16 | ~MainWindow(); 17 | 18 | private: 19 | Ui::MainWindow *ui; 20 | }; 21 | #endif // MAINWINDOW_H 22 | -------------------------------------------------------------------------------- /pyqt5界面/child_GUI/Qtapp/QVAR.cpp: -------------------------------------------------------------------------------- 1 | #include "QVAR.h" 2 | #include "ui_QVAR.h" 3 | 4 | QVAR::QVAR(QWidget *parent) : 5 | QMainWindow(parent), 6 | ui(new Ui::QVAR) 7 | { 8 | ui->setupUi(this); 9 | } 10 | 11 | QVAR::~QVAR() 12 | { 13 | delete ui; 14 | } 15 | 16 | void QVAR::on_pushButton_clicked() 17 | { 18 | 19 | } 20 | 21 | void QVAR::on_pushButton_2_clicked() 22 | { 23 | 24 | } 25 | 26 | void QVAR::on_pushButton_3_clicked() 27 | { 28 | 29 | } 30 | -------------------------------------------------------------------------------- /pyqt5界面/child_GUI/Qtapp/QVAR.h: -------------------------------------------------------------------------------- 1 | #ifndef QVAR_H 2 | #define QVAR_H 3 | 4 | #include 5 | 6 | namespace Ui { 7 | class QVAR; 8 | } 9 | 10 | class QVAR : public QMainWindow 11 | { 12 | Q_OBJECT 13 | 14 | public: 15 | explicit QVAR(QWidget *parent = nullptr); 16 | ~QVAR(); 17 | 18 | private slots: 19 | void on_pushButton_clicked(); 20 | 21 | void on_pushButton_2_clicked(); 22 | 23 | void on_pushButton_3_clicked(); 24 | 25 | private: 26 | Ui::QVAR *ui; 27 | }; 28 | 29 | #endif // QVAR_H 30 | -------------------------------------------------------------------------------- /pyqt5界面/child_GUI/read_data.ui: -------------------------------------------------------------------------------- 1 | 2 | 3 | MainWindow 4 | 5 | 6 | 查看数据 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /pyqt5界面/child_GUI/Qtapp/read_data.ui: -------------------------------------------------------------------------------- 1 | 2 | 3 | MainWindow 4 | 5 | 6 | 查看数据 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /.gitattributes: -------------------------------------------------------------------------------- 1 | # Basic .gitattributes for a python repo. 2 | 3 | # Source files 4 | # ============ 5 | *.pxd text diff=python 6 | *.py text diff=python 7 | *.py3 text diff=python 8 | *.pyw text diff=python 9 | *.pyx text diff=python 10 | *.pyz text diff=python 11 | 12 | # Binary files 13 | # ============ 14 | *.db binary 15 | *.p binary 16 | *.pkl binary 17 | *.pickle binary 18 | *.pyc binary 19 | *.pyd binary 20 | *.pyo binary 21 | 22 | # Jupyter notebook 23 | *.ipynb text 24 | 25 | # Note: .db, .p, and .pkl files are associated 26 | # with the python modules ``pickle``, ``dbm.*``, 27 | # ``shelve``, ``marshal``, ``anydbm``, & ``bsddb`` 28 | # (among others). 29 | 30 | -------------------------------------------------------------------------------- /pyqt5界面/GUI/MainWindow.h: -------------------------------------------------------------------------------- 1 | #ifndef MAINWINDOW_H 2 | #define MAINWINDOW_H 3 | 4 | #include 5 | 6 | QT_BEGIN_NAMESPACE 7 | namespace Ui { class MainWindow; } 8 | QT_END_NAMESPACE 9 | 10 | class MainWindow : public QMainWindow 11 | { 12 | Q_OBJECT 13 | 14 | public: 15 | MainWindow(QWidget *parent = nullptr); 16 | ~MainWindow(); 17 | 18 | private slots: 19 | void on_action_triggered(); 20 | 21 | void on_action_2_triggered(); 22 | 23 | void on_action_3_triggered(); 24 | 25 | void on_action_4_triggered(); 26 | 27 | void on_doubleSpinBox_valueChanged(double arg1); 28 | 29 | void on_pushButton_clicked(); 30 | 31 | void on_action_5_triggered(); 32 | 33 | void on_action_6_triggered(); 34 | 35 | void on_actionQVAR_triggered(); 36 | 37 | private: 38 | Ui::MainWindow *ui; 39 | }; 40 | #endif // MAINWINDOW_H 41 | -------------------------------------------------------------------------------- /pyqt5界面/GUI/MainWindow.cpp: -------------------------------------------------------------------------------- 1 | #include "MainWindow.h" 2 | #include "ui_MainWindow.h" 3 | 4 | MainWindow::MainWindow(QWidget *parent) 5 | : QMainWindow(parent) 6 | , ui(new Ui::MainWindow) 7 | { 8 | ui->setupUi(this); 9 | } 10 | 11 | MainWindow::~MainWindow() 12 | { 13 | delete ui; 14 | } 15 | 16 | 17 | void MainWindow::on_action_triggered() 18 | { 19 | 20 | } 21 | 22 | void MainWindow::on_action_2_triggered() 23 | { 24 | 25 | } 26 | 27 | void MainWindow::on_action_3_triggered() 28 | { 29 | 30 | } 31 | 32 | void MainWindow::on_action_4_triggered() 33 | { 34 | 35 | } 36 | 37 | void MainWindow::on_doubleSpinBox_valueChanged(double arg1) 38 | { 39 | 40 | } 41 | 42 | void MainWindow::on_pushButton_clicked() 43 | { 44 | 45 | } 46 | 47 | void MainWindow::on_action_5_triggered() 48 | { 49 | 50 | } 51 | 52 | void MainWindow::on_action_6_triggered() 53 | { 54 | 55 | } 56 | 57 | void MainWindow::on_actionQVAR_triggered() 58 | { 59 | 60 | } 61 | -------------------------------------------------------------------------------- /beauty_UI.py: -------------------------------------------------------------------------------- 1 | from PyQt5 import QtCore, QtGui 2 | from PyQt5.QtCore import Qt 3 | from PyQt5.QtGui import QPalette 4 | 5 | def beauty(obj): 6 | obj.setWindowOpacity(0.9) # 设置窗口透明度 7 | # obj.setWindowFlag(QtCore.Qt.FramelessWindowHint) # 隐藏边框 8 | # 美化界面 9 | edit_style = ''' 10 | QWidget{ 11 | width:100px; 12 | border-radius:10px; 13 | padding:2px 4px; 14 | } 15 | ''' 16 | obj.setStyleSheet(edit_style) 17 | 18 | # 设置圆形按钮 19 | obj.ui.pushButton_2.setStyleSheet('''QPushButton{background:#F76677;border-radius:5px;} 20 | QPushButton:hover{background:red;}''') 21 | obj.ui.pushButton_3.setStyleSheet('''QPushButton{background:#F7D674;border-radius:5px;} 22 | QPushButton:hover{background:yellow;}''') 23 | obj.ui.pushButton_4.setStyleSheet('''QPushButton{background:#6DDF6D;border-radius:5px;} 24 | QPushButton:hover{background:green;}''') 25 | 26 | # 设置生成区间按钮 27 | obj.ui.pushButton.setStyleSheet('''QPushButton{border:1px solid gray;border-radius:5px}''') 28 | 29 | 30 | 31 | 32 | -------------------------------------------------------------------------------- /pyqt5界面/child_GUI/Qtapp/.gitignore: -------------------------------------------------------------------------------- 1 | # This file is used to ignore files which are generated 2 | # ---------------------------------------------------------------------------- 3 | 4 | *~ 5 | *.autosave 6 | *.a 7 | *.core 8 | *.moc 9 | *.o 10 | *.obj 11 | *.orig 12 | *.rej 13 | *.so 14 | *.so.* 15 | *_pch.h.cpp 16 | *_resource.rc 17 | *.qm 18 | .#* 19 | *.*# 20 | core 21 | !core/ 22 | tags 23 | .DS_Store 24 | .directory 25 | *.debug 26 | Makefile* 27 | *.prl 28 | *.app 29 | moc_*.cpp 30 | ui_*.h 31 | qrc_*.cpp 32 | Thumbs.db 33 | *.res 34 | *.rc 35 | /.qmake.cache 36 | /.qmake.stash 37 | 38 | # qtcreator generated files 39 | *.pro.user* 40 | 41 | # xemacs temporary files 42 | *.flc 43 | 44 | # Vim temporary files 45 | .*.swp 46 | 47 | # Visual Studio generated files 48 | *.ib_pdb_index 49 | *.idb 50 | *.ilk 51 | *.pdb 52 | *.sln 53 | *.suo 54 | *.vcproj 55 | *vcproj.*.*.user 56 | *.ncb 57 | *.sdf 58 | *.opensdf 59 | *.vcxproj 60 | *vcxproj.* 61 | 62 | # MinGW generated files 63 | *.Debug 64 | *.Release 65 | 66 | # Python byte code 67 | *.pyc 68 | 69 | # Binaries 70 | # -------- 71 | *.dll 72 | *.exe 73 | 74 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2020 热心市民石头 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /pyqt5界面/GUI/GUI.pro: -------------------------------------------------------------------------------- 1 | QT += core gui 2 | 3 | greaterThan(QT_MAJOR_VERSION, 4): QT += widgets 4 | 5 | CONFIG += c++11 6 | 7 | # The following define makes your compiler emit warnings if you use 8 | # any Qt feature that has been marked deprecated (the exact warnings 9 | # depend on your compiler). Please consult the documentation of the 10 | # deprecated API in order to know how to port your code away from it. 11 | DEFINES += QT_DEPRECATED_WARNINGS 12 | 13 | # You can also make your code fail to compile if it uses deprecated APIs. 14 | # In order to do so, uncomment the following line. 15 | # You can also select to disable deprecated APIs only up to a certain version of Qt. 16 | #DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0x060000 # disables all the APIs deprecated before Qt 6.0.0 17 | 18 | SOURCES += \ 19 | main.cpp \ 20 | MainWindow.cpp 21 | 22 | HEADERS += \ 23 | MainWindow.h 24 | 25 | FORMS += \ 26 | MainWindow.ui 27 | 28 | # Default rules for deployment. 29 | qnx: target.path = /tmp/$${TARGET}/bin 30 | else: unix:!android: target.path = /opt/$${TARGET}/bin 31 | !isEmpty(target.path): INSTALLS += target 32 | 33 | RESOURCES += \ 34 | res.qrc 35 | -------------------------------------------------------------------------------- /pyqt5界面/child_GUI/Qtapp/Qtapp.pro: -------------------------------------------------------------------------------- 1 | QT += core gui 2 | 3 | greaterThan(QT_MAJOR_VERSION, 4): QT += widgets 4 | 5 | CONFIG += c++11 6 | 7 | # The following define makes your compiler emit warnings if you use 8 | # any Qt feature that has been marked deprecated (the exact warnings 9 | # depend on your compiler). Please consult the documentation of the 10 | # deprecated API in order to know how to port your code away from it. 11 | DEFINES += QT_DEPRECATED_WARNINGS 12 | 13 | # You can also make your code fail to compile if it uses deprecated APIs. 14 | # In order to do so, uncomment the following line. 15 | # You can also select to disable deprecated APIs only up to a certain version of Qt. 16 | #DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0x060000 # disables all the APIs deprecated before Qt 6.0.0 17 | 18 | SOURCES += \ 19 | QVAR.cpp \ 20 | main.cpp \ 21 | read_data.cpp 22 | 23 | HEADERS += \ 24 | QVAR.h \ 25 | read_data.h 26 | 27 | FORMS += \ 28 | QVAR.ui \ 29 | read_data.ui 30 | 31 | # Default rules for deployment. 32 | qnx: target.path = /tmp/$${TARGET}/bin 33 | else: unix:!android: target.path = /opt/$${TARGET}/bin 34 | !isEmpty(target.path): INSTALLS += target 35 | 36 | RESOURCES += \ 37 | icon.qrc 38 | -------------------------------------------------------------------------------- /pyqt5界面/child_GUI/ui_read_data.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | 3 | # Form implementation generated from reading ui file '.\child_GUI\read_data.ui' 4 | # 5 | # Created by: PyQt5 UI code generator 5.10 6 | # 7 | # WARNING! All changes made in this file will be lost! 8 | 9 | from PyQt5 import QtCore, QtGui, QtWidgets 10 | 11 | class Ui_MainWindow(object): 12 | def setupUi(self, MainWindow): 13 | MainWindow.setObjectName("MainWindow") 14 | self.centralwidget = QtWidgets.QWidget(MainWindow) 15 | self.centralwidget.setObjectName("centralwidget") 16 | self.horizontalLayout = QtWidgets.QHBoxLayout(self.centralwidget) 17 | self.horizontalLayout.setObjectName("horizontalLayout") 18 | self.tableWidget = QtWidgets.QTableWidget(self.centralwidget) 19 | self.tableWidget.setObjectName("tableWidget") 20 | self.tableWidget.setColumnCount(0) 21 | self.tableWidget.setRowCount(0) 22 | self.horizontalLayout.addWidget(self.tableWidget) 23 | MainWindow.setCentralWidget(self.centralwidget) 24 | 25 | self.retranslateUi(MainWindow) 26 | QtCore.QMetaObject.connectSlotsByName(MainWindow) 27 | 28 | def retranslateUi(self, MainWindow): 29 | _translate = QtCore.QCoreApplication.translate 30 | MainWindow.setWindowTitle(_translate("MainWindow", "查看数据")) 31 | 32 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Byte-compiled / optimized / DLL files 2 | __pycache__/ 3 | *.ini 4 | *.py[cod] 5 | *$py.class 6 | 7 | # C extensions 8 | *.so 9 | 10 | # Distribution / packaging 11 | .Python 12 | build/ 13 | develop-eggs/ 14 | dist/ 15 | downloads/ 16 | eggs/ 17 | .eggs/ 18 | lib/ 19 | lib64/ 20 | parts/ 21 | sdist/ 22 | var/ 23 | wheels/ 24 | pip-wheel-metadata/ 25 | share/python-wheels/ 26 | *.egg-info/ 27 | .installed.cfg 28 | *.egg 29 | MANIFEST 30 | 31 | # PyInstaller 32 | # Usually these files are written by a python script from a template 33 | # before PyInstaller builds the exe, so as to inject date/other infos into it. 34 | *.manifest 35 | *.spec 36 | 37 | # Installer logs 38 | pip-log.txt 39 | pip-delete-this-directory.txt 40 | 41 | # Unit test / coverage reports 42 | htmlcov/ 43 | .tox/ 44 | .nox/ 45 | .coverage 46 | .coverage.* 47 | .cache 48 | nosetests.xml 49 | coverage.xml 50 | *.cover 51 | *.py,cover 52 | .hypothesis/ 53 | .pytest_cache/ 54 | cover/ 55 | 56 | # Translations 57 | *.mo 58 | *.pot 59 | 60 | # Django stuff: 61 | *.log 62 | local_settings.py 63 | db.sqlite3 64 | db.sqlite3-journal 65 | 66 | # Flask stuff: 67 | instance/ 68 | .webassets-cache 69 | 70 | # Scrapy stuff: 71 | .scrapy 72 | 73 | # Sphinx documentation 74 | docs/_build/ 75 | 76 | # PyBuilder 77 | .pybuilder/ 78 | target/ 79 | 80 | # Jupyter Notebook 81 | .ipynb_checkpoints 82 | 83 | # IPython 84 | profile_default/ 85 | ipython_config.py 86 | 87 | # pyenv 88 | # For a library or package, you might want to ignore these files since the code is 89 | # intended to run in multiple environments; otherwise, check them in: 90 | # .python-version 91 | 92 | # pipenv 93 | # According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control. 94 | # However, in case of collaboration, if having platform-specific dependencies or dependencies 95 | # having no cross-platform support, pipenv may install dependencies that don't work, or not 96 | # install all needed dependencies. 97 | #Pipfile.lock 98 | 99 | # PEP 582; used by e.g. github.com/David-OConnor/pyflow 100 | __pypackages__/ 101 | 102 | # Celery stuff 103 | celerybeat-schedule 104 | celerybeat.pid 105 | 106 | # SageMath parsed files 107 | *.sage.py 108 | 109 | # Environments 110 | .env 111 | .venv 112 | env/ 113 | venv/ 114 | ENV/ 115 | env.bak/ 116 | venv.bak/ 117 | 118 | # Spyder project settings 119 | .spyderproject 120 | .spyproject 121 | 122 | # Rope project settings 123 | .ropeproject 124 | 125 | # mkdocs documentation 126 | /site 127 | 128 | # mypy 129 | .mypy_cache/ 130 | .dmypy.json 131 | dmypy.json 132 | 133 | # Pyre type checker 134 | .pyre/ 135 | 136 | # pytype static type analyzer 137 | .pytype/ 138 | 139 | # Cython debug symbols 140 | cython_debug/ -------------------------------------------------------------------------------- /pyqt5界面/child_GUI/read_windows.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | 3 | import sys 4 | import numpy as np 5 | from PyQt5.QtWidgets import QApplication, QMainWindow, QTableWidgetItem 6 | from PyQt5.QtCore import Qt 7 | 8 | ##from PyQt5.QtCore import pyqtSlot,pyqtSignal,Qt 9 | 10 | ##from PyQt5.QtWidgets import 11 | 12 | ##from PyQt5.QtGui import 13 | 14 | ##from PyQt5.QtSql import 15 | 16 | ##from PyQt5.QtMultimedia import 17 | 18 | ##from PyQt5.QtMultimediaWidgets import 19 | 20 | 21 | from pyqt5界面.child_GUI.ui_read_data import Ui_MainWindow 22 | # from ui_read_data import Ui_MainWindow 23 | 24 | class read_Window(QMainWindow): 25 | 26 | def __init__(self, parent=None): 27 | super().__init__(parent) # 调用父类构造函数,创建窗体 28 | self.ui=Ui_MainWindow() # 创建UI对象 29 | self.ui.setupUi(self) # 构造UI界面 30 | self.setGeometry(400, 150, 700, 600) 31 | 32 | ## ==============自定义功能函数======================== 33 | def display(self, input_table): 34 | self.ui.tableWidget.setAlternatingRowColors(True) # 设置交替行背景颜色 35 | ###===========读取表格,转换表格,=========================================== 36 | input_table_rows = input_table.shape[0] 37 | input_table_colunms = input_table.shape[1] 38 | input_table_header = input_table.columns.values.tolist() 39 | 40 | ###===========读取表格,转换表格,============================================ 41 | ###======================给tablewidget设置行列表头============================ 42 | 43 | self.ui.tableWidget.setColumnCount(input_table_colunms) 44 | self.ui.tableWidget.setRowCount(input_table_rows) 45 | self.ui.tableWidget.setHorizontalHeaderLabels(input_table_header) 46 | 47 | ###================遍历表格每个元素,同时添加到tablewidget中======================== 48 | for i in range(input_table_rows): 49 | input_table_rows_values = input_table.iloc[[i]] 50 | input_table_rows_values_array = np.array(input_table_rows_values) 51 | input_table_rows_values_list = input_table_rows_values_array.tolist()[0] 52 | for j in range(input_table_colunms): 53 | input_table_items_list = input_table_rows_values_list[j] 54 | 55 | ###==============将遍历的元素添加到tablewidget中并显示======================= 56 | 57 | input_table_items = str(input_table_items_list) 58 | newItem = QTableWidgetItem(input_table_items) 59 | newItem.setTextAlignment(Qt.AlignHCenter | Qt.AlignVCenter) 60 | self.ui.tableWidget.setItem(i, j, newItem) 61 | 62 | 63 | ## ==============event处理函数========================== 64 | 65 | 66 | ## ==========由connectSlotsByName()自动连接的槽函数============ 67 | 68 | 69 | ## =============自定义槽函数=============================== 70 | 71 | 72 | 73 | ## ============窗体测试程序 ================================ 74 | if __name__ == "__main__": #用于当前窗体测试 75 | 76 | import pandas as pd 77 | df = pd.read_excel(r'..\data\测试数据.xlsx') 78 | df = df.drop(df.columns[0], axis=1) 79 | 80 | 81 | app = QApplication(sys.argv) #创建GUI应用程序 82 | form=read_Window() #创建窗体 83 | form.display(df) 84 | form.show() 85 | sys.exit(app.exec_()) 86 | -------------------------------------------------------------------------------- /pyqt5界面/child_GUI/QVAR_windows.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | 3 | import sys 4 | import pandas as pd 5 | from PyQt5.QtWidgets import QApplication, QMainWindow 6 | from PyQt5.QtCore import pyqtSlot 7 | from func import Quantile_Granger 8 | 9 | ##from PyQt5.QtCore import pyqtSlot,pyqtSignal,Qt 10 | 11 | # from PyQt5.QtWidgets import 12 | 13 | # from PyQt5.QtGui import 14 | 15 | # from PyQt5.QtSql import 16 | 17 | # from PyQt5.QtMultimedia import 18 | 19 | # from PyQt5.QtMultimediaWidgets import 20 | 21 | 22 | from pyqt5界面.child_GUI.ui_QVAR import Ui_QVAR 23 | 24 | 25 | class QVAR(QMainWindow): 26 | 27 | def __init__(self, QVARdata, parent=None): 28 | super().__init__(parent) # 调用父类构造函数,创建窗体 29 | self.QVARdata = QVARdata 30 | 31 | self.ui = Ui_QVAR() # 创建UI对象 32 | self.ui.setupUi(self) # 构造UI界面 33 | self.resize(400, 300) 34 | 35 | self.quantile = [self.ui.doubleSpinBox, self.ui.doubleSpinBox_2, self.ui.doubleSpinBox_3, self.ui.doubleSpinBox_4, self.ui.doubleSpinBox_5, self.ui.doubleSpinBox_6, self.ui.doubleSpinBox_7, 36 | self.ui.doubleSpinBox_8, self.ui.doubleSpinBox_9, self.ui.doubleSpinBox_10] 37 | self.init_parameter() 38 | 39 | # ==============自定义功能函数======================== 40 | def init_parameter(self): 41 | # 初始化各参数 42 | for widget in self.quantile[5:]: # 后五个默认不可见 43 | widget.setVisible(False) 44 | for widget in self.quantile: # 设置步长 45 | widget.setSingleStep(0.05) 46 | self.ui.doubleSpinBox.setValue(0.1) 47 | self.ui.doubleSpinBox_2.setValue(0.25) 48 | self.ui.doubleSpinBox_3.setValue(0.5) 49 | self.ui.doubleSpinBox_4.setValue(0.75) 50 | self.ui.doubleSpinBox_5.setValue(0.9) 51 | self.ui.spinBox.setValue(1) 52 | self.ui.spinBox_2.setValue(1) 53 | 54 | # ==========由connectSlotsByName()自动连接的槽函数============ 55 | @pyqtSlot() 56 | def on_pushButton_clicked(self): # 添加按钮 57 | for widget in self.quantile: 58 | if not widget.isVisible(): 59 | widget.setVisible(True) 60 | break 61 | 62 | @pyqtSlot() 63 | def on_pushButton_2_clicked(self): # 减少按钮 64 | for widget in self.quantile[::-1]: 65 | if widget.isVisible(): 66 | widget.setValue(0) 67 | widget.setVisible(False) 68 | break 69 | 70 | @pyqtSlot() 71 | def on_pushButton_3_clicked(self): # 开始运行按钮 72 | Granger = Quantile_Granger() 73 | # 获取参数 74 | p = self.ui.spinBox.value() 75 | q = self.ui.spinBox_2.value() 76 | quantiles = [x.value() for x in self.quantile if x.value() != 0] 77 | for key in self.QVARdata: 78 | relation = key 79 | X = self.QVARdata[key].iloc[:, 0] 80 | Y = self.QVARdata[key].iloc[:, 1] 81 | data = Granger.lag_list(Y, X, p, q) 82 | print(data) 83 | 84 | 85 | # ============窗体测试程序 ================================ 86 | if __name__ == "__main__": # 用于当前窗体测试 87 | import pandas as pd 88 | df = pd.read_excel(r'..\data\测试数据.xlsx') 89 | df = df.drop(df.columns[0], axis=1) 90 | 91 | app = QApplication(sys.argv) # 创建GUI应用程序 92 | form = QVAR(df) # 创建窗体 93 | form.show() 94 | sys.exit(app.exec_()) 95 | -------------------------------------------------------------------------------- /pyqt5界面/icon_rc.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | 3 | # Resource object code 4 | # 5 | # Created by: The Resource Compiler for PyQt5 (Qt v5.10.0) 6 | # 7 | # WARNING! All changes made in this file will be lost! 8 | 9 | from PyQt5 import QtCore 10 | 11 | qt_resource_data = b"\ 12 | \x00\x00\x00\x9a\ 13 | \x00\ 14 | \x00\x04\x36\x78\x9c\xcd\x93\xc1\x09\x80\x30\x0c\x00\x23\x38\x80\ 15 | \x23\xf8\xf4\x2f\x38\x80\x7f\xd7\x70\x8e\xae\xd1\x6d\x3a\x40\x76\ 16 | \xaa\x49\xd3\x4a\x04\xc5\x36\xf8\xb0\x70\x58\xa9\x77\x14\xad\xeb\ 17 | \xb6\xf4\x90\xc6\x42\x4c\xc4\x90\xe9\x60\x94\x85\xbc\xae\x47\x8c\ 18 | \xf1\x77\x38\xe7\x68\x67\xfe\xa4\xdd\xc5\x8b\xdf\xd2\x10\x17\xcd\ 19 | \x0d\x7a\xa3\xcf\x0d\xff\xde\x10\xff\xa6\x41\x2e\x20\xda\x1a\xc5\ 20 | \x2d\x54\x37\x9c\x3c\xcf\xf7\x4c\x6b\x23\xbb\x3c\x0f\x21\x7c\xdb\ 21 | \x20\xd7\xcf\x75\xe7\x57\x37\x92\x4f\x2e\xee\x50\xed\xeb\x06\x5f\ 22 | \xd9\x2d\xb4\x9c\x4d\x76\x23\x7d\x0a\xc6\xe2\x33\x69\xcf\xaa\x61\ 23 | \xf9\xbf\x74\xe3\x00\xe4\xf7\x5d\x9b\ 24 | \x00\x00\x00\x60\ 25 | \x00\ 26 | \x00\x04\x36\x78\x9c\x73\xf2\x35\x63\x61\x00\x03\x33\x20\xd6\x00\ 27 | \x62\x01\x28\x66\x64\x50\x80\x48\x40\xe5\x91\xc1\xff\xff\xff\x47\ 28 | \x31\x14\x33\xcc\x64\x20\x0a\xe3\xd4\x7b\x06\x0b\x9e\x89\x44\xe3\ 29 | \x31\x03\x2c\xfe\x9f\x78\x33\x70\xda\x4f\xa4\x19\x78\xed\x27\xc2\ 30 | \x0c\x9c\xfa\x89\x31\x03\x87\xfe\x99\xff\x67\x12\x6d\x06\x2e\xfd\ 31 | \x44\x99\x81\x2f\x0e\xc9\x8c\xff\xa1\x8a\x01\xdf\xe2\x18\x72\ 32 | \x00\x00\x00\x63\ 33 | \x00\ 34 | \x00\x04\x36\x78\x9c\x73\xf2\x35\x63\x61\x00\x03\x33\x20\xd6\x00\ 35 | \x62\x01\x28\x66\x64\x50\x80\x48\x40\xe5\x91\xc1\xff\xff\xff\x07\ 36 | \x15\x66\x38\x03\x74\x54\x1a\x79\xee\x02\xeb\x9d\x09\xc5\x24\x9a\ 37 | \x81\xa2\x97\x44\x33\xb0\xea\x25\xc1\x0c\x74\x77\x63\x98\x47\xc0\ 38 | \x0c\xb8\x7a\x24\x75\xa4\x98\x81\x2b\xcc\x49\x75\x07\x51\x61\x33\ 39 | \x18\xcc\xa0\x34\x7d\x91\xa9\x9f\xd2\xf4\x4d\x0b\x0c\x00\x26\xbe\ 40 | \x67\xef\ 41 | \x00\x00\x00\x96\ 42 | \x00\ 43 | \x00\x04\x36\x78\x9c\xdd\x92\xc1\x09\x80\x30\x0c\x45\x2b\x38\x80\ 44 | \x23\x78\xf4\x2e\x74\x00\xef\xae\xd1\x9d\xb2\x53\x76\xaa\xf9\xda\ 45 | \x40\xa8\xb5\x2d\x5e\x04\x0b\x0f\x03\xf9\x3f\xf9\x56\xb7\xdd\x8f\ 46 | \xee\x3c\x5e\x58\x84\x29\x31\xb8\xf9\x6a\xa4\xbe\x3d\x31\xc6\xcf\ 47 | \x59\x89\x9d\x0b\xd4\x45\x60\xbe\x79\x01\x49\x1d\xb8\x8e\xee\x29\ 48 | \xf9\xd1\xc7\x8c\x1a\xd0\xc0\x0f\xfd\x5b\x3f\xf2\xdb\x0c\xea\xd5\ 49 | \x77\x68\xf9\xf1\xb4\x19\xd4\x8f\xb9\xa0\xc7\x6f\x33\xd8\xbb\x43\ 50 | \xcd\x52\x3f\x41\xa6\xce\xfd\x76\x46\x0f\xd0\xaa\x9f\x0b\x59\x4b\ 51 | \xfb\xf3\x6f\x67\xef\x30\xd7\x96\x76\xb6\xfe\xc1\x5e\xed\x9f\x38\ 52 | \x00\x46\xd3\x80\x70\ 53 | \x00\x00\x00\x5d\ 54 | \x00\ 55 | \x00\x04\x36\x78\x9c\x73\xf2\x35\x63\x61\x00\x03\x33\x20\xd6\x00\ 56 | \x62\x01\x28\x66\x64\x50\x80\x48\x40\xe5\x91\xc1\xff\xff\xff\x87\ 57 | \x3c\x06\xfa\x02\x88\x67\xc2\x31\xa9\x6a\x20\x72\x67\x90\x30\x69\ 58 | \xf2\xf8\xd4\x10\xa3\x17\x9f\x19\xc4\xea\xc5\x6d\x06\xf1\x7a\x49\ 59 | \xf1\x2f\x2d\xec\xa7\xc4\xff\x94\x84\x3f\xa5\xf1\x0f\x91\x47\x60\ 60 | \xdc\xee\xc3\xaf\x66\x20\x30\x00\x62\xb8\x33\x24\ 61 | " 62 | 63 | qt_resource_name = b"\ 64 | \x00\x04\ 65 | \x00\x06\xfa\x5e\ 66 | \x00\x69\ 67 | \x00\x63\x00\x6f\x00\x6e\ 68 | \x00\x05\ 69 | \x00\x70\x37\xd5\ 70 | \x00\x69\ 71 | \x00\x6d\x00\x61\x00\x67\x00\x65\ 72 | \x00\x07\ 73 | \x05\x45\x49\x20\ 74 | \x00\x32\ 75 | \x00\x31\x00\x32\x00\x2e\x00\x62\x00\x6d\x00\x70\ 76 | \x00\x07\ 77 | \x0a\x57\x49\x20\ 78 | \x00\x37\ 79 | \x00\x32\x00\x34\x00\x2e\x00\x62\x00\x6d\x00\x70\ 80 | \x00\x07\ 81 | \x0a\x37\x49\x20\ 82 | \x00\x37\ 83 | \x00\x30\x00\x34\x00\x2e\x00\x62\x00\x6d\x00\x70\ 84 | \x00\x07\ 85 | \x04\x55\x49\x20\ 86 | \x00\x31\ 87 | \x00\x32\x00\x32\x00\x2e\x00\x62\x00\x6d\x00\x70\ 88 | \x00\x07\ 89 | \x0a\x39\x49\x20\ 90 | \x00\x37\ 91 | \x00\x30\x00\x36\x00\x2e\x00\x62\x00\x6d\x00\x70\ 92 | " 93 | 94 | qt_resource_struct_v1 = b"\ 95 | \x00\x00\x00\x00\x00\x02\x00\x00\x00\x01\x00\x00\x00\x01\ 96 | \x00\x00\x00\x00\x00\x02\x00\x00\x00\x01\x00\x00\x00\x02\ 97 | \x00\x00\x00\x0e\x00\x02\x00\x00\x00\x05\x00\x00\x00\x03\ 98 | \x00\x00\x00\x5a\x00\x01\x00\x00\x00\x01\x00\x00\x01\x69\ 99 | \x00\x00\x00\x1e\x00\x01\x00\x00\x00\x01\x00\x00\x00\x00\ 100 | \x00\x00\x00\x46\x00\x01\x00\x00\x00\x01\x00\x00\x01\x02\ 101 | \x00\x00\x00\x6e\x00\x01\x00\x00\x00\x01\x00\x00\x02\x03\ 102 | \x00\x00\x00\x32\x00\x01\x00\x00\x00\x01\x00\x00\x00\x9e\ 103 | " 104 | 105 | qt_resource_struct_v2 = b"\ 106 | \x00\x00\x00\x00\x00\x02\x00\x00\x00\x01\x00\x00\x00\x01\ 107 | \x00\x00\x00\x00\x00\x00\x00\x00\ 108 | \x00\x00\x00\x00\x00\x02\x00\x00\x00\x01\x00\x00\x00\x02\ 109 | \x00\x00\x00\x00\x00\x00\x00\x00\ 110 | \x00\x00\x00\x0e\x00\x02\x00\x00\x00\x05\x00\x00\x00\x03\ 111 | \x00\x00\x00\x00\x00\x00\x00\x00\ 112 | \x00\x00\x00\x5a\x00\x01\x00\x00\x00\x01\x00\x00\x01\x69\ 113 | \x00\x00\x01\x58\xd1\xf5\x73\x0e\ 114 | \x00\x00\x00\x1e\x00\x01\x00\x00\x00\x01\x00\x00\x00\x00\ 115 | \x00\x00\x01\x58\xd1\xf6\xb5\x99\ 116 | \x00\x00\x00\x46\x00\x01\x00\x00\x00\x01\x00\x00\x01\x02\ 117 | \x00\x00\x01\x58\xd1\xf0\xff\x76\ 118 | \x00\x00\x00\x6e\x00\x01\x00\x00\x00\x01\x00\x00\x02\x03\ 119 | \x00\x00\x01\x58\xd1\xf1\x11\xbe\ 120 | \x00\x00\x00\x32\x00\x01\x00\x00\x00\x01\x00\x00\x00\x9e\ 121 | \x00\x00\x01\x58\xd1\xf1\xb5\x3d\ 122 | " 123 | 124 | qt_version = QtCore.qVersion().split('.') 125 | if qt_version < ['5', '8', '0']: 126 | rcc_version = 1 127 | qt_resource_struct = qt_resource_struct_v1 128 | else: 129 | rcc_version = 2 130 | qt_resource_struct = qt_resource_struct_v2 131 | 132 | def qInitResources(): 133 | QtCore.qRegisterResourceData(rcc_version, qt_resource_struct, qt_resource_name, qt_resource_data) 134 | 135 | def qCleanupResources(): 136 | QtCore.qUnregisterResourceData(rcc_version, qt_resource_struct, qt_resource_name, qt_resource_data) 137 | 138 | qInitResources() 139 | -------------------------------------------------------------------------------- /pyqt5界面/res_rc.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | 3 | # Resource object code 4 | # 5 | # Created by: The Resource Compiler for PyQt5 (Qt v5.10.0) 6 | # 7 | # WARNING! All changes made in this file will be lost! 8 | 9 | from PyQt5 import QtCore 10 | 11 | qt_resource_data = b"\ 12 | \x00\x00\x00\x63\ 13 | \x00\ 14 | \x00\x04\x36\x78\x9c\x73\xf2\x35\x63\x61\x00\x03\x33\x20\xd6\x00\ 15 | \x62\x01\x28\x66\x64\x50\x80\x48\x40\xe5\x91\xc1\xff\xff\xff\x07\ 16 | \x15\x66\x38\x03\x74\x54\x1a\x79\xee\x02\xeb\x9d\x09\xc5\x24\x9a\ 17 | \x81\xa2\x97\x44\x33\xb0\xea\x25\xc1\x0c\x74\x77\x63\x98\x47\xc0\ 18 | \x0c\xb8\x7a\x24\x75\xa4\x98\x81\x2b\xcc\x49\x75\x07\x51\x61\x33\ 19 | \x18\xcc\xa0\x34\x7d\x91\xa9\x9f\xd2\xf4\x4d\x0b\x0c\x00\x26\xbe\ 20 | \x67\xef\ 21 | \x00\x00\x00\x57\ 22 | \x00\ 23 | \x00\x04\x36\x78\x9c\x73\xf2\x35\x63\x61\x00\x03\x33\x20\xd6\x00\ 24 | \x62\x01\x28\x66\x64\x50\x80\x48\x40\xe5\x91\xc1\xff\xff\xff\x87\ 25 | \x3c\x9e\x69\xcc\x80\x82\x49\x55\x03\xe2\x9f\x49\x43\x60\x52\xe5\ 26 | \xf1\xa9\x21\x46\x2f\x3e\x33\x88\xd5\x8b\xcb\x0c\x52\xf4\x92\xe2\ 27 | \x5f\x5a\xd8\x4f\x89\xff\x29\x09\x7f\x4a\xe3\x9f\xd2\xf4\x37\x90\ 28 | \x18\x00\xcb\x73\x46\x44\ 29 | \x00\x00\x00\x96\ 30 | \x00\ 31 | \x00\x04\x36\x78\x9c\xdd\x92\xc1\x09\x80\x30\x0c\x45\x2b\x38\x80\ 32 | \x23\x78\xf4\x2e\x74\x00\xef\xae\xd1\x9d\xb2\x53\x76\xaa\xf9\xda\ 33 | \x40\xa8\xb5\x2d\x5e\x04\x0b\x0f\x03\xf9\x3f\xf9\x56\xb7\xdd\x8f\ 34 | \xee\x3c\x5e\x58\x84\x29\x31\xb8\xf9\x6a\xa4\xbe\x3d\x31\xc6\xcf\ 35 | \x59\x89\x9d\x0b\xd4\x45\x60\xbe\x79\x01\x49\x1d\xb8\x8e\xee\x29\ 36 | \xf9\xd1\xc7\x8c\x1a\xd0\xc0\x0f\xfd\x5b\x3f\xf2\xdb\x0c\xea\xd5\ 37 | \x77\x68\xf9\xf1\xb4\x19\xd4\x8f\xb9\xa0\xc7\x6f\x33\xd8\xbb\x43\ 38 | \xcd\x52\x3f\x41\xa6\xce\xfd\x76\x46\x0f\xd0\xaa\x9f\x0b\x59\x4b\ 39 | \xfb\xf3\x6f\x67\xef\x30\xd7\x96\x76\xb6\xfe\xc1\x5e\xed\x9f\x38\ 40 | \x00\x46\xd3\x80\x70\ 41 | \x00\x00\x00\x60\ 42 | \x00\ 43 | \x00\x04\x36\x78\x9c\x73\xf2\x35\x63\x61\x00\x03\x33\x20\xd6\x00\ 44 | \x62\x01\x28\x66\x64\x50\x80\x48\x40\xe5\x91\xc1\xff\xff\xff\x47\ 45 | \x31\x14\x33\xcc\x64\x20\x0a\xe3\xd4\x7b\x06\x0b\x9e\x89\x44\xe3\ 46 | \x31\x03\x2c\xfe\x9f\x78\x33\x70\xda\x4f\xa4\x19\x78\xed\x27\xc2\ 47 | \x0c\x9c\xfa\x89\x31\x03\x87\xfe\x99\xff\x67\x12\x6d\x06\x2e\xfd\ 48 | \x44\x99\x81\x2f\x0e\xc9\x8c\xff\xa1\x8a\x01\xdf\xe2\x18\x72\ 49 | \x00\x00\x00\x52\ 50 | \x00\ 51 | \x00\x04\x36\x78\x9c\x73\xf2\x35\x63\x61\x00\x03\x33\x20\xd6\x00\ 52 | \x62\x01\x28\x66\x64\x50\x80\x48\x40\xe5\x91\xc1\xff\xff\xff\x29\ 53 | \xc3\xc6\x0c\xe4\x63\x98\x7e\x7c\x66\x13\x92\x1b\x0e\xfa\x29\x0d\ 54 | \x3f\x64\x7c\x66\x26\x98\x4e\x4b\x23\x42\x0e\xa4\x1f\x2a\x86\x15\ 55 | \x13\x92\x1b\x2c\xe1\x37\xd0\xfa\x87\x70\xfc\x01\x00\x7c\x91\x25\ 56 | \x98\ 57 | \x00\x00\x00\x5e\ 58 | \x00\ 59 | \x00\x04\x36\x78\x9c\x73\xf2\x35\x63\x61\x00\x03\x33\x20\xd6\x00\ 60 | \x62\x01\x28\x66\x64\x50\x80\x48\x40\xe5\x91\xc1\xff\xff\xff\xb1\ 61 | \x63\x63\x06\xe2\x30\x3e\xfd\xb8\xe4\x88\x51\x33\x10\xfa\x89\xf5\ 62 | \x1b\x3e\xfd\x94\x84\x1f\x31\xfa\xcf\xcc\x04\xd3\x69\x69\x04\xec\ 63 | \x87\xaa\xc3\x8b\xb1\xa9\x19\x09\x7e\xa6\x76\x3a\xa3\x34\x9f\x90\ 64 | \xea\x67\x64\x4c\x8e\x9f\x91\x30\x00\x0e\x7d\x2c\xc4\ 65 | \x00\x00\x00\x58\ 66 | \x00\ 67 | \x00\x04\x36\x78\x9c\x73\xf2\x35\x63\x61\x00\x03\x33\x20\xd6\x00\ 68 | \x62\x01\x28\x66\x64\x50\x80\x48\x40\xe5\x91\xc1\xff\xff\xff\x47\ 69 | \x31\x9d\xf0\x99\x99\x69\x0c\x33\x8d\xb1\x87\x39\x48\x1c\x1d\xe3\ 70 | \x52\x07\x32\x87\x90\x7e\x7c\xee\xc0\x26\x4f\xac\x5e\x42\xfa\x71\ 71 | \xc9\x13\xa3\x1f\x97\x79\xc4\xf8\x1f\x9f\x5d\xc8\x98\x14\xbd\x23\ 72 | \x01\x03\x00\x9f\x93\xbc\x67\ 73 | \x00\x00\x00\x5e\ 74 | \x00\ 75 | \x00\x04\x36\x78\x9c\x73\xf2\x35\x63\x61\x00\x03\x33\x20\xd6\x00\ 76 | \x62\x01\x28\x66\x64\x50\x80\x48\x40\xe5\x91\xc1\xff\xff\xff\x47\ 77 | \x31\x14\xcf\x04\x86\x07\x31\x18\x97\xde\x33\x58\xf0\x4c\x24\x1a\ 78 | \x9f\x19\x60\x31\x12\xcc\xc0\x65\x3f\xb1\x66\xe0\xb3\x9f\x18\x33\ 79 | \x70\xe9\x27\xc6\x0c\x9c\xfa\x67\xa6\x11\x6d\x06\x4e\xfd\x44\x98\ 80 | \x81\x2f\x0e\xc9\x8d\xff\xa1\x8a\x01\x68\x5a\x17\xd9\ 81 | " 82 | 83 | qt_resource_name = b"\ 84 | \x00\x05\ 85 | \x00\x6f\xa6\x53\ 86 | \x00\x69\ 87 | \x00\x63\x00\x6f\x00\x6e\x00\x73\ 88 | \x00\x06\ 89 | \x07\x03\x7d\xc3\ 90 | \x00\x69\ 91 | \x00\x6d\x00\x61\x00\x67\x00\x65\x00\x73\ 92 | \x00\x07\ 93 | \x0a\x37\x49\x20\ 94 | \x00\x37\ 95 | \x00\x30\x00\x34\x00\x2e\x00\x62\x00\x6d\x00\x70\ 96 | \x00\x07\ 97 | \x06\x57\x49\x20\ 98 | \x00\x33\ 99 | \x00\x32\x00\x34\x00\x2e\x00\x62\x00\x6d\x00\x70\ 100 | \x00\x07\ 101 | \x04\x55\x49\x20\ 102 | \x00\x31\ 103 | \x00\x32\x00\x32\x00\x2e\x00\x62\x00\x6d\x00\x70\ 104 | \x00\x07\ 105 | \x0a\x57\x49\x20\ 106 | \x00\x37\ 107 | \x00\x32\x00\x34\x00\x2e\x00\x62\x00\x6d\x00\x70\ 108 | \x00\x07\ 109 | \x07\x39\x49\x20\ 110 | \x00\x34\ 111 | \x00\x30\x00\x36\x00\x2e\x00\x62\x00\x6d\x00\x70\ 112 | \x00\x07\ 113 | \x07\x33\x49\x20\ 114 | \x00\x34\ 115 | \x00\x30\x00\x30\x00\x2e\x00\x62\x00\x6d\x00\x70\ 116 | \x00\x07\ 117 | \x05\x39\x49\x20\ 118 | \x00\x32\ 119 | \x00\x30\x00\x36\x00\x2e\x00\x62\x00\x6d\x00\x70\ 120 | \x00\x07\ 121 | \x0a\x5b\x49\x20\ 122 | \x00\x37\ 123 | \x00\x32\x00\x38\x00\x2e\x00\x62\x00\x6d\x00\x70\ 124 | " 125 | 126 | qt_resource_struct_v1 = b"\ 127 | \x00\x00\x00\x00\x00\x02\x00\x00\x00\x01\x00\x00\x00\x01\ 128 | \x00\x00\x00\x00\x00\x02\x00\x00\x00\x01\x00\x00\x00\x02\ 129 | \x00\x00\x00\x10\x00\x02\x00\x00\x00\x08\x00\x00\x00\x03\ 130 | \x00\x00\x00\x4a\x00\x01\x00\x00\x00\x01\x00\x00\x00\xc2\ 131 | \x00\x00\x00\x9a\x00\x01\x00\x00\x00\x01\x00\x00\x02\x78\ 132 | \x00\x00\x00\x36\x00\x01\x00\x00\x00\x01\x00\x00\x00\x67\ 133 | \x00\x00\x00\x86\x00\x01\x00\x00\x00\x01\x00\x00\x02\x16\ 134 | \x00\x00\x00\x72\x00\x01\x00\x00\x00\x01\x00\x00\x01\xc0\ 135 | \x00\x00\x00\x22\x00\x01\x00\x00\x00\x01\x00\x00\x00\x00\ 136 | \x00\x00\x00\x5e\x00\x01\x00\x00\x00\x01\x00\x00\x01\x5c\ 137 | \x00\x00\x00\xae\x00\x01\x00\x00\x00\x01\x00\x00\x02\xd4\ 138 | " 139 | 140 | qt_resource_struct_v2 = b"\ 141 | \x00\x00\x00\x00\x00\x02\x00\x00\x00\x01\x00\x00\x00\x01\ 142 | \x00\x00\x00\x00\x00\x00\x00\x00\ 143 | \x00\x00\x00\x00\x00\x02\x00\x00\x00\x01\x00\x00\x00\x02\ 144 | \x00\x00\x00\x00\x00\x00\x00\x00\ 145 | \x00\x00\x00\x10\x00\x02\x00\x00\x00\x08\x00\x00\x00\x03\ 146 | \x00\x00\x00\x00\x00\x00\x00\x00\ 147 | \x00\x00\x00\x4a\x00\x01\x00\x00\x00\x01\x00\x00\x00\xc2\ 148 | \x00\x00\x01\x71\x3e\x81\x9e\x82\ 149 | \x00\x00\x00\x9a\x00\x01\x00\x00\x00\x01\x00\x00\x02\x78\ 150 | \x00\x00\x01\x71\x3e\x81\x9e\x83\ 151 | \x00\x00\x00\x36\x00\x01\x00\x00\x00\x01\x00\x00\x00\x67\ 152 | \x00\x00\x01\x71\x3e\x81\x9e\x84\ 153 | \x00\x00\x00\x86\x00\x01\x00\x00\x00\x01\x00\x00\x02\x16\ 154 | \x00\x00\x01\x71\x3e\x81\x9e\x85\ 155 | \x00\x00\x00\x72\x00\x01\x00\x00\x00\x01\x00\x00\x01\xc0\ 156 | \x00\x00\x01\x71\x3f\x18\xbe\x55\ 157 | \x00\x00\x00\x22\x00\x01\x00\x00\x00\x01\x00\x00\x00\x00\ 158 | \x00\x00\x01\x71\x3e\x81\x9e\x85\ 159 | \x00\x00\x00\x5e\x00\x01\x00\x00\x00\x01\x00\x00\x01\x5c\ 160 | \x00\x00\x01\x71\x3e\x81\x9e\x87\ 161 | \x00\x00\x00\xae\x00\x01\x00\x00\x00\x01\x00\x00\x02\xd4\ 162 | \x00\x00\x01\x71\x3e\x81\x9e\x88\ 163 | " 164 | 165 | qt_version = QtCore.qVersion().split('.') 166 | if qt_version < ['5', '8', '0']: 167 | rcc_version = 1 168 | qt_resource_struct = qt_resource_struct_v1 169 | else: 170 | rcc_version = 2 171 | qt_resource_struct = qt_resource_struct_v2 172 | 173 | def qInitResources(): 174 | QtCore.qRegisterResourceData(rcc_version, qt_resource_struct, qt_resource_name, qt_resource_data) 175 | 176 | def qCleanupResources(): 177 | QtCore.qUnregisterResourceData(rcc_version, qt_resource_struct, qt_resource_name, qt_resource_data) 178 | 179 | qInitResources() 180 | -------------------------------------------------------------------------------- /main.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | 3 | import sys 4 | import pandas as pd 5 | from func import Quantile_Granger, logging 6 | import func 7 | from PyQt5 import QtCore, QtGui 8 | from PyQt5.QtWidgets import QApplication, QMainWindow, QFileDialog 9 | from PyQt5.QtCore import pyqtSlot, pyqtSignal, QThread 10 | 11 | from beauty_UI import beauty 12 | from pyqt5界面.ui_MainWindow import Ui_MainWindow 13 | from pyqt5界面.child_GUI.read_windows import read_Window 14 | from pyqt5界面.child_GUI.QVAR_windows import QVAR 15 | 16 | 17 | class Runthread(QThread): 18 | # 通过类成员对象定义信号对象 19 | _signal = pyqtSignal(str) 20 | 21 | def __init__(self, form): 22 | super(Runthread, self).__init__() 23 | self.form = form 24 | 25 | def __del__(self): 26 | self.wait() 27 | 28 | def run(self): 29 | form = self.form 30 | # 加载参数 31 | start = form.ui.doubleSpinBox.value() # 区间起点 32 | end = form.ui.doubleSpinBox_2.value() # 区间终点 33 | num = form.ui.spinBox.value() # 区间个数 34 | sign = form.ui.comboBox_2.currentText() # 模式选择 35 | max_lag = int(form.ui.comboBox.currentText()) # 最大滞后阶数选择,默认为5 36 | info_type = form.ui.comboBox_3.currentText() # 信息准则选择 37 | WaldNum = form.ui.spinBox_3.value() # 估计wald个数,默认1000个 38 | sign_num = int(form.ui.comboBox_4.currentText()) # 有效数字,默认为3 39 | AicNum = form.ui.spinBox_2.value() # 估计各区间最优滞后阶数,默认50个 40 | # 开始计算 41 | qrange, qr_name = form.func.set_range(start, end, num) 42 | DataList = form.func.pattern(form.df, sign) 43 | INFO = [self._signal.emit] 44 | if form.ui.checkBox_2.isChecked(): 45 | INFO.append(logging.info) 46 | form.func.calculate(DataList, qrange, qr_name, 47 | max_lag, info_type, WaldNum, sign_num, AicNum, objects=INFO) 48 | 49 | 50 | class QmyMainWindow(QMainWindow): 51 | 52 | def __init__(self, parent=None): 53 | super().__init__(parent) # 调用父类构造函数,创建窗体 54 | self.ui = Ui_MainWindow() # 创建UI对象 55 | self.ui.setupUi(self) # 构造UI界面 56 | self.resize(700, 700) 57 | 58 | beauty(self) # 美化界面 59 | self.func = Quantile_Granger() # 导入主函数 60 | self.init_parameter() # 初始化各参数 61 | # 默认导入测试数据 62 | self.df = pd.read_excel(r'.\data\测试数据.xlsx') 63 | self.df = self.df.drop(self.df.columns[0], axis=1) 64 | 65 | # ==============自定义功能函数======================== 66 | def init_parameter(self): 67 | ''' 68 | 初始化各参数 69 | ''' 70 | self.ui.doubleSpinBox.setValue(0.1) # 区间起点为0.1 71 | self.ui.doubleSpinBox.setSingleStep(0.01) 72 | self.ui.doubleSpinBox_2.setValue(0.9) # 区间终点为0.9 73 | self.ui.doubleSpinBox_2.setSingleStep(0.01) 74 | self.ui.spinBox.setValue(17) # 个数默认为17个 75 | self.ui.spinBox_2.setValue(30) # 滞后估计数默认30个 76 | self.ui.spinBox_3.setMinimum(10) 77 | self.ui.spinBox_3.setMaximum(1500) # 设置上界 78 | self.ui.spinBox_3.setValue(1000) # 设置估计wald的个数为1000 79 | self.ui.textEdit.setText( 80 | ' '*20+'使用说明:\n1.点击导入数据按钮加载xlsx数据;\n2.进行参数设定,具体参数信息请参见README.md文件;\n3.点击开始运行按钮,程序开始计算') 81 | self.ui.lineEdit.setText( 82 | '[0.10-0.15]、[0.15-0.20]...[0.50-0.55]...[0.80-0.85]、[0.85-0.90]') 83 | self.ui.checkBox.setChecked(True) # 勾选日期 84 | self.ui.checkBox_2.setChecked(True) # 勾选日志 85 | self.ui.comboBox_4.setCurrentIndex(3) # 设置默认保留三位小数 86 | self.ui.comboBox.setCurrentIndex(4) # 最大阶数默认为5 87 | self.ui.comboBox_3.setCurrentIndex(1) # 信息准则默认为BIC 88 | self.ui.comboBox_2.setCurrentIndex(0) # 模式设定默认为1 89 | 90 | def call_backlog(self, msg): 91 | self.ui.textEdit.append(msg) # 将线程的参数传入 92 | 93 | 94 | # ============================================================================= 95 | # # 当把边框给隐藏掉,边框将无法拖动移动,这个可以通过重写函数来实现。 96 | # def mousePressEvent(self, event): 97 | # if event.button()==QtCore.Qt.LeftButton: 98 | # self.m_flag=True 99 | # self.m_Position=event.globalPos()-self.pos() #获取鼠标相对窗口的位置 100 | # event.accept() 101 | # self.setCursor(QtGui.QCursor(QtCore.Qt.OpenHandCursor)) #更改鼠标图标 102 | # 103 | # def mouseMoveEvent(self, QMouseEvent): 104 | # if QtCore.Qt.LeftButton and self.m_flag: 105 | # self.move(QMouseEvent.globalPos()-self.m_Position)#更改窗口位置 106 | # QMouseEvent.accept() 107 | # 108 | # def mouseReleaseEvent(self, QMouseEvent): 109 | # self.m_flag=False 110 | # self.setCursor(QtGui.QCursor(QtCore.Qt.ArrowCursor)) 111 | # ============================================================================= 112 | 113 | # ==========由connectSlotsByName()自动连接的槽函数============ 114 | @pyqtSlot() 115 | def on_action_triggered(self): # 导入数据按钮 116 | download_path = QFileDialog.getOpenFileName(None, "浏览", None, 117 | "Text Files (*.xlsx);;Text Files (*.xls)") 118 | try: 119 | self.df = pd.read_excel(download_path[0]) 120 | self.ui.textEdit.setText("\n 恭喜,数据读取成功!") 121 | if self.ui.checkBox.isChecked(): 122 | # 判断date是否勾选,如果勾选,删除第一列日期数据 123 | self.df = self.df.drop(self.df.columns[0], axis=1) 124 | except: 125 | self.ui.textEdit.setText("\n 数据读取失败,请重新导入数据!") 126 | 127 | @pyqtSlot() 128 | def on_action_2_triggered(self): # 开始运行按钮 129 | func.EXIT = False 130 | self.ui.textEdit.setText('') 131 | # 创建线程 132 | self.thread = Runthread(self) 133 | # 连接信号 134 | self.thread._signal.connect(self.call_backlog) # 进程连接回传到GUI的事件 135 | # 开始线程 136 | self.thread.start() 137 | 138 | @pyqtSlot() 139 | def on_action_4_triggered(self): # 初始化按钮 140 | self.init_parameter() 141 | self.ui.textEdit.setText( 142 | ' '*20+'使用说明:\n1.点击导入数据按钮加载xlsx数据;\n2.进行参数设定,具体参数信息请参见README.md文件;\n3.点击开始运行按钮,程序开始计算\n\n 初始化成功!') 143 | 144 | @pyqtSlot() 145 | def on_action_3_triggered(self): # 最小化按钮 146 | self.showMinimized() 147 | 148 | @pyqtSlot() 149 | def on_action_5_triggered(self): # 终止运行按钮 150 | func.EXIT = True 151 | 152 | @pyqtSlot() 153 | def on_pushButton_clicked(self): # 生成区间按钮 154 | start = self.ui.doubleSpinBox.value() # 区间起点 155 | end = self.ui.doubleSpinBox_2.value() # 区间终点 156 | num = self.ui.spinBox.value() # 区间个数 157 | _, qr_name = self.func.set_range(start, end, num) 158 | if len(qr_name) > 5: 159 | display = f"{qr_name[0]}、{qr_name[1]}...{qr_name[int(len(qr_name)/2)]}...{qr_name[-2]}、{qr_name[-1]}" 160 | else: 161 | display = '、'.join(qr_name) 162 | self.ui.lineEdit.setText(display) 163 | 164 | @pyqtSlot() 165 | def on_action_6_triggered(self): # 查看数据 166 | read = read_Window(self) 167 | read.display(self.df) 168 | read.show() 169 | 170 | @pyqtSlot() 171 | def on_actionQVAR_triggered(self): # QVAR估计 172 | QVARdata = self.func.pattern(self.df, self.ui.comboBox_2.currentText()) 173 | QVAR_win = QVAR(QVARdata, self) 174 | QVAR_win.show() 175 | 176 | 177 | # ============窗体测试程序 ================================ 178 | if __name__ == "__main__": 179 | app = QApplication(sys.argv) # 创建GUI应用程序 180 | form = QmyMainWindow() # 创建窗体 181 | form.show() 182 | sys.exit(app.exec_()) 183 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | ## Introduction 9 | 10 | ### 功能介绍 11 | 12 | - [x] 分位数 Granger 因果检验:计算各分位区间 Sup-Wald 统计量。 13 | 14 | - [ ] 分位数 VAR 模型估计:自回归分布滞后模型 15 | - [ ] 脉冲响应函数计算 16 | - [ ] 各分位点脉冲图绘制 17 | 18 | ### 代码实现原理 19 | 20 | * 使用`pyqt5`生成 GUI 界面 21 | 22 | * 使用`statsmodels`进行分位数回归 23 | 24 | * 使用`pandas`将结果保存在 excel 文件 25 | 26 | ## Display 27 | 28 | ### 主窗口界面 29 | 30 |
31 | 32 | 33 | 主要包括: 34 | 35 | - **工具栏**: 36 | 37 | * **导入数据**:点击该按钮,选择路径导入数据,如没有导入数据,默认导入测试数据 38 | * **开始运行**:点击后进行分位数 Granger 因果检验,计算 Sup-wald 统计量 39 | 40 | * **终止运行**:点击后终止程序 41 | 42 | * **查看数据**:点击查看导入数据 43 | 44 | * **初始化**:点击后初始化各参数设定 45 | 46 | * **QVAR 估计**:点击后进行 QVAR 模型参数设定 47 | 48 | - **区间设定**:区间**起点、中点、个数**设定以及**生成区间**按钮 49 | 50 | > **注意**:个数是点的个数,比如设定 17 个,则会生成 16 个分位区间 51 | 52 | **例子:** 53 | 54 | 起点=0.1,终点=0.9,个数=2,则会生成区间:[0.1, 0.9] 55 | 56 | 起点=0.1,终点=0.9,个数=3,则会生成区间:[0.1, 0.5]、[0.5, 0.9] 57 | 58 | - **参数设定** 59 | 60 | * **日期**:勾选表示第一列为日期序列,在进行计算 wald 统计量时会将其删除;若取消勾选,则不会删除第一列数据 61 | 62 | * **模式设定**:代表循环模式,默认模式为**单因素对各市场** 63 | 64 | > **注意:数据要根据模式进行相应的排序** 65 | 66 | 假定 p=1,q=2,估计方程形式则为:Y=c1+c2Y-1+c3X-1+c4X-2 67 | 68 | | 模式选择 | 内容说明 | 数据排序 | 计算规则描述 | 69 | | :------------: | :----------------------------------------------------------: | :------------------------------------------------: | :----------------------------------------------------------: | 70 | | 单因素对各市场 | 研究单一因素对各市场的因果关系,比如房价对股票,汇率市场的因果关系 | data=[X,Y1,Y2,Y3] | X 对 Y1回归;X 对 Y2回归;X 对 Y3回归 | 71 | | 相互影响 | 研究两因素之间的因果关系,比如房价与股票,汇率市场的相互因果关系 | data=[X,Y1,Y2,Y3] | X 对 Y1回归;X 对 Y2回归;X 对 Y3回归;Y1对 X 回归;Y1对 Y2回归;Y1对 Y3回归;......... | 72 | | 多因素对单市场 | 研究多因素对单个市场的因果关系,比如各情绪对汇率市场的因果关系 | data=[X1,X2,X3,Y] | X1对 Y 回归,X2对 Y 回归;X3对 Y 回归 | 73 | 74 | * **信息准则**:表示确定最优滞后阶数所选用的信息准则,包括 AIC 或 BIC 准则 75 | 76 | AIC(p, q) = lnS(θ) + (p+q+1)/T 77 | 78 | BIC(p, q) = lnS(θ) + (p+q+1)×lnT/(2T) 79 | 80 | 其中 S(θ)表示分位数非对称绝对值残差和,T 为样本容量,p,q 均为滞后阶数。 81 | 82 | * **滞后估计数**:计算最优滞后阶数时,需要分区间计算 AIC/BIC 值,选取该区间最小 AIC/BIC 值所对应的滞后阶数,则为最优滞后阶数。该参数是设定在整个分位区间选择计算的分位点个数,默认选取 30 个点 83 | 84 | * **最大阶数**:表示选取的最大滞后阶数,默认选取 5 阶 85 | 86 | - **wald 估计数**:计算 wald 统计量时,在分位区间选择计算的分位点个数,默认选取 1000 个点 87 | - **有效数字**:表示保留的小数点位数,默认保留三位小数 88 | 89 | - **输出日志**:勾选后输出**运行细节.txt**文件,默认勾选 90 | 91 | - **估计信息显示**:展示运行信息 92 | 93 | ### QVAR 估计界面 94 | 95 |
96 | 97 | 98 | - **工具栏**: 99 | 100 | * **开始运行**:点击后进行 QVAR 模型估计 101 | 102 | * **绘制脉冲图**:点击计算各分位点脉冲响应示意图 103 | 104 | * **导入数据**:如需增加控制变量,则需点击该按钮导入控制变量数据集 105 | 106 | - **滞后阶数** 107 | 108 | * p:被解释变量 y 的滞后阶数 109 | 110 | * q:解释变量 x 的滞后阶数 111 | 112 | - **分位点**:默认选取 5 个分位点[0.1, 0.25, 0.5, 0.75, 0.9] 113 | 114 | * √:点击增加分位点 115 | 116 | * ×:点击减少分位点 117 | 118 | > 注意:最多计算 10 个分位点 119 | 120 | - **控制变量**:加入控制变量的回归公式 121 | 122 | - **信息显示**:显示提示信息 123 | 124 | ## Usage 125 | 126 | **第一步**:在当前路径下的命令行输入: 127 | 128 | ```shell 129 | python main.py 130 | ``` 131 | 132 | > 提示:在当前文件夹中,右键点击 cmd 或者 shell 打开命令行 133 | 134 | **第二步**:点击**导入数据**按钮 135 | 136 | 输入成功的话,会有导入成功的提示 137 | 138 | **第三步**:设定各参数 139 | 140 | **第四步**:点击**开始运行**按钮,等待程序运行结束,结果保存在**运行结果**文件夹下的**Granger.xlsx**文件内 141 | 142 | > 注:`***、**、*` 分别代表 1%、5%、10% 显著水平 143 | 144 | ## 项目目录 145 | 146 | ``` 147 | |-- Quantile 148 | |-- beauty_UI.py // 美化 GUI 界面代码 149 | |-- func.py // 主函数代码,定义分位数 Granger 因果检验计算 150 | |-- main.py // 主程序 151 | |-- README.md // 说明文件 152 | |-- data // 数据保存文件夹 153 | | |-- output.xlsx // 测试产生的结果文件 154 | | |-- Sup_wald_lag.xlsx // 检验 Sup_wald 显著性文件 155 | | |-- 测试数据.xlsx // 可以使用该文件进行测试,查看结果 156 | | |-- 运行细节.txt // 测试日志 157 | |-- pyqt5 界面 // 使用 Qt Creator 建立窗口产生的文件 158 | | |-- GUI // 主窗口 159 | | |-- child_GUI // 子窗口 160 | |-- 运行结果 // 运行结果存储文件夹 161 | ``` 162 | 163 | > 代码主体为**main.py**与**func.py**文件 164 | 165 | ## 估计原理 166 | 167 | ### 使用函数介绍 168 | 169 | 使用`statsmodels`库进行分位数回归命令: 170 | 171 | 1) 使用 R 型公式来拟合模型 172 | 173 | | **formula** | **说明** | **示例** | 174 | | ----------- | -------------------------------------- | -------------------- | 175 | | ~ | 分隔符,左边为响应变量,右边为解释变量 | y ~ x | 176 | | + | 添加变量 | y ~ x1 + x2 | 177 | | - | 移除变量 | y ~ x - 1(移除截距) | 178 | 179 | 2) 参数命令 180 | 181 | | **属性** | **说明** | **方法** | **说明** | 182 | | ---------- | -------------- | -------------------- | -------------- | 183 | | res.params | 获取估计参数值 | res.summary() | 展示估计结果 | 184 | | res.bse | 获取标准差 | res.cov_params() | 获取协方差矩阵 | 185 | | res.resid | 获取残差 | res.f_test("x2 = 0") | Wald 检验 | 186 | 187 | 188 | 189 | ### 分位数 Granger 因果检验实现原理 190 | 191 | 可以参考 [econometrics](https://github.com/lei940324/econometrics) 项目中的 [分位数 Granger 因果检验](https://nbviewer.jupyter.org/github/lei940324/econometrics/blob/master/分位数回归/分位数Granger因果检验.ipynb) 192 | 193 | 194 | 195 | ## Development Tool 196 | 197 | | 工具名 | 功能 | 图标 icon | 官网下载 | 198 | | :----------------: | :-----------: | :----------------------------------------------------------: | :----------------------------------------------------------: | 199 | | Qt Creator | GUI 界面可视化 | | [click](http://download.qt.io/official_releases/qtcreator/) | 200 | | PyCharm | 代码编辑器 | | [click](https://www.jetbrains.com/pycharm/download/#section=windows) | 201 | | Visual Studio Code | 代码阅读器 | | [click](https://code.visualstudio.com/) | 202 | 203 | 204 | 205 | ## reference 206 | 207 | * **书籍:** 208 | * 《Python Qt GUI 与数据可视化编程》 209 | 210 | * 《陈强高级计量经济学》 211 | 212 | * **文献:** 213 | * Koenker & Machado1999 Inference QuantileReg 214 | 215 | * Asymmetric Least Squares Estimation and Testing 216 | 217 | * Tests-for-Parameter-Instability-and-Structural-Change-With-Unknown-Change-Point 218 | 219 | * 房地产价格与汇率的联动关系研究———基于分位数 Granger 因果检验法 220 | 221 | * 基于分位数 Granger 因果的网络情绪与股市收益关系研究 222 | 223 | * **其他:** 224 | 225 | * Eviews 8 帮助文件 226 | 227 | * 张晓峒分位数回归讲义 228 | 229 | ## License 230 | 231 | [MIT](https://github.com/lei940324/Quantile/blob/master/LICENSE) © 热心市民石头 -------------------------------------------------------------------------------- /pyqt5界面/child_GUI/Qtapp/test.ui: -------------------------------------------------------------------------------- 1 | 2 | 3 | test 4 | 5 | 6 | 7 | 0 8 | 0 9 | 800 10 | 600 11 | 12 | 13 | 14 | MainWindow 15 | 16 | 17 | 18 | 19 | 20 | 20 21 | 90 22 | 308 23 | 22 24 | 25 | 26 | 27 | 滞后阶数 28 | 29 | 30 | 31 | 32 | 33 | 30 34 | 200 35 | 226 36 | 54 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 11 76 | 22 77 | 260 78 | 22 79 | 80 | 81 | 82 | 83 | 84 | 85 | Qt::Horizontal 86 | 87 | 88 | 89 | 40 90 | 20 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | Qt::Horizontal 99 | 100 | 101 | 102 | 40 103 | 20 104 | 105 | 106 | 107 | 108 | 109 | 110 | 111 | 开始运行 112 | 113 | 114 | 115 | 116 | 117 | 118 | 脉冲图 119 | 120 | 121 | 122 | 123 | 124 | 125 | 126 | 127 | 11 128 | 22 129 | 140 130 | 22 131 | 132 | 133 | 134 | 135 | 136 | 137 | 138 | 20 139 | 20 140 | 141 | 142 | 143 | 144 | 145 | 146 | 147 | 148 | 149 | 150 | 151 | 20 152 | 20 153 | 154 | 155 | 156 | 157 | 158 | 159 | 160 | 161 | 162 | 163 | Qt::Horizontal 164 | 165 | 166 | 167 | 40 168 | 20 169 | 170 | 171 | 172 | 173 | 174 | 175 | 176 | Qt::Horizontal 177 | 178 | 179 | 180 | 40 181 | 20 182 | 183 | 184 | 185 | 186 | 187 | 188 | 189 | 190 | 191 | 11 192 | 22 193 | 296 194 | 25 195 | 196 | 197 | 198 | 199 | 200 | 201 | p 202 | 203 | 204 | 205 | 206 | 207 | 208 | 209 | 210 | 211 | Qt::Horizontal 212 | 213 | 214 | 215 | 40 216 | 20 217 | 218 | 219 | 220 | 221 | 222 | 223 | 224 | q 225 | 226 | 227 | 228 | 229 | 230 | 231 | 232 | 233 | 234 | Qt::Horizontal 235 | 236 | 237 | 238 | 40 239 | 20 240 | 241 | 242 | 243 | 244 | 245 | 246 | 247 | Qt::Horizontal 248 | 249 | 250 | 251 | 40 252 | 20 253 | 254 | 255 | 256 | 257 | 258 | 259 | 260 | Qt::Horizontal 261 | 262 | 263 | 264 | 40 265 | 20 266 | 267 | 268 | 269 | 270 | 271 | 272 | 273 | 274 | 275 | 20 276 | 160 277 | 308 278 | 22 279 | 280 | 281 | 282 | 分位点 283 | 284 | 285 | 286 | 287 | 288 | 289 | 290 | 291 | -------------------------------------------------------------------------------- /pyqt5界面/child_GUI/ui_QVAR.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | 3 | # Form implementation generated from reading ui file '.\child_GUI\QVAR.ui' 4 | # 5 | # Created by: PyQt5 UI code generator 5.10 6 | # 7 | # WARNING! All changes made in this file will be lost! 8 | 9 | from PyQt5 import QtCore, QtGui, QtWidgets 10 | 11 | class Ui_QVAR(object): 12 | def setupUi(self, QVAR): 13 | QVAR.setObjectName("QVAR") 14 | QVAR.resize(339, 400) 15 | self.centralwidget = QtWidgets.QWidget(QVAR) 16 | self.centralwidget.setObjectName("centralwidget") 17 | self.gridLayout = QtWidgets.QGridLayout(self.centralwidget) 18 | self.gridLayout.setObjectName("gridLayout") 19 | self.gridLayout_6 = QtWidgets.QGridLayout() 20 | self.gridLayout_6.setObjectName("gridLayout_6") 21 | self.pushButton = QtWidgets.QPushButton(self.centralwidget) 22 | self.pushButton.setMaximumSize(QtCore.QSize(30, 30)) 23 | self.pushButton.setText("") 24 | icon = QtGui.QIcon() 25 | icon.addPixmap(QtGui.QPixmap(":/icon/image/704.bmp"), QtGui.QIcon.Normal, QtGui.QIcon.Off) 26 | self.pushButton.setIcon(icon) 27 | self.pushButton.setObjectName("pushButton") 28 | self.gridLayout_6.addWidget(self.pushButton, 1, 0, 1, 1) 29 | self.pushButton_2 = QtWidgets.QPushButton(self.centralwidget) 30 | self.pushButton_2.setMaximumSize(QtCore.QSize(30, 30)) 31 | self.pushButton_2.setText("") 32 | icon1 = QtGui.QIcon() 33 | icon1.addPixmap(QtGui.QPixmap(":/icon/image/706.bmp"), QtGui.QIcon.Normal, QtGui.QIcon.Off) 34 | self.pushButton_2.setIcon(icon1) 35 | self.pushButton_2.setObjectName("pushButton_2") 36 | self.gridLayout_6.addWidget(self.pushButton_2, 1, 1, 1, 1) 37 | spacerItem = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Minimum) 38 | self.gridLayout_6.addItem(spacerItem, 1, 2, 1, 1) 39 | self.label_4 = QtWidgets.QLabel(self.centralwidget) 40 | font = QtGui.QFont() 41 | font.setBold(True) 42 | font.setWeight(75) 43 | self.label_4.setFont(font) 44 | self.label_4.setObjectName("label_4") 45 | self.gridLayout_6.addWidget(self.label_4, 0, 0, 1, 3) 46 | self.gridLayout.addLayout(self.gridLayout_6, 4, 0, 1, 1) 47 | spacerItem1 = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Minimum) 48 | self.gridLayout.addItem(spacerItem1, 3, 0, 1, 1) 49 | self.gridLayout_5 = QtWidgets.QGridLayout() 50 | self.gridLayout_5.setObjectName("gridLayout_5") 51 | spacerItem2 = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Minimum) 52 | self.gridLayout_5.addItem(spacerItem2, 1, 4, 1, 1) 53 | self.label_3 = QtWidgets.QLabel(self.centralwidget) 54 | font = QtGui.QFont() 55 | font.setBold(True) 56 | font.setWeight(75) 57 | self.label_3.setFont(font) 58 | self.label_3.setObjectName("label_3") 59 | self.gridLayout_5.addWidget(self.label_3, 0, 0, 1, 5) 60 | self.label = QtWidgets.QLabel(self.centralwidget) 61 | self.label.setObjectName("label") 62 | self.gridLayout_5.addWidget(self.label, 1, 0, 1, 1) 63 | self.label_2 = QtWidgets.QLabel(self.centralwidget) 64 | self.label_2.setObjectName("label_2") 65 | self.gridLayout_5.addWidget(self.label_2, 1, 2, 1, 1) 66 | self.spinBox_2 = QtWidgets.QSpinBox(self.centralwidget) 67 | self.spinBox_2.setMaximumSize(QtCore.QSize(50, 16777215)) 68 | self.spinBox_2.setObjectName("spinBox_2") 69 | self.gridLayout_5.addWidget(self.spinBox_2, 1, 3, 1, 1) 70 | self.spinBox = QtWidgets.QSpinBox(self.centralwidget) 71 | self.spinBox.setMaximumSize(QtCore.QSize(50, 16777215)) 72 | self.spinBox.setObjectName("spinBox") 73 | self.gridLayout_5.addWidget(self.spinBox, 1, 1, 1, 1) 74 | self.gridLayout.addLayout(self.gridLayout_5, 0, 0, 1, 1) 75 | self.gridLayout_2 = QtWidgets.QGridLayout() 76 | self.gridLayout_2.setObjectName("gridLayout_2") 77 | self.doubleSpinBox = QtWidgets.QDoubleSpinBox(self.centralwidget) 78 | self.doubleSpinBox.setMaximumSize(QtCore.QSize(70, 16777215)) 79 | self.doubleSpinBox.setObjectName("doubleSpinBox") 80 | self.gridLayout_2.addWidget(self.doubleSpinBox, 0, 0, 1, 1) 81 | self.doubleSpinBox_2 = QtWidgets.QDoubleSpinBox(self.centralwidget) 82 | self.doubleSpinBox_2.setMaximumSize(QtCore.QSize(70, 16777215)) 83 | self.doubleSpinBox_2.setObjectName("doubleSpinBox_2") 84 | self.gridLayout_2.addWidget(self.doubleSpinBox_2, 0, 1, 1, 1) 85 | self.doubleSpinBox_3 = QtWidgets.QDoubleSpinBox(self.centralwidget) 86 | self.doubleSpinBox_3.setMaximumSize(QtCore.QSize(70, 16777215)) 87 | self.doubleSpinBox_3.setObjectName("doubleSpinBox_3") 88 | self.gridLayout_2.addWidget(self.doubleSpinBox_3, 0, 2, 1, 1) 89 | self.doubleSpinBox_4 = QtWidgets.QDoubleSpinBox(self.centralwidget) 90 | self.doubleSpinBox_4.setMaximumSize(QtCore.QSize(70, 16777215)) 91 | self.doubleSpinBox_4.setObjectName("doubleSpinBox_4") 92 | self.gridLayout_2.addWidget(self.doubleSpinBox_4, 0, 3, 1, 1) 93 | self.doubleSpinBox_5 = QtWidgets.QDoubleSpinBox(self.centralwidget) 94 | self.doubleSpinBox_5.setMaximumSize(QtCore.QSize(70, 16777215)) 95 | self.doubleSpinBox_5.setObjectName("doubleSpinBox_5") 96 | self.gridLayout_2.addWidget(self.doubleSpinBox_5, 0, 4, 1, 1) 97 | self.doubleSpinBox_6 = QtWidgets.QDoubleSpinBox(self.centralwidget) 98 | self.doubleSpinBox_6.setMaximumSize(QtCore.QSize(70, 16777215)) 99 | self.doubleSpinBox_6.setObjectName("doubleSpinBox_6") 100 | self.gridLayout_2.addWidget(self.doubleSpinBox_6, 1, 0, 1, 1) 101 | self.doubleSpinBox_7 = QtWidgets.QDoubleSpinBox(self.centralwidget) 102 | self.doubleSpinBox_7.setMaximumSize(QtCore.QSize(70, 16777215)) 103 | self.doubleSpinBox_7.setObjectName("doubleSpinBox_7") 104 | self.gridLayout_2.addWidget(self.doubleSpinBox_7, 1, 1, 1, 1) 105 | self.doubleSpinBox_8 = QtWidgets.QDoubleSpinBox(self.centralwidget) 106 | self.doubleSpinBox_8.setMaximumSize(QtCore.QSize(70, 16777215)) 107 | self.doubleSpinBox_8.setObjectName("doubleSpinBox_8") 108 | self.gridLayout_2.addWidget(self.doubleSpinBox_8, 1, 2, 1, 1) 109 | self.doubleSpinBox_9 = QtWidgets.QDoubleSpinBox(self.centralwidget) 110 | self.doubleSpinBox_9.setMaximumSize(QtCore.QSize(70, 16777215)) 111 | self.doubleSpinBox_9.setObjectName("doubleSpinBox_9") 112 | self.gridLayout_2.addWidget(self.doubleSpinBox_9, 1, 3, 1, 1) 113 | self.doubleSpinBox_10 = QtWidgets.QDoubleSpinBox(self.centralwidget) 114 | self.doubleSpinBox_10.setMaximumSize(QtCore.QSize(70, 16777215)) 115 | self.doubleSpinBox_10.setObjectName("doubleSpinBox_10") 116 | self.gridLayout_2.addWidget(self.doubleSpinBox_10, 1, 4, 1, 1) 117 | self.gridLayout.addLayout(self.gridLayout_2, 6, 0, 1, 1) 118 | self.gridLayout_4 = QtWidgets.QGridLayout() 119 | self.gridLayout_4.setObjectName("gridLayout_4") 120 | self.label_6 = QtWidgets.QLabel(self.centralwidget) 121 | self.label_6.setObjectName("label_6") 122 | self.gridLayout_4.addWidget(self.label_6, 1, 0, 1, 1) 123 | self.lineEdit = QtWidgets.QLineEdit(self.centralwidget) 124 | self.lineEdit.setObjectName("lineEdit") 125 | self.gridLayout_4.addWidget(self.lineEdit, 1, 2, 1, 1) 126 | self.label_5 = QtWidgets.QLabel(self.centralwidget) 127 | font = QtGui.QFont() 128 | font.setBold(True) 129 | font.setWeight(75) 130 | self.label_5.setFont(font) 131 | self.label_5.setObjectName("label_5") 132 | self.gridLayout_4.addWidget(self.label_5, 0, 0, 1, 1) 133 | self.gridLayout.addLayout(self.gridLayout_4, 8, 0, 1, 1) 134 | spacerItem3 = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Minimum) 135 | self.gridLayout.addItem(spacerItem3, 9, 0, 1, 1) 136 | spacerItem4 = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Minimum) 137 | self.gridLayout.addItem(spacerItem4, 7, 0, 1, 1) 138 | self.horizontalLayout = QtWidgets.QHBoxLayout() 139 | self.horizontalLayout.setObjectName("horizontalLayout") 140 | self.label_7 = QtWidgets.QLabel(self.centralwidget) 141 | font = QtGui.QFont() 142 | font.setBold(True) 143 | font.setWeight(75) 144 | self.label_7.setFont(font) 145 | self.label_7.setObjectName("label_7") 146 | self.horizontalLayout.addWidget(self.label_7) 147 | self.lineEdit_2 = QtWidgets.QLineEdit(self.centralwidget) 148 | self.lineEdit_2.setObjectName("lineEdit_2") 149 | self.horizontalLayout.addWidget(self.lineEdit_2) 150 | self.gridLayout.addLayout(self.horizontalLayout, 10, 0, 1, 1) 151 | QVAR.setCentralWidget(self.centralwidget) 152 | self.statusbar = QtWidgets.QStatusBar(QVAR) 153 | self.statusbar.setObjectName("statusbar") 154 | QVAR.setStatusBar(self.statusbar) 155 | self.toolBar = QtWidgets.QToolBar(QVAR) 156 | self.toolBar.setToolButtonStyle(QtCore.Qt.ToolButtonTextUnderIcon) 157 | self.toolBar.setObjectName("toolBar") 158 | QVAR.addToolBar(QtCore.Qt.TopToolBarArea, self.toolBar) 159 | self.action = QtWidgets.QAction(QVAR) 160 | icon2 = QtGui.QIcon() 161 | icon2.addPixmap(QtGui.QPixmap(":/icon/image/724.bmp"), QtGui.QIcon.Normal, QtGui.QIcon.Off) 162 | self.action.setIcon(icon2) 163 | self.action.setObjectName("action") 164 | self.action_2 = QtWidgets.QAction(QVAR) 165 | icon3 = QtGui.QIcon() 166 | icon3.addPixmap(QtGui.QPixmap(":/icon/image/212.bmp"), QtGui.QIcon.Normal, QtGui.QIcon.Off) 167 | self.action_2.setIcon(icon3) 168 | self.action_2.setObjectName("action_2") 169 | self.action_3 = QtWidgets.QAction(QVAR) 170 | icon4 = QtGui.QIcon() 171 | icon4.addPixmap(QtGui.QPixmap(":/icon/image/122.bmp"), QtGui.QIcon.Normal, QtGui.QIcon.Off) 172 | self.action_3.setIcon(icon4) 173 | self.action_3.setObjectName("action_3") 174 | self.toolBar.addAction(self.action) 175 | self.toolBar.addAction(self.action_2) 176 | self.toolBar.addSeparator() 177 | self.toolBar.addAction(self.action_3) 178 | 179 | self.retranslateUi(QVAR) 180 | QtCore.QMetaObject.connectSlotsByName(QVAR) 181 | 182 | def retranslateUi(self, QVAR): 183 | _translate = QtCore.QCoreApplication.translate 184 | QVAR.setWindowTitle(_translate("QVAR", "QVAR参数设定")) 185 | self.label_4.setText(_translate("QVAR", "分位点")) 186 | self.label_3.setText(_translate("QVAR", "滞后阶数")) 187 | self.label.setText(_translate("QVAR", "p")) 188 | self.label_2.setText(_translate("QVAR", "q")) 189 | self.label_6.setText(_translate("QVAR", "回归公式")) 190 | self.label_5.setText(_translate("QVAR", "控制变量")) 191 | self.label_7.setText(_translate("QVAR", "信息显示")) 192 | self.toolBar.setWindowTitle(_translate("QVAR", "toolBar")) 193 | self.action.setText(_translate("QVAR", "开始运行")) 194 | self.action_2.setText(_translate("QVAR", "绘制脉冲图")) 195 | self.action_3.setText(_translate("QVAR", "导入数据")) 196 | 197 | import pyqt5界面.icon_rc 198 | -------------------------------------------------------------------------------- /pyqt5界面/child_GUI/QVAR.ui: -------------------------------------------------------------------------------- 1 | 2 | 3 | QVAR 4 | 5 | 6 | 7 | 0 8 | 0 9 | 339 10 | 400 11 | 12 | 13 | 14 | QVAR参数设定 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 30 25 | 30 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | :/icon/image/704.bmp:/icon/image/704.bmp 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 30 42 | 30 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | :/icon/image/706.bmp:/icon/image/706.bmp 51 | 52 | 53 | 54 | 55 | 56 | 57 | Qt::Horizontal 58 | 59 | 60 | 61 | 40 62 | 20 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 75 72 | true 73 | 74 | 75 | 76 | 分位点 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | Qt::Horizontal 86 | 87 | 88 | 89 | 40 90 | 20 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | Qt::Horizontal 101 | 102 | 103 | 104 | 40 105 | 20 106 | 107 | 108 | 109 | 110 | 111 | 112 | 113 | 114 | 75 115 | true 116 | 117 | 118 | 119 | 滞后阶数 120 | 121 | 122 | 123 | 124 | 125 | 126 | p 127 | 128 | 129 | 130 | 131 | 132 | 133 | q 134 | 135 | 136 | 137 | 138 | 139 | 140 | 141 | 50 142 | 16777215 143 | 144 | 145 | 146 | 147 | 148 | 149 | 150 | 151 | 50 152 | 16777215 153 | 154 | 155 | 156 | 157 | 158 | 159 | 160 | 161 | 162 | 163 | 164 | 165 | 70 166 | 16777215 167 | 168 | 169 | 170 | 171 | 172 | 173 | 174 | 175 | 70 176 | 16777215 177 | 178 | 179 | 180 | 181 | 182 | 183 | 184 | 185 | 70 186 | 16777215 187 | 188 | 189 | 190 | 191 | 192 | 193 | 194 | 195 | 70 196 | 16777215 197 | 198 | 199 | 200 | 201 | 202 | 203 | 204 | 205 | 70 206 | 16777215 207 | 208 | 209 | 210 | 211 | 212 | 213 | 214 | 215 | 70 216 | 16777215 217 | 218 | 219 | 220 | 221 | 222 | 223 | 224 | 225 | 70 226 | 16777215 227 | 228 | 229 | 230 | 231 | 232 | 233 | 234 | 235 | 70 236 | 16777215 237 | 238 | 239 | 240 | 241 | 242 | 243 | 244 | 245 | 70 246 | 16777215 247 | 248 | 249 | 250 | 251 | 252 | 253 | 254 | 255 | 70 256 | 16777215 257 | 258 | 259 | 260 | 261 | 262 | 263 | 264 | 265 | 266 | 267 | 268 | 回归公式 269 | 270 | 271 | 272 | 273 | 274 | 275 | 276 | 277 | 278 | 279 | 75 280 | true 281 | 282 | 283 | 284 | 控制变量 285 | 286 | 287 | 288 | 289 | 290 | 291 | 292 | 293 | Qt::Horizontal 294 | 295 | 296 | 297 | 40 298 | 20 299 | 300 | 301 | 302 | 303 | 304 | 305 | 306 | Qt::Horizontal 307 | 308 | 309 | 310 | 40 311 | 20 312 | 313 | 314 | 315 | 316 | 317 | 318 | 319 | 320 | 321 | 322 | 75 323 | true 324 | 325 | 326 | 327 | 信息显示 328 | 329 | 330 | 331 | 332 | 333 | 334 | 335 | 336 | 337 | 338 | 339 | 340 | 341 | toolBar 342 | 343 | 344 | Qt::ToolButtonTextUnderIcon 345 | 346 | 347 | TopToolBarArea 348 | 349 | 350 | false 351 | 352 | 353 | 354 | 355 | 356 | 357 | 358 | 359 | 360 | :/icon/image/724.bmp:/icon/image/724.bmp 361 | 362 | 363 | 开始运行 364 | 365 | 366 | 367 | 368 | 369 | :/icon/image/212.bmp:/icon/image/212.bmp 370 | 371 | 372 | 绘制脉冲图 373 | 374 | 375 | 376 | 377 | 378 | :/icon/image/122.bmp:/icon/image/122.bmp 379 | 380 | 381 | 导入数据 382 | 383 | 384 | 385 | 386 | 387 | 388 | 389 | 390 | -------------------------------------------------------------------------------- /pyqt5界面/child_GUI/Qtapp/QVAR.ui: -------------------------------------------------------------------------------- 1 | 2 | 3 | QVAR 4 | 5 | 6 | 7 | 0 8 | 0 9 | 339 10 | 400 11 | 12 | 13 | 14 | QVAR参数设定 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 30 25 | 30 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | :/icon/image/704.bmp:/icon/image/704.bmp 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 30 42 | 30 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | :/icon/image/706.bmp:/icon/image/706.bmp 51 | 52 | 53 | 54 | 55 | 56 | 57 | Qt::Horizontal 58 | 59 | 60 | 61 | 40 62 | 20 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 75 72 | true 73 | 74 | 75 | 76 | 分位点 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | Qt::Horizontal 86 | 87 | 88 | 89 | 40 90 | 20 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | Qt::Horizontal 101 | 102 | 103 | 104 | 40 105 | 20 106 | 107 | 108 | 109 | 110 | 111 | 112 | 113 | 114 | 75 115 | true 116 | 117 | 118 | 119 | 滞后阶数 120 | 121 | 122 | 123 | 124 | 125 | 126 | p 127 | 128 | 129 | 130 | 131 | 132 | 133 | q 134 | 135 | 136 | 137 | 138 | 139 | 140 | 141 | 50 142 | 16777215 143 | 144 | 145 | 146 | 147 | 148 | 149 | 150 | 151 | 50 152 | 16777215 153 | 154 | 155 | 156 | 157 | 158 | 159 | 160 | 161 | 162 | 163 | 164 | 165 | 70 166 | 16777215 167 | 168 | 169 | 170 | 171 | 172 | 173 | 174 | 175 | 70 176 | 16777215 177 | 178 | 179 | 180 | 181 | 182 | 183 | 184 | 185 | 70 186 | 16777215 187 | 188 | 189 | 190 | 191 | 192 | 193 | 194 | 195 | 70 196 | 16777215 197 | 198 | 199 | 200 | 201 | 202 | 203 | 204 | 205 | 70 206 | 16777215 207 | 208 | 209 | 210 | 211 | 212 | 213 | 214 | 215 | 70 216 | 16777215 217 | 218 | 219 | 220 | 221 | 222 | 223 | 224 | 225 | 70 226 | 16777215 227 | 228 | 229 | 230 | 231 | 232 | 233 | 234 | 235 | 70 236 | 16777215 237 | 238 | 239 | 240 | 241 | 242 | 243 | 244 | 245 | 70 246 | 16777215 247 | 248 | 249 | 250 | 251 | 252 | 253 | 254 | 255 | 70 256 | 16777215 257 | 258 | 259 | 260 | 261 | 262 | 263 | 264 | 265 | 266 | 267 | 268 | 回归公式 269 | 270 | 271 | 272 | 273 | 274 | 275 | 276 | 277 | 278 | 279 | 75 280 | true 281 | 282 | 283 | 284 | 控制变量 285 | 286 | 287 | 288 | 289 | 290 | 291 | 292 | 293 | Qt::Horizontal 294 | 295 | 296 | 297 | 40 298 | 20 299 | 300 | 301 | 302 | 303 | 304 | 305 | 306 | Qt::Horizontal 307 | 308 | 309 | 310 | 40 311 | 20 312 | 313 | 314 | 315 | 316 | 317 | 318 | 319 | 320 | 321 | 322 | 75 323 | true 324 | 325 | 326 | 327 | 信息显示 328 | 329 | 330 | 331 | 332 | 333 | 334 | 335 | 336 | 337 | 338 | 339 | 340 | 341 | toolBar 342 | 343 | 344 | Qt::ToolButtonTextUnderIcon 345 | 346 | 347 | TopToolBarArea 348 | 349 | 350 | false 351 | 352 | 353 | 354 | 355 | 356 | 357 | 358 | 359 | 360 | :/icon/image/724.bmp:/icon/image/724.bmp 361 | 362 | 363 | 开始运行 364 | 365 | 366 | 367 | 368 | 369 | :/icon/image/212.bmp:/icon/image/212.bmp 370 | 371 | 372 | 绘制脉冲图 373 | 374 | 375 | 376 | 377 | 378 | :/icon/image/122.bmp:/icon/image/122.bmp 379 | 380 | 381 | 导入数据 382 | 383 | 384 | 385 | 386 | 387 | 388 | 389 | 390 | -------------------------------------------------------------------------------- /func.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | """ 3 | Created on Mon Mar 30 20:15:06 2020 4 | 5 | @author: Administrator 6 | """ 7 | 8 | import pandas as pd 9 | import numpy as np 10 | from queue import Queue 11 | from scipy import interpolate 12 | import statsmodels.formula.api as smf 13 | import math 14 | import logging 15 | import threading 16 | import re 17 | 18 | EXIT = False # 线程退出信号 19 | 20 | 21 | class Quantile_Granger(): 22 | """ 23 | 创建分位数Granger因果检验类 24 | """ 25 | def set_range(self, start, end, num): 26 | ''' 27 | 生成估计区间 28 | 29 | Parameters 30 | ---------- 31 | start : 区间起点 32 | end : 区间终点 33 | num : 个数 34 | 35 | Returns 36 | ------- 37 | qrange : 估计区间列表 38 | qr_name : 构建区间名 39 | 40 | ''' 41 | qrange = np.linspace(start, end, num) 42 | T = len(qrange) 43 | qr_name = [ 44 | f'[{qrange[i]:.2f}-{qrange[i+1]:.2f}]' for i in range(T - 1) 45 | ] 46 | return qrange, qr_name 47 | 48 | def pattern(self, df, sign): 49 | ''' 50 | 得到待估计数据字典,受pattern模式影响 51 | 52 | Parameters 53 | ---------- 54 | df : 原始数据 55 | sign : 模式选择,包括1,2,3 56 | 57 | Returns 58 | ------- 59 | DataList : 待估计数据字典 60 | ''' 61 | DataList = {} 62 | if sign == '单因素对各市场': 63 | X = df.iloc[:, 0] 64 | Xname = df.columns[0] 65 | for i in range(1, df.shape[1]): 66 | Y = df.iloc[:, i] 67 | Yname = df.columns[i] 68 | DataList[f'{Xname}——>{Yname}'] = pd.DataFrame([X, Y]).T 69 | elif sign == '相互影响': 70 | for i in range(df.shape[1]): 71 | for j in range(df.shape[1]): 72 | if i != j: 73 | X = df.iloc[:, i] 74 | Xname = df.columns.values[i] 75 | Y = df.iloc[:, j] 76 | Yname = df.columns.values[j] 77 | DataList[f'{Xname}——>{Yname}'] = pd.DataFrame([X, Y]).T 78 | elif sign == '多因素对单市场': 79 | Y = df.iloc[:, df.shape[1] - 1] 80 | Yname = df.columns.values[df.shape[1] - 1] 81 | for i in range(df.shape[1] - 1): 82 | X = df.iloc[:, i] 83 | Xname = df.columns.values[i] 84 | DataList[f'{Xname}——>{Yname}'] = pd.DataFrame([X, Y]).T 85 | return DataList 86 | 87 | def lag_list(self, Y, X, p=1, q=1): 88 | ''' 89 | 构造待估计滞后序列函数 90 | 91 | Parameters 92 | ---------- 93 | Y : 被估计变量 94 | X : 估计变量 95 | p : X滞后阶数,默认为1 96 | q : Y滞后阶数,默认为1 97 | 98 | Returns 99 | ------- 100 | data : 滞后序列 101 | 102 | ''' 103 | data = pd.DataFrame() 104 | T = len(Y) 105 | data['y'] = list(Y[max(p, q):T]) 106 | for i in range(1, p + 1): 107 | name = f'y_{i}' 108 | data[name] = list(Y[max(p, q) - i:T - i]) 109 | for i in range(1, q + 1): 110 | name = f'x_{i}' 111 | data[name] = list(X[max(p, q) - i:T - i]) 112 | return data 113 | 114 | def qreg(self, data, Q): 115 | ''' 116 | 构造待估计模型函数 117 | 118 | Parameters 119 | ---------- 120 | data : 滞后序列 121 | Q : 分位点 122 | 123 | Returns 124 | ------- 125 | res : 模型估计结果 126 | 127 | ''' 128 | for i, value in enumerate(data): 129 | if i == 0: 130 | model = f'{value} ~' 131 | else: 132 | model += f' + {value}' 133 | model = model.replace('~ +', '~') 134 | mod = smf.quantreg(model, data) 135 | res = mod.fit(q=Q) 136 | # print(res.summary()) 137 | return res 138 | 139 | def calculate(self, 140 | DataList, 141 | qrange, 142 | qr_name, 143 | max_lag, 144 | info_type, 145 | WaldNum, 146 | sign_num, 147 | AicNum, 148 | objects=[logging.info]): 149 | """ 150 | 循环计算得到sup_wald值 151 | 152 | Parameters 153 | ---------- 154 | DataList : 待估计数据字典 155 | qrange : 估计区间列表 156 | qr_name : 构建区间名 157 | max_lag : 最大估计阶数 158 | info_type : 信息准则类型:AIC或者BIC 159 | WaldNum : 估计wald值个数,默认1000 160 | sign_num : 有效数字 161 | AicNum : 滞后阶数估计数 162 | objects :输出信息载体,列表形式 163 | 164 | Returns 165 | ------- 166 | results : 各区间sup_wald值 167 | 168 | """ 169 | global EXIT 170 | # 日志设定 171 | if logging.info in objects: 172 | logging.basicConfig( 173 | filename=r'.\运行结果\运行细节.txt', 174 | level=logging.INFO, 175 | format='%(asctime)s - %(levelname)s - %(message)s') 176 | for object in objects: 177 | object('程序开始运行') 178 | 179 | results = pd.DataFrame() 180 | for key in DataList: 181 | relation = key 182 | X = DataList[key].iloc[:, 0] 183 | Y = DataList[key].iloc[:, 1] 184 | 185 | # 构建滞后阶数队列 186 | LagQueue = Queue() 187 | Qspaces = [] 188 | for i in range(AicNum): 189 | Qspaces.append(i * 0.9 / (AicNum - 1) + 0.05) 190 | for Q in Qspaces: 191 | for p in range(1, max_lag + 1): 192 | for q in range(1, max_lag + 1): 193 | LagQueue.put([Q, p, q]) 194 | 195 | # 多线程计算信息准则,选取最优滞后阶数 196 | self.AicDict = {} 197 | 198 | def info_cri(): 199 | while not EXIT: 200 | try: 201 | Q, p, q = LagQueue.get(block=False) 202 | except: 203 | break 204 | data = self.lag_list(Y, X, p, q) 205 | res = self.qreg(data, Q) 206 | n = len(Y) - max(p, q) 207 | ssr = [] 208 | for i in res.resid: 209 | if i >= 0: 210 | ssr.append(Q * i) 211 | else: 212 | ssr.append((Q - 1) * i) 213 | SSE = sum(ssr) / n 214 | L = math.log(SSE) 215 | k = p + q + 1 216 | if info_type == 'AIC': 217 | AIC = L + k / n 218 | NAME = 'AIC' 219 | else: 220 | AIC = L + (math.log(n) * k) / (2 * n) 221 | NAME = 'BIC' 222 | if Q in self.AicDict: 223 | self.AicDict[Q].append([p, q, AIC]) 224 | else: 225 | self.AicDict[Q] = [[p, q, AIC]] 226 | for object in objects: 227 | object( 228 | f'正在进行{relation},分位点:{Q:.2f}的{NAME}计算,滞后阶数为[{p},{q}],{NAME}值为{AIC:.2f}' 229 | ) 230 | 231 | threadCrawl = [] 232 | for i in range(10): 233 | threadObj = threading.Thread(target=info_cri) 234 | threadObj.start() 235 | threadCrawl.append(threadObj) 236 | for single in threadCrawl: 237 | single.join() 238 | for object in objects: 239 | object(f"计算{relation}最优滞后阶数线程退出循环") 240 | 241 | # 选取最优阶数 242 | if EXIT: 243 | for object in objects: 244 | object(f"程序已终止运行") 245 | return 0 246 | LagDict = {} 247 | for i in range(len(qr_name)): 248 | QAICS = [] 249 | for Q in self.AicDict: 250 | if qrange[i] <= Q <= qrange[i + 1]: 251 | for QAIC in self.AicDict[Q]: 252 | QAICS.append(QAIC) 253 | QAICS = sorted(QAICS, key=lambda x: x[2]) 254 | LagDict[qr_name[i]] = QAICS[0] 255 | 256 | # 生成待估计分位点及滞后阶数组合队列 257 | QregQueue = Queue() 258 | Qs = [] 259 | for i in range(WaldNum): 260 | Qs.append(i * 0.9 / (WaldNum - 1) + 0.05) 261 | for i in range(len(qrange) - 1): 262 | for Q in Qs: 263 | if qrange[i] <= Q <= qrange[i + 1]: 264 | QregQueue.put([Q] + LagDict[qr_name[i]] + [i]) 265 | 266 | # 11.多线程计算wald值 267 | self.WaldDict = {} 268 | 269 | def wald_text(): 270 | while not EXIT: 271 | try: 272 | Q, p, q, aic, index = QregQueue.get(block=False) 273 | except: 274 | break 275 | data = self.lag_list(Y, X, p, q) 276 | res = self.qreg(data, Q) 277 | wald = '' 278 | for i, value in enumerate(data): 279 | if i > p: 280 | wald += f'{value}=' 281 | wald = wald + '0' 282 | wald = str(res.f_test(wald)) 283 | walds = float(re.findall('array\(\[\[(.*?)\]\]', wald)[0]) 284 | self.WaldDict[(Q, index)] = [p, q, walds] 285 | for object in objects: 286 | object( 287 | f'正在进行{relation},分位区间:{qr_name[index]},分位点:{Q:.2f}的wald值,滞后阶数为[{p},{q}],wald值为{walds:.2f}' 288 | ) 289 | 290 | threadCrawl = [] 291 | for i in range(10): 292 | threadObj = threading.Thread(target=wald_text) 293 | threadObj.start() 294 | threadCrawl.append(threadObj) 295 | for single in threadCrawl: 296 | single.join() 297 | for object in objects: 298 | object(f"计算{relation}的wald线程退出循环") 299 | 300 | # 12.计算Sup-Wald值 301 | if EXIT: 302 | for object in objects: 303 | object(f"程序已终止运行") 304 | return 0 305 | SupDict = {} 306 | for i in range(len(qrange) - 1): 307 | SUP = [] 308 | for Q in self.WaldDict: 309 | if Q[1] == i: 310 | SUP.append(self.WaldDict[Q]) 311 | SUP = sorted(SUP, key=lambda x: x[2], reverse=True) 312 | SupDict[qr_name[i]] = SUP[0] 313 | 314 | # 13.判断Sup-Wald显著性 315 | Swl = pd.read_excel(r'.\data\Sup_wald_lag.xlsx') 316 | tao = [] 317 | for i in range(len(qr_name)): 318 | fenzi = qrange[i + 1] * (1 - qrange[i]) 319 | fenmu = qrange[i] * (1 - qrange[i + 1]) 320 | tao.append(fenzi / fenmu) 321 | x = Swl[0] 322 | y = Swl.drop(0, axis=1) 323 | # 插值拟合 324 | qr_list = [] 325 | wald_list = [] 326 | for i, qr in enumerate(SupDict): 327 | q = SupDict[qr][1] 328 | wald = SupDict[qr][2] 329 | walds = round(wald, sign_num) 330 | index = [f'{q}.2', f'{q}.1', q] 331 | f3 = interpolate.interp1d(x, y[index[0]], kind="quadratic") 332 | f2 = interpolate.interp1d(x, y[index[1]], kind="quadratic") 333 | f1 = interpolate.interp1d(x, y[index[2]], kind="quadratic") 334 | # walds = str(wald)[:str(wald).find('.')+sign_num+1] 335 | if wald >= f3(tao[i]): 336 | wald = f'{walds}***\n[{q}]' 337 | elif wald >= f2(tao[i]): 338 | wald = f'{walds}**\n[{q}]' 339 | elif wald >= f1(tao[i]): 340 | wald = f'{walds}*\n[{q}]' 341 | else: 342 | wald = f'{walds}\n[{q}]' 343 | qr_list.append(qr) 344 | wald_list.append(wald) 345 | results[relation] = pd.Series(wald_list, index=qr_list) 346 | for object in objects: 347 | object('分位数Granger因果检验计算结束') 348 | results.to_excel('./运行结果/Granger.xlsx') 349 | for object in objects: 350 | object('估计结果已保存在“运行结果/Granger.xlsx”文件内!') 351 | object('程序运行结束') 352 | print('\n*******************************************') 353 | print('最终结果展示:') 354 | print(results) 355 | 356 | 357 | if __name__ == "__main__": # 用于当前窗体测试 358 | 359 | ex = Quantile_Granger() 360 | df = pd.read_excel(r'.\data\测试数据.xlsx') 361 | df = df.drop(df.columns[0], axis=1) 362 | 363 | # 设定参数 364 | start = 0.1 # 区间起点 365 | end = 0.9 # 区间终点 366 | num = 17 # 区间个数 367 | sign = '单因素对各市场' # 模式选择 368 | max_lag = 1 # 最大滞后阶数选择,默认为5 369 | info_type = 'BIC' # 信息准则选择 370 | WaldNum = 35 # 估计wald个数,默认1000个 371 | sign_num = 2 # 有效数字,默认为3 372 | AicNum = 20 # 估计各区间最优滞后阶数,默认50个 373 | 374 | # 开始计算 375 | qrange, qr_name = ex.set_range(start, end, num) 376 | DataList = ex.pattern(df, sign) 377 | results = ex.calculate(DataList, qrange, qr_name, max_lag, info_type, 378 | WaldNum, sign_num, AicNum) 379 | results.to_excel('./运行结果/Granger.xlsx') 380 | -------------------------------------------------------------------------------- /pyqt5界面/ui_MainWindow.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | 3 | # Form implementation generated from reading ui file 'MainWindow.ui' 4 | # 5 | # Created by: PyQt5 UI code generator 5.10 6 | # 7 | # WARNING! All changes made in this file will be lost! 8 | 9 | from PyQt5 import QtCore, QtGui, QtWidgets 10 | 11 | class Ui_MainWindow(object): 12 | def setupUi(self, MainWindow): 13 | MainWindow.setObjectName("MainWindow") 14 | MainWindow.resize(640, 546) 15 | self.centralwidget = QtWidgets.QWidget(MainWindow) 16 | self.centralwidget.setObjectName("centralwidget") 17 | self.gridLayout_2 = QtWidgets.QGridLayout(self.centralwidget) 18 | self.gridLayout_2.setObjectName("gridLayout_2") 19 | spacerItem = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Minimum) 20 | self.gridLayout_2.addItem(spacerItem, 3, 0, 1, 1) 21 | self.horizontalLayout_6 = QtWidgets.QHBoxLayout() 22 | self.horizontalLayout_6.setObjectName("horizontalLayout_6") 23 | self.label_12 = QtWidgets.QLabel(self.centralwidget) 24 | font = QtGui.QFont() 25 | font.setBold(True) 26 | font.setWeight(75) 27 | self.label_12.setFont(font) 28 | self.label_12.setObjectName("label_12") 29 | self.horizontalLayout_6.addWidget(self.label_12) 30 | self.pushButton_2 = QtWidgets.QPushButton(self.centralwidget) 31 | self.pushButton_2.setMaximumSize(QtCore.QSize(10, 10)) 32 | self.pushButton_2.setText("") 33 | self.pushButton_2.setObjectName("pushButton_2") 34 | self.horizontalLayout_6.addWidget(self.pushButton_2) 35 | self.pushButton_3 = QtWidgets.QPushButton(self.centralwidget) 36 | self.pushButton_3.setMaximumSize(QtCore.QSize(10, 10)) 37 | self.pushButton_3.setText("") 38 | self.pushButton_3.setObjectName("pushButton_3") 39 | self.horizontalLayout_6.addWidget(self.pushButton_3) 40 | self.pushButton_4 = QtWidgets.QPushButton(self.centralwidget) 41 | self.pushButton_4.setMaximumSize(QtCore.QSize(10, 10)) 42 | self.pushButton_4.setText("") 43 | self.pushButton_4.setObjectName("pushButton_4") 44 | self.horizontalLayout_6.addWidget(self.pushButton_4) 45 | spacerItem1 = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Minimum) 46 | self.horizontalLayout_6.addItem(spacerItem1) 47 | self.checkBox_2 = QtWidgets.QCheckBox(self.centralwidget) 48 | self.checkBox_2.setObjectName("checkBox_2") 49 | self.horizontalLayout_6.addWidget(self.checkBox_2) 50 | self.gridLayout_2.addLayout(self.horizontalLayout_6, 6, 0, 1, 1) 51 | self.horizontalLayout = QtWidgets.QHBoxLayout() 52 | self.horizontalLayout.setObjectName("horizontalLayout") 53 | self.label_2 = QtWidgets.QLabel(self.centralwidget) 54 | self.label_2.setObjectName("label_2") 55 | self.horizontalLayout.addWidget(self.label_2) 56 | self.doubleSpinBox = QtWidgets.QDoubleSpinBox(self.centralwidget) 57 | self.doubleSpinBox.setObjectName("doubleSpinBox") 58 | self.horizontalLayout.addWidget(self.doubleSpinBox) 59 | spacerItem2 = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Minimum) 60 | self.horizontalLayout.addItem(spacerItem2) 61 | self.label_3 = QtWidgets.QLabel(self.centralwidget) 62 | self.label_3.setObjectName("label_3") 63 | self.horizontalLayout.addWidget(self.label_3) 64 | self.doubleSpinBox_2 = QtWidgets.QDoubleSpinBox(self.centralwidget) 65 | self.doubleSpinBox_2.setObjectName("doubleSpinBox_2") 66 | self.horizontalLayout.addWidget(self.doubleSpinBox_2) 67 | spacerItem3 = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Minimum) 68 | self.horizontalLayout.addItem(spacerItem3) 69 | self.label_4 = QtWidgets.QLabel(self.centralwidget) 70 | self.label_4.setObjectName("label_4") 71 | self.horizontalLayout.addWidget(self.label_4) 72 | self.spinBox = QtWidgets.QSpinBox(self.centralwidget) 73 | self.spinBox.setObjectName("spinBox") 74 | self.horizontalLayout.addWidget(self.spinBox) 75 | spacerItem4 = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Minimum) 76 | self.horizontalLayout.addItem(spacerItem4) 77 | spacerItem5 = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Minimum) 78 | self.horizontalLayout.addItem(spacerItem5) 79 | spacerItem6 = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Minimum) 80 | self.horizontalLayout.addItem(spacerItem6) 81 | spacerItem7 = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Minimum) 82 | self.horizontalLayout.addItem(spacerItem7) 83 | self.pushButton = QtWidgets.QPushButton(self.centralwidget) 84 | icon = QtGui.QIcon() 85 | icon.addPixmap(QtGui.QPixmap(":/icons/images/704.bmp"), QtGui.QIcon.Normal, QtGui.QIcon.Off) 86 | self.pushButton.setIcon(icon) 87 | self.pushButton.setObjectName("pushButton") 88 | self.horizontalLayout.addWidget(self.pushButton) 89 | self.gridLayout_2.addLayout(self.horizontalLayout, 1, 0, 1, 1) 90 | self.label = QtWidgets.QLabel(self.centralwidget) 91 | font = QtGui.QFont() 92 | font.setBold(True) 93 | font.setWeight(75) 94 | self.label.setFont(font) 95 | self.label.setObjectName("label") 96 | self.gridLayout_2.addWidget(self.label, 0, 0, 1, 1) 97 | self.textEdit = QtWidgets.QTextEdit(self.centralwidget) 98 | self.textEdit.setObjectName("textEdit") 99 | self.gridLayout_2.addWidget(self.textEdit, 7, 0, 1, 1) 100 | self.lineEdit = QtWidgets.QLineEdit(self.centralwidget) 101 | self.lineEdit.setObjectName("lineEdit") 102 | self.gridLayout_2.addWidget(self.lineEdit, 2, 0, 1, 1) 103 | self.gridLayout = QtWidgets.QGridLayout() 104 | self.gridLayout.setObjectName("gridLayout") 105 | self.label_11 = QtWidgets.QLabel(self.centralwidget) 106 | self.label_11.setObjectName("label_11") 107 | self.gridLayout.addWidget(self.label_11, 2, 0, 1, 1) 108 | self.comboBox = QtWidgets.QComboBox(self.centralwidget) 109 | self.comboBox.setMaximumSize(QtCore.QSize(60, 16777215)) 110 | self.comboBox.setObjectName("comboBox") 111 | self.comboBox.addItem("") 112 | self.comboBox.addItem("") 113 | self.comboBox.addItem("") 114 | self.comboBox.addItem("") 115 | self.comboBox.addItem("") 116 | self.comboBox.addItem("") 117 | self.comboBox.addItem("") 118 | self.gridLayout.addWidget(self.comboBox, 2, 1, 1, 1) 119 | self.comboBox_2 = QtWidgets.QComboBox(self.centralwidget) 120 | sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Preferred, QtWidgets.QSizePolicy.Fixed) 121 | sizePolicy.setHorizontalStretch(0) 122 | sizePolicy.setVerticalStretch(0) 123 | sizePolicy.setHeightForWidth(self.comboBox_2.sizePolicy().hasHeightForWidth()) 124 | self.comboBox_2.setSizePolicy(sizePolicy) 125 | self.comboBox_2.setMaximumSize(QtCore.QSize(150, 16777215)) 126 | self.comboBox_2.setObjectName("comboBox_2") 127 | self.comboBox_2.addItem("") 128 | self.comboBox_2.addItem("") 129 | self.comboBox_2.addItem("") 130 | self.gridLayout.addWidget(self.comboBox_2, 1, 1, 1, 1) 131 | self.spinBox_2 = QtWidgets.QSpinBox(self.centralwidget) 132 | self.spinBox_2.setObjectName("spinBox_2") 133 | self.gridLayout.addWidget(self.spinBox_2, 1, 7, 1, 1) 134 | self.checkBox = QtWidgets.QCheckBox(self.centralwidget) 135 | self.checkBox.setObjectName("checkBox") 136 | self.gridLayout.addWidget(self.checkBox, 0, 7, 1, 1) 137 | self.label_14 = QtWidgets.QLabel(self.centralwidget) 138 | self.label_14.setObjectName("label_14") 139 | self.gridLayout.addWidget(self.label_14, 2, 6, 1, 1) 140 | spacerItem8 = QtWidgets.QSpacerItem(20, 40, QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Expanding) 141 | self.gridLayout.addItem(spacerItem8, 1, 2, 1, 1) 142 | self.label_9 = QtWidgets.QLabel(self.centralwidget) 143 | self.label_9.setObjectName("label_9") 144 | self.gridLayout.addWidget(self.label_9, 1, 3, 1, 1) 145 | self.label_5 = QtWidgets.QLabel(self.centralwidget) 146 | font = QtGui.QFont() 147 | font.setBold(True) 148 | font.setWeight(75) 149 | self.label_5.setFont(font) 150 | self.label_5.setObjectName("label_5") 151 | self.gridLayout.addWidget(self.label_5, 0, 0, 1, 1) 152 | self.spinBox_3 = QtWidgets.QSpinBox(self.centralwidget) 153 | self.spinBox_3.setObjectName("spinBox_3") 154 | self.gridLayout.addWidget(self.spinBox_3, 2, 4, 1, 1) 155 | self.label_6 = QtWidgets.QLabel(self.centralwidget) 156 | self.label_6.setObjectName("label_6") 157 | self.gridLayout.addWidget(self.label_6, 1, 6, 1, 1) 158 | self.label_7 = QtWidgets.QLabel(self.centralwidget) 159 | self.label_7.setObjectName("label_7") 160 | self.gridLayout.addWidget(self.label_7, 2, 3, 1, 1) 161 | self.label_10 = QtWidgets.QLabel(self.centralwidget) 162 | self.label_10.setObjectName("label_10") 163 | self.gridLayout.addWidget(self.label_10, 1, 0, 1, 1) 164 | self.comboBox_4 = QtWidgets.QComboBox(self.centralwidget) 165 | self.comboBox_4.setObjectName("comboBox_4") 166 | self.comboBox_4.addItem("") 167 | self.comboBox_4.addItem("") 168 | self.comboBox_4.addItem("") 169 | self.comboBox_4.addItem("") 170 | self.comboBox_4.addItem("") 171 | self.comboBox_4.addItem("") 172 | self.gridLayout.addWidget(self.comboBox_4, 2, 7, 1, 1) 173 | self.comboBox_3 = QtWidgets.QComboBox(self.centralwidget) 174 | self.comboBox_3.setObjectName("comboBox_3") 175 | self.comboBox_3.addItem("") 176 | self.comboBox_3.addItem("") 177 | self.gridLayout.addWidget(self.comboBox_3, 1, 4, 1, 1) 178 | spacerItem9 = QtWidgets.QSpacerItem(20, 40, QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Expanding) 179 | self.gridLayout.addItem(spacerItem9, 1, 5, 1, 1) 180 | self.gridLayout_2.addLayout(self.gridLayout, 4, 0, 1, 1) 181 | spacerItem10 = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Minimum) 182 | self.gridLayout_2.addItem(spacerItem10, 5, 0, 1, 1) 183 | MainWindow.setCentralWidget(self.centralwidget) 184 | self.statusbar = QtWidgets.QStatusBar(MainWindow) 185 | self.statusbar.setObjectName("statusbar") 186 | MainWindow.setStatusBar(self.statusbar) 187 | self.toolBar = QtWidgets.QToolBar(MainWindow) 188 | self.toolBar.setToolButtonStyle(QtCore.Qt.ToolButtonTextUnderIcon) 189 | self.toolBar.setObjectName("toolBar") 190 | MainWindow.addToolBar(QtCore.Qt.TopToolBarArea, self.toolBar) 191 | self.action = QtWidgets.QAction(MainWindow) 192 | icon1 = QtGui.QIcon() 193 | icon1.addPixmap(QtGui.QPixmap(":/icons/images/122.bmp"), QtGui.QIcon.Normal, QtGui.QIcon.Off) 194 | self.action.setIcon(icon1) 195 | self.action.setVisible(True) 196 | self.action.setObjectName("action") 197 | self.action_2 = QtWidgets.QAction(MainWindow) 198 | icon2 = QtGui.QIcon() 199 | icon2.addPixmap(QtGui.QPixmap(":/icons/images/724.bmp"), QtGui.QIcon.Normal, QtGui.QIcon.Off) 200 | self.action_2.setIcon(icon2) 201 | self.action_2.setObjectName("action_2") 202 | self.action_4 = QtWidgets.QAction(MainWindow) 203 | icon3 = QtGui.QIcon() 204 | icon3.addPixmap(QtGui.QPixmap(":/icons/images/206.bmp"), QtGui.QIcon.Normal, QtGui.QIcon.Off) 205 | self.action_4.setIcon(icon3) 206 | self.action_4.setObjectName("action_4") 207 | self.action_3 = QtWidgets.QAction(MainWindow) 208 | icon4 = QtGui.QIcon() 209 | icon4.addPixmap(QtGui.QPixmap(":/icons/images/400.bmp"), QtGui.QIcon.Normal, QtGui.QIcon.Off) 210 | self.action_3.setIcon(icon4) 211 | self.action_3.setObjectName("action_3") 212 | self.action_5 = QtWidgets.QAction(MainWindow) 213 | icon5 = QtGui.QIcon() 214 | icon5.addPixmap(QtGui.QPixmap(":/icons/images/324.bmp"), QtGui.QIcon.Normal, QtGui.QIcon.Off) 215 | self.action_5.setIcon(icon5) 216 | self.action_5.setObjectName("action_5") 217 | self.action_6 = QtWidgets.QAction(MainWindow) 218 | icon6 = QtGui.QIcon() 219 | icon6.addPixmap(QtGui.QPixmap(":/icons/images/406.bmp"), QtGui.QIcon.Normal, QtGui.QIcon.Off) 220 | self.action_6.setIcon(icon6) 221 | self.action_6.setObjectName("action_6") 222 | self.actionQVAR = QtWidgets.QAction(MainWindow) 223 | icon7 = QtGui.QIcon() 224 | icon7.addPixmap(QtGui.QPixmap(":/icons/images/728.bmp"), QtGui.QIcon.Normal, QtGui.QIcon.Off) 225 | self.actionQVAR.setIcon(icon7) 226 | self.actionQVAR.setObjectName("actionQVAR") 227 | self.toolBar.addAction(self.action) 228 | self.toolBar.addAction(self.action_2) 229 | self.toolBar.addAction(self.action_5) 230 | self.toolBar.addSeparator() 231 | self.toolBar.addAction(self.action_6) 232 | self.toolBar.addAction(self.action_4) 233 | self.toolBar.addSeparator() 234 | self.toolBar.addAction(self.actionQVAR) 235 | 236 | self.retranslateUi(MainWindow) 237 | QtCore.QMetaObject.connectSlotsByName(MainWindow) 238 | 239 | def retranslateUi(self, MainWindow): 240 | _translate = QtCore.QCoreApplication.translate 241 | MainWindow.setWindowTitle(_translate("MainWindow", "分位数Granger因果检验")) 242 | self.label_12.setText(_translate("MainWindow", "估计信息显示")) 243 | self.checkBox_2.setText(_translate("MainWindow", "输出日志")) 244 | self.label_2.setText(_translate("MainWindow", "起点")) 245 | self.label_3.setText(_translate("MainWindow", "终点")) 246 | self.label_4.setText(_translate("MainWindow", "个数")) 247 | self.pushButton.setText(_translate("MainWindow", "预览区间")) 248 | self.label.setText(_translate("MainWindow", "区间设定")) 249 | self.label_11.setText(_translate("MainWindow", "最大阶数")) 250 | self.comboBox.setItemText(0, _translate("MainWindow", "1")) 251 | self.comboBox.setItemText(1, _translate("MainWindow", "2")) 252 | self.comboBox.setItemText(2, _translate("MainWindow", "3")) 253 | self.comboBox.setItemText(3, _translate("MainWindow", "4")) 254 | self.comboBox.setItemText(4, _translate("MainWindow", "5")) 255 | self.comboBox.setItemText(5, _translate("MainWindow", "6")) 256 | self.comboBox.setItemText(6, _translate("MainWindow", "7")) 257 | self.comboBox_2.setItemText(0, _translate("MainWindow", "单因素对各市场")) 258 | self.comboBox_2.setItemText(1, _translate("MainWindow", "相互影响")) 259 | self.comboBox_2.setItemText(2, _translate("MainWindow", "多因素对单市场")) 260 | self.checkBox.setText(_translate("MainWindow", "日期")) 261 | self.label_14.setText(_translate("MainWindow", "有效数字")) 262 | self.label_9.setText(_translate("MainWindow", "信息准则")) 263 | self.label_5.setText(_translate("MainWindow", "参数设定")) 264 | self.label_6.setText(_translate("MainWindow", "滞后估计数")) 265 | self.label_7.setText(_translate("MainWindow", "wald估计数")) 266 | self.label_10.setText(_translate("MainWindow", "模式设定")) 267 | self.comboBox_4.setItemText(0, _translate("MainWindow", "0")) 268 | self.comboBox_4.setItemText(1, _translate("MainWindow", "1")) 269 | self.comboBox_4.setItemText(2, _translate("MainWindow", "2")) 270 | self.comboBox_4.setItemText(3, _translate("MainWindow", "3")) 271 | self.comboBox_4.setItemText(4, _translate("MainWindow", "4")) 272 | self.comboBox_4.setItemText(5, _translate("MainWindow", "5")) 273 | self.comboBox_3.setItemText(0, _translate("MainWindow", "AIC")) 274 | self.comboBox_3.setItemText(1, _translate("MainWindow", "BIC")) 275 | self.toolBar.setWindowTitle(_translate("MainWindow", "toolBar")) 276 | self.action.setText(_translate("MainWindow", "导入数据")) 277 | self.action_2.setText(_translate("MainWindow", "开始运行")) 278 | self.action_4.setText(_translate("MainWindow", "初始化")) 279 | self.action_3.setText(_translate("MainWindow", "最小化")) 280 | self.action_5.setText(_translate("MainWindow", "终止运行")) 281 | self.action_6.setText(_translate("MainWindow", "查看数据")) 282 | self.actionQVAR.setText(_translate("MainWindow", "QVAR估计")) 283 | 284 | import pyqt5界面.res_rc 285 | -------------------------------------------------------------------------------- /pyqt5界面/MainWindow.ui: -------------------------------------------------------------------------------- 1 | 2 | 3 | MainWindow 4 | 5 | 6 | 7 | 0 8 | 0 9 | 640 10 | 546 11 | 12 | 13 | 14 | 分位数Granger因果检验 15 | 16 | 17 | 18 | 19 | 20 | 21 | Qt::Horizontal 22 | 23 | 24 | 25 | 40 26 | 20 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 75 38 | true 39 | 40 | 41 | 42 | 估计信息显示 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 10 51 | 10 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 10 64 | 10 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 10 77 | 10 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | Qt::Horizontal 89 | 90 | 91 | 92 | 40 93 | 20 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 输出日志 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | 110 | 111 | 112 | 起点 113 | 114 | 115 | 116 | 117 | 118 | 119 | 120 | 121 | 122 | Qt::Horizontal 123 | 124 | 125 | 126 | 40 127 | 20 128 | 129 | 130 | 131 | 132 | 133 | 134 | 135 | 终点 136 | 137 | 138 | 139 | 140 | 141 | 142 | 143 | 144 | 145 | Qt::Horizontal 146 | 147 | 148 | 149 | 40 150 | 20 151 | 152 | 153 | 154 | 155 | 156 | 157 | 158 | 个数 159 | 160 | 161 | 162 | 163 | 164 | 165 | 166 | 167 | 168 | Qt::Horizontal 169 | 170 | 171 | 172 | 40 173 | 20 174 | 175 | 176 | 177 | 178 | 179 | 180 | 181 | Qt::Horizontal 182 | 183 | 184 | 185 | 40 186 | 20 187 | 188 | 189 | 190 | 191 | 192 | 193 | 194 | Qt::Horizontal 195 | 196 | 197 | 198 | 40 199 | 20 200 | 201 | 202 | 203 | 204 | 205 | 206 | 207 | Qt::Horizontal 208 | 209 | 210 | 211 | 40 212 | 20 213 | 214 | 215 | 216 | 217 | 218 | 219 | 220 | 预览区间 221 | 222 | 223 | 224 | :/icons/images/704.bmp:/icons/images/704.bmp 225 | 226 | 227 | 228 | 229 | 230 | 231 | 232 | 233 | 234 | 75 235 | true 236 | 237 | 238 | 239 | 区间设定 240 | 241 | 242 | 243 | 244 | 245 | 246 | 247 | 248 | 249 | 250 | 251 | 252 | 253 | 254 | 最大阶数 255 | 256 | 257 | 258 | 259 | 260 | 261 | 262 | 60 263 | 16777215 264 | 265 | 266 | 267 | 268 | 1 269 | 270 | 271 | 272 | 273 | 2 274 | 275 | 276 | 277 | 278 | 3 279 | 280 | 281 | 282 | 283 | 4 284 | 285 | 286 | 287 | 288 | 5 289 | 290 | 291 | 292 | 293 | 6 294 | 295 | 296 | 297 | 298 | 7 299 | 300 | 301 | 302 | 303 | 304 | 305 | 306 | 307 | 0 308 | 0 309 | 310 | 311 | 312 | 313 | 150 314 | 16777215 315 | 316 | 317 | 318 | 319 | 单因素对各市场 320 | 321 | 322 | 323 | 324 | 相互影响 325 | 326 | 327 | 328 | 329 | 多因素对单市场 330 | 331 | 332 | 333 | 334 | 335 | 336 | 337 | 338 | 339 | 340 | 日期 341 | 342 | 343 | 344 | 345 | 346 | 347 | 有效数字 348 | 349 | 350 | 351 | 352 | 353 | 354 | Qt::Vertical 355 | 356 | 357 | 358 | 20 359 | 40 360 | 361 | 362 | 363 | 364 | 365 | 366 | 367 | 信息准则 368 | 369 | 370 | 371 | 372 | 373 | 374 | 375 | 75 376 | true 377 | 378 | 379 | 380 | 参数设定 381 | 382 | 383 | 384 | 385 | 386 | 387 | 388 | 389 | 390 | 滞后估计数 391 | 392 | 393 | 394 | 395 | 396 | 397 | wald估计数 398 | 399 | 400 | 401 | 402 | 403 | 404 | 模式设定 405 | 406 | 407 | 408 | 409 | 410 | 411 | 412 | 0 413 | 414 | 415 | 416 | 417 | 1 418 | 419 | 420 | 421 | 422 | 2 423 | 424 | 425 | 426 | 427 | 3 428 | 429 | 430 | 431 | 432 | 4 433 | 434 | 435 | 436 | 437 | 5 438 | 439 | 440 | 441 | 442 | 443 | 444 | 445 | 446 | AIC 447 | 448 | 449 | 450 | 451 | BIC 452 | 453 | 454 | 455 | 456 | 457 | 458 | 459 | Qt::Vertical 460 | 461 | 462 | 463 | 20 464 | 40 465 | 466 | 467 | 468 | 469 | 470 | 471 | 472 | 473 | 474 | Qt::Horizontal 475 | 476 | 477 | 478 | 40 479 | 20 480 | 481 | 482 | 483 | 484 | 485 | 486 | 487 | 488 | 489 | toolBar 490 | 491 | 492 | Qt::ToolButtonTextUnderIcon 493 | 494 | 495 | TopToolBarArea 496 | 497 | 498 | false 499 | 500 | 501 | 502 | 503 | 504 | 505 | 506 | 507 | 508 | 509 | 510 | 511 | 512 | :/icons/images/122.bmp:/icons/images/122.bmp 513 | 514 | 515 | 导入数据 516 | 517 | 518 | true 519 | 520 | 521 | 522 | 523 | 524 | :/icons/images/724.bmp:/icons/images/724.bmp 525 | 526 | 527 | 开始运行 528 | 529 | 530 | 531 | 532 | 533 | :/icons/images/206.bmp:/icons/images/206.bmp 534 | 535 | 536 | 初始化 537 | 538 | 539 | 540 | 541 | 542 | :/icons/images/400.bmp:/icons/images/400.bmp 543 | 544 | 545 | 最小化 546 | 547 | 548 | 549 | 550 | 551 | :/icons/images/324.bmp:/icons/images/324.bmp 552 | 553 | 554 | 终止运行 555 | 556 | 557 | 558 | 559 | 560 | :/icons/images/406.bmp:/icons/images/406.bmp 561 | 562 | 563 | 查看数据 564 | 565 | 566 | 567 | 568 | 569 | :/icons/images/728.bmp:/icons/images/728.bmp 570 | 571 | 572 | QVAR估计 573 | 574 | 575 | 576 | 577 | 578 | 579 | 580 | 581 | -------------------------------------------------------------------------------- /pyqt5界面/GUI/MainWindow.ui: -------------------------------------------------------------------------------- 1 | 2 | 3 | MainWindow 4 | 5 | 6 | 7 | 0 8 | 0 9 | 640 10 | 546 11 | 12 | 13 | 14 | 分位数Granger因果检验 15 | 16 | 17 | 18 | 19 | 20 | 21 | Qt::Horizontal 22 | 23 | 24 | 25 | 40 26 | 20 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 75 38 | true 39 | 40 | 41 | 42 | 估计信息显示 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 10 51 | 10 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 10 64 | 10 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 10 77 | 10 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | Qt::Horizontal 89 | 90 | 91 | 92 | 40 93 | 20 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 输出日志 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | 110 | 111 | 112 | 起点 113 | 114 | 115 | 116 | 117 | 118 | 119 | 120 | 121 | 122 | Qt::Horizontal 123 | 124 | 125 | 126 | 40 127 | 20 128 | 129 | 130 | 131 | 132 | 133 | 134 | 135 | 终点 136 | 137 | 138 | 139 | 140 | 141 | 142 | 143 | 144 | 145 | Qt::Horizontal 146 | 147 | 148 | 149 | 40 150 | 20 151 | 152 | 153 | 154 | 155 | 156 | 157 | 158 | 个数 159 | 160 | 161 | 162 | 163 | 164 | 165 | 166 | 167 | 168 | Qt::Horizontal 169 | 170 | 171 | 172 | 40 173 | 20 174 | 175 | 176 | 177 | 178 | 179 | 180 | 181 | Qt::Horizontal 182 | 183 | 184 | 185 | 40 186 | 20 187 | 188 | 189 | 190 | 191 | 192 | 193 | 194 | Qt::Horizontal 195 | 196 | 197 | 198 | 40 199 | 20 200 | 201 | 202 | 203 | 204 | 205 | 206 | 207 | Qt::Horizontal 208 | 209 | 210 | 211 | 40 212 | 20 213 | 214 | 215 | 216 | 217 | 218 | 219 | 220 | 预览区间 221 | 222 | 223 | 224 | :/icons/images/704.bmp:/icons/images/704.bmp 225 | 226 | 227 | 228 | 229 | 230 | 231 | 232 | 233 | 234 | 75 235 | true 236 | 237 | 238 | 239 | 区间设定 240 | 241 | 242 | 243 | 244 | 245 | 246 | 247 | 248 | 249 | 250 | 251 | 252 | 253 | 254 | 最大阶数 255 | 256 | 257 | 258 | 259 | 260 | 261 | 262 | 60 263 | 16777215 264 | 265 | 266 | 267 | 268 | 1 269 | 270 | 271 | 272 | 273 | 2 274 | 275 | 276 | 277 | 278 | 3 279 | 280 | 281 | 282 | 283 | 4 284 | 285 | 286 | 287 | 288 | 5 289 | 290 | 291 | 292 | 293 | 6 294 | 295 | 296 | 297 | 298 | 7 299 | 300 | 301 | 302 | 303 | 304 | 305 | 306 | 307 | 0 308 | 0 309 | 310 | 311 | 312 | 313 | 150 314 | 16777215 315 | 316 | 317 | 318 | 319 | 单因素对各市场 320 | 321 | 322 | 323 | 324 | 相互影响 325 | 326 | 327 | 328 | 329 | 多因素对单市场 330 | 331 | 332 | 333 | 334 | 335 | 336 | 337 | 338 | 339 | 340 | 日期 341 | 342 | 343 | 344 | 345 | 346 | 347 | 有效数字 348 | 349 | 350 | 351 | 352 | 353 | 354 | Qt::Vertical 355 | 356 | 357 | 358 | 20 359 | 40 360 | 361 | 362 | 363 | 364 | 365 | 366 | 367 | 信息准则 368 | 369 | 370 | 371 | 372 | 373 | 374 | 375 | 75 376 | true 377 | 378 | 379 | 380 | 参数设定 381 | 382 | 383 | 384 | 385 | 386 | 387 | 388 | 389 | 390 | 滞后估计数 391 | 392 | 393 | 394 | 395 | 396 | 397 | wald估计数 398 | 399 | 400 | 401 | 402 | 403 | 404 | 模式设定 405 | 406 | 407 | 408 | 409 | 410 | 411 | 412 | 0 413 | 414 | 415 | 416 | 417 | 1 418 | 419 | 420 | 421 | 422 | 2 423 | 424 | 425 | 426 | 427 | 3 428 | 429 | 430 | 431 | 432 | 4 433 | 434 | 435 | 436 | 437 | 5 438 | 439 | 440 | 441 | 442 | 443 | 444 | 445 | 446 | AIC 447 | 448 | 449 | 450 | 451 | BIC 452 | 453 | 454 | 455 | 456 | 457 | 458 | 459 | Qt::Vertical 460 | 461 | 462 | 463 | 20 464 | 40 465 | 466 | 467 | 468 | 469 | 470 | 471 | 472 | 473 | 474 | Qt::Horizontal 475 | 476 | 477 | 478 | 40 479 | 20 480 | 481 | 482 | 483 | 484 | 485 | 486 | 487 | 488 | 489 | toolBar 490 | 491 | 492 | Qt::ToolButtonTextUnderIcon 493 | 494 | 495 | TopToolBarArea 496 | 497 | 498 | false 499 | 500 | 501 | 502 | 503 | 504 | 505 | 506 | 507 | 508 | 509 | 510 | 511 | 512 | :/icons/images/122.bmp:/icons/images/122.bmp 513 | 514 | 515 | 导入数据 516 | 517 | 518 | true 519 | 520 | 521 | 522 | 523 | 524 | :/icons/images/724.bmp:/icons/images/724.bmp 525 | 526 | 527 | 开始运行 528 | 529 | 530 | 531 | 532 | 533 | :/icons/images/206.bmp:/icons/images/206.bmp 534 | 535 | 536 | 初始化 537 | 538 | 539 | 540 | 541 | 542 | :/icons/images/400.bmp:/icons/images/400.bmp 543 | 544 | 545 | 最小化 546 | 547 | 548 | 549 | 550 | 551 | :/icons/images/324.bmp:/icons/images/324.bmp 552 | 553 | 554 | 终止运行 555 | 556 | 557 | 558 | 559 | 560 | :/icons/images/406.bmp:/icons/images/406.bmp 561 | 562 | 563 | 查看数据 564 | 565 | 566 | 567 | 568 | 569 | :/icons/images/728.bmp:/icons/images/728.bmp 570 | 571 | 572 | QVAR估计 573 | 574 | 575 | 576 | 577 | 578 | 579 | 580 | 581 | --------------------------------------------------------------------------------