This project provides a GARCH hyperparameter grid search optimizer using Optuna.
GARCH-Models-Hyperparameter-Optimizer/
│
├── garch_optimizer/
│ ├── __init__.py
│ └── garch_optimizer.py
│
├── tests/
│ ├── __init__.py
│ └── test_garch_optimizer.py
│
├── Analysis.ipynb # Jupyter notebook
│
├── setup.py
├── requirements.txt
├── LICENSE
└── README.md
garch_optimizer/
: Contains the main code for GARCH hyperparameter optimization. The core functionality is implemented ingarch_optimizer.py
.tests/
: Includes unit tests to verify the correctness of the optimizer. Thetest_garch_optimizer.py
file contains test cases for the GARCH optimizer.Analysis.ipynb
: A Jupyter notebook demonstrating how the GARCH optimizer works, with examples and visualizations.setup.py
: Handles the packaging and installation of the project, specifying dependencies and metadata.requirements.txt
: Lists the required Python packages needed to run the project.LICENSE
: The license under which the project is released.README.md
: The main documentation file providing an overview of the project, installation instructions, and usage examples.
Ensure you have the necessary packages installed. You can install them using pip:
pip install -r requirements.txt
Import the garch_parameter
function from the garch_optimizer
module and use it to find the best GARCH model parameters:
from garch_optimizer.garch_optimizer import garch_parameter
# Sample data for testing
import pandas as pd
import numpy as np
np.random.seed(42)
data = pd.Series(np.random.randn(100))
best_params = garch_parameter(
data=data,
max_p=3,
max_q=3,
n_trials=200
)
print(best_params)
To run the tests, use the following command:
python -m unittest discover
Feel free to submit issues or pull requests to enhance the project.
This project is licensed under the MIT License - see the LICENSE file for details.
Thank you for visiting my GitHub profile! Feel free to reach out if you have any questions or opportunities to collaborate. Let's connect and explore new possibilities together!