๐ Fuzzy Expert System for Stock Portfolio Selection ๐ค
- ๐ Overview
- This project implements a novel Fuzzy Expert System ๐ง designed for optimal stock portfolio selection. The system leverages fuzzy logic and Dempster-Shafer (DS) theory ๐ for rule construction, along with Ant Colony Optimization (ACO) ๐ for model optimization. The primary goal is to allocate investor assets among various stocks to maximize returns ๐ while minimizing risk ๐.
๐Live Demo
https://fuzzy-expert-system-stock-bse-jrvxwcszcx8mkawrk4rs5l.streamlit.app/
๐ฏ Key Features
- ๐งฉ Fuzzy Rule Construction using DS-Theory: Implements Dempster-Shafer theory to handle uncertainty and combine evidence from multiple factors efficiently, reducing implementation time and cost โฑ๏ธ๐ฐ.
- ๐ฏ Defuzzification: Converts fuzzy output into crisp values for actionable investment decisions โ
.
- ๐ Optimization using ACO: Utilizes Ant Colony Optimization to maximize the objective function: (fuzzy portfolio return - risk free return) / weighted mean semi-variance ๐โ.
โ๏ธ How It Works
- ๐ฅ Input Processing: The system takes stock data and applies fuzzy logic to handle imprecise or uncertain information.
- ๐ง Rule Construction: Using Dempster-Shafer theory, rules are constructed to combine evidence from the listed factors.
- ๐ฏ Defuzzification: The fuzzy outputs are converted into crisp values to determine the optimal stock allocation.
-
๐ Optimization: ACO is applied to refine the model, ensuring maximum return with minimal risk.
๐ Global Applicability ๐
As the outcome of this model found to be satisfactory โ
, this can be implemented for any stock exchanges around the world ๐ but the selection of critical factors may vary over different stock exchanges. This fuzzy expert system model can be used to rank any set of alternatives based on the factors influencing them.
๐ฎ Future Enhancements & Research Directions
- ๐ Integration of expert system on integrated data of assets from different stock exchanges and mutual funds ๐ค.
- ๐ Alternative Optimization Algorithms: Researchers can use other meta-heuristic algorithms such as:
- Simulated Annealing ๐ฅ
- Tabu Search ๐ซ
- Particle Swarm Optimization ๐ฆโ๐ฅ
- Genetic Algorithm ๐งฌ
- ๐ Enhanced Visualization tools for results interpretation ๐โก๏ธ๐.
- โฐ Real-time Data Feeds integration for live analysis ๐ก.
๐ Dynamic Stock Portfolio Selection & Optimization System
๐ Powered by Dempster-Shafer Fuzzy Expert System (DS-FES) & Ant Colony Optimization (ACO)
๐ Project Overview
This repository contains an industry-grade Decision Support System (DSS) for automated stock ranking and portfolio optimization within the Bombay Stock Exchange (BSE). By replacing traditional, subjective expert consensus methods (like the Fuzzy Delphi Method) with data-driven Grey Relational Analysis (GRA), this system processes a decade-long financial dataset dynamically to identify high-return, low-risk investment configurations under real-world market uncertainties.
๐ ๏ธ System Architecture & Framework
The application architecture is divided into four main soft computing pipelines:
- Feature Selection (GRA Framework): Evaluates multi-dimensional financial parameters (such as Diluted EPS, Profit Margin, Price-to-Book Value, and Debt-to-Equity Ratio) to filter out information redundancies using a correlation mask.
- Fuzzification Module: Maps crisp normalized corporate indicators to linguistic categories (Low, Standard, High) utilizing statistical percentile bounds through custom Trapezoidal Membership Functions.
- Automated Synthesis Engine (DS Theory): Automatically generates a comprehensive base of 81 rules using Dempster-Shafer Rule of Combination, eliminating manual rule-writing bottlenecks.
- Portfolio Optimizer (Continuous ACO Solver): Maximizes the Modified Sharpe Ratio against downside semi-variance variations using an interactive Ant Colony Heuristic to output perfect capital weight proportions.
๐ Core Application Features & Tab Structures
โก Tab 1: Real-Time Simulation Panel
- Run-Time Parameter Modulation: Provides a direct testing workspace where users can manually input present-time custom return and risk configurations.
- Instant Re-weighting Solver: Automatically triggers the background ACO array script upon value changes to show immediate budget redirection behavior.
๐ Tab 2: Predictive Success Analytics
- Empirical Backtesting Track: Displays predictive hit-ratio validation trend line scores across several financial years (FY23 to FY26).
- soft Computing Evaluation Matrix: Validates structural performance and parameter efficiency logs against real historical market cycles.
๐ How to Run the Workspace
๐ง 1. Prerequisites Setup
Ensure you have Python installed on your local workstation environment, then run the terminal installation command:
```bash
pip install -r requirements.txt
๐ Usage
To use this system, provide stock data corresponding to the factors listed above. The model will process the inputs and output a recommended portfolio allocation.
๐ License
This project is licensed under the MIT License. See the LICENSE file for details.