Next Article in Journal
Optimizing a Machine Learning Algorithm by a Novel Metaheuristic Approach: A Case Study in Forecasting
Previous Article in Journal
The Influence of Fine Distribution and Compensation on Cooperation in Public Goods Game
 
 
Font Type:
Arial Georgia Verdana
Font Size:
Aa Aa Aa
Line Spacing:
Column Width:
Background:
Article

Particle Swarm Optimization Algorithm for Determining Global Optima of Investment Portfolio Weight Using Mean-Value-at-Risk Model in Banking Sector Stocks

1
Magister Program in Mathematics, Faculty of Mathematics and Natural Sciences, Universitas Padjadjaran, Jatinangor, Sumedang 45363, Indonesia
2
Department of Mathematics, Faculty of Mathematics and Natural Sciences, Universitas Padjadjaran, Jatinangor, Sumedang 45363, Indonesia
*
Author to whom correspondence should be addressed.
Mathematics 2024, 12(24), 3920; https://doi.org/10.3390/math12243920
Submission received: 16 November 2024 / Revised: 10 December 2024 / Accepted: 10 December 2024 / Published: 12 December 2024

Abstract

:
Computational algorithms are systematically written instructions or steps used to solve logical and mathematical problems with computers. These algorithms are crucial to rapidly and efficiently analyzing complex data, especially in global optimization problems like portfolio investment optimization. Investment portfolios are created because investors seek high average returns from stocks and must also consider the risk of loss, which is measured using the value at risk (VaR). This study aims to develop a computational algorithm based on the metaheuristic particle swarm optimization (PSO) model, which can be used to solve global optimization problems in portfolio investment. The data used in the simulation of the developed computational algorithm consist of daily stock returns from the banking sector traded in the Indonesian capital market. The quantitative research methodology involves formulating an algorithm to solve the global optimization problem in portfolio investment with mathematical calculations and quantitative data analysis. The objective function is to maximize the mean-value-at-risk model for portfolio investment, with constraints on the capital allocation weights in each stock within the portfolio. The results of this study indicate that the adapted PSO algorithm successfully determines the optimal portfolio weight composition, calculates the expected return and VaR in the optimal portfolio, creates an efficient frontier surface graph, and establishes portfolio performance measures. Across 50 trials, the algorithm records an average expected return of 0.000737, a return standard deviation of 0.00934, a value at risk of 0.01463, and a Sharpe ratio of 0.0504. Further evaluation of the PSO algorithm’s performance shows high consistency in generating optimal portfolios with appropriate parameter selection. The novelty of this research lies in developing an accurate computational algorithm for determining the global optima of mean-value-at-risk portfolio investments, yielding precise, consistent results with relatively fast computation times. The contribution to users is an easy-to-use tool for computational analysis that can assist in decision-making for portfolio investment formation.
MSC:
05C85; 90C26; 91G10; 91G70

1. Introduction

Algorithms are well-defined computational steps that play a crucial role in solving a wide range of problems, from simple to complex ones. For example, algorithms are employed to solve differential equations, non-convex optimization problems, and numerical optimization problems [1,2,3]. This asserts that optimization, as the effort to find the best solution to a problem, can be simplified through computational algorithms [4].
Global optimization is a critical research field focusing on finding the best solution from the entire solution set for a given problem [5]. However, solving global optimum issues, even for simple cases, can take hours or even days [6]. In this context, computational algorithms are pivotal to enhancing the speed and accuracy of global optimum searches for various problems [7,8].
One of the frequently encountered issues today is the problem of investment portfolio selection. Investment involves allocating capital to a company or project with the expectation of obtaining optimal returns within a specified period. Faced with market fluctuations, investors must select a portfolio that maximizes the expected returns and manages the risks at an acceptable level [9].
Globally optimized investment portfolios are an essential aspect of financial management, aiming to balance risk and return effectively. Proper portfolio optimization, with accurate assessment, focuses on asset allocation strategies that can address uncertainty and maximize the expected returns at an acceptable risk level [10].
One approach to selecting an optimal portfolio is the mean-value-at-risk (mean-VaR) model. The value at risk (VaR) is a method for measuring risk by estimating the maximum potential loss that could occur in an investment portfolio over a given period at a certain confidence level [11]. VaR calculations utilize potential loss estimates based on historical data and statistical models, considering volatility and asset correlations [12]. The VaR offers a simple approach to measuring and managing portfolio risk, making it a frequently used tool in portfolio selection. However, the VaR has limitations that may affect its effectiveness in risk estimation. These limitations arise from the reliance on historical data, assumptions concerning the return distribution, and the need for more information about the magnitude of potential losses. Computational algorithms can comprehensively address these limitations and account for additional risk factors [11].
Research on optimal portfolios using the mean-VaR model has been discussed by Tsao, focusing on portfolio selection based on the efficient frontier of the mean-VaR model. Tsao (2010) found that risk-averse investors may allocate their wealth inefficiently if their decisions are based on the mean variance framework. Therefore, investors should base their investment decisions on the efficient frontier of the mean-VaR model [13]. Furthermore, Zhang and Liu researched a firework algorithm for the mean-VaR/CVaR model. Zhang and Liu demonstrated that the algorithm outperformed the genetic algorithm regarding accuracy, speed, and solution stability. However, further testing is required to evaluate the improved algorithm’s efficiency and application to general optimization problems [14].
Jiang et al. explored a multi-objective bat algorithm based on credibility for a multi-period mean-VaR portfolio optimization problem. Jiang et al. (2021) found that the bat algorithm had better accuracy, diversity, and distribution than others. However, the algorithm may not apply to all market conditions [15]. Moreover, Babazadeh and Esfahanipour investigated a new multi-period mean-VaR optimization model that considers practical constraints and transaction costs. Their study revealed that the developed NSGA-II algorithm outperformed the original NSGA-II in terms of well-known metaheuristic performance metrics. Although metaheuristic algorithms are efficient, optimal design and customization are still required for successful implementation [16].
Several gaps exist based on previous research, such as the need for further development of the algorithms used. To address these gaps and fill the identified research gaps, this study aims to develop an efficient computational algorithm for determining the global optima of an investment portfolio using the mean-VaR model, which is applicable to various market conditions. The computational algorithm developed in this research is expected to effectively decide the global optimization of mean-value-at-risk investment portfolios and could serve as a reference for investors.

2. Literature Review

2.1. Computational Algorithms

A computational algorithm is a set of logical, structured, and systematic steps used to solve a problem or complete a specific task in computation or computer programming. Computational algorithms are at the core of every computer program, as they determine how tasks are processed and completed [17].
The key characteristics of computational algorithms include the following:
  • Input: The algorithm accepts the input data or information required to solve the problem.
  • Process: The algorithm applies a series of logical steps and operations to process the input and generate the desired output.
  • Output: The algorithm produces an output or final result representing the solution to the problem.
  • Efficiency: A good algorithm should efficiently use time, memory, and storage space.
  • Correctness: The algorithm must produce accurate and correct results that align with the given problem.
  • Termination: The algorithm must terminate after a finite number of steps; it should not run indefinitely without an end.
Computational algorithms can be written in various forms, such as pseudocode, flowcharts, or specific programming languages. These algorithms are applied across multiple fields, including data processing, image processing, cryptography, artificial intelligence, and scientific computing. Each representation helps clarify the algorithm’s logic and steps, making it easier to implement and analyze in different contexts.
Algorithms help organize, analyze, and extract valuable insights from large datasets. In image processing, they are used for tasks such as image enhancement, recognition, and compression. Cryptography relies on algorithms to secure communication and protect sensitive data. Artificial intelligence and machine learning algorithms enable systems to learn from data and make decisions autonomously. Lastly, in scientific computing, algorithms are fundamental to solving complex mathematical models and simulations in physics, biology, and engineering.

2.2. Particle Swarm Optimization

Particle swarm optimization (PSO) is based on the behavior of a flock of birds or a school of fish. The PSO algorithm mimics the social behavior of these organisms. Social behavior consists of individual actions and the influence of other individuals within a group. The term “particle” refers to, for example, a bird in a flock of birds. Each individual, or particle, behaves by using its intelligence and is also influenced by the collective behavior of the group [18].
In the context of PSO, particles move through a multi-dimensional search space, adjusting their positions based on both their own previous experiences (personal best) and the experiences of other particles (global best). This process is repeated iteratively, allowing the particles to converge toward the optimal solution for a given problem, with the collective intelligence of the swarm guiding the search process.
Thus, the behavior of a flock of birds is based on a combination of three factors: cohesion, separation, and alignment. PSO is developed based on the following three models:
  • When an object approaches the target (minimum or maximum of an objective function), it quickly sends information to other objects in a particular group.
  • Other objects will follow the direction toward the target rather than directly.
  • A component that depends on each object’s behavior is its memory of past events.
In the PSO algorithm, the search for solutions is conducted by several particles from a population. The population is randomly initialized with a specified maximum and minimum values range. Each particle represents a position or solution to the problem at hand. Each particle seeks the optimal solution by moving through the search space, adjusting its position toward the best position it has encountered (local best) and the best position found by the entire swarm (global best). Thus, the spread of experience or information occurs within each particle and between a particle and the best particle of the whole swarm during the search process. Subsequently, the search continues to find the best position for each particle over several iterations until a relatively stable position is reached or the predefined iteration limit is reached. In each iteration, the performance of each solution, represented by the particle’s position, is evaluated by inserting that solution into a fitness function. Each particle is treated as a point in a specific dimensional space. Two factors define the particle’s status in the search space: the particle’s position and the particle’s velocity [18].
The mathematical formulation that describes the position and velocity of a particle in a specific dimensional space is as follows:
X i t = x i 1 t , x i 2 t , , x i N t ,
V i t = v i 1 t , v i 2 t , , v i N t ,
where X represents the particle’s position, V is the particle’s velocity, i is the particle index, and N is the dimensional space size. The mathematical model that describes the calculation of particle iteration is as follows:
V i t = V i t 1 + c 1 r 1 p b e s t i X i t 1 + c 2 r 2 g b e s t X i t 1 ,
X i t = V i t + X t 1 ,
where p b e s t represents the best position of the i-th particle, while g b e s t represents the best position of the entire swarm. c 1 and c 2 are constants known as learning factors, while r 1 and r 2 are random numbers with values between 0 and 1.
In the particle swarm optimization algorithm, c 1 and c 2 control the influence of the particle’s best position (local best) and the swarm’s best position (global best) on the particle’s movement. c 1 (cognitive coefficient) regulates how much the particle’s best position affects its movement, while c 2 (the social coefficient) controls how much the swarm’s best position influences the particle’s movement. Additionally, r 1 and r 2 are random numbers between 0 and 1 that introduce an element of uncertainty and variation into the particle’s movement. These random numbers add an exploration element to the search for solutions, allowing particles to avoid getting trapped in local solutions and enhancing their ability to explore the search space more effectively.
Equations (3) and (4) can be used to update each particle’s best position and the entire swarm’s best position.
p b e s t i t + 1 = p b e s t i t , if   f X i t + 1 f p b e s t i t p b e s t i t + 1 , if   f X i t + 1 > f p b e s t i t ,
g b e s t t + 1 = max x i 1 t + 1 , x i 2 t + 1 , , x i N t + 1 .
The iteration of each particle continues until the stopping criteria are met. In this case, the stopping criteria used are when the particle converges to a value or after reaching the predefined iteration limit. The convergence criterion of the particle can be checked using the formula in Equation (5).
f X i t + 1 f X i t < ϵ f ,         i ,
where f X i t is the fitness value of the i-th particle at iteration t , and ϵ f is the convergence threshold for the fitness value. The fundamental steps of the particle swarm optimization (PSO) algorithm are summarized in Algorithm 1. This pseudocode outlines the initialization process, the update of particle velocities and positions, and the termination criteria commonly used in PSO implementations.
Algorithm 1. Pseudocode for basic particle swarm optimization algorithm
  • Initialize parameters, such as the inertia weight (w), cognitive coefficient (c1), social coefficient (c2), and convergence criteria
  • Initialize each particle:
    -
    Assign a random initial position within the search space
    -
    Assign a random initial velocity
    -
    Set the initial personal best position (pbest) to the particle’s starting position
    -
    Evaluate the fitness of each particle’s pbest
  • Determine the initial global best (gbest)
    -
    Set gbest as the best pbest among all the particles
  • Loop until the stopping criteria are met (e.g., maximum iterations or convergence):
    -
    For each particle:
    • Update the particle’s velocity using Equation (1)
    • Update the particle’s position using Equation (2)
    • Evaluate the fitness of the particle’s new position.
    • If the new position is better than the current pbest, update pbest
    -
    Update gbest if any particle’s pbest is better than the current gbest, as in Equation (3).
  • Return gbest as the optimal solution
Several key challenges are commonly encountered when designing and implementing computational algorithms. One is the algorithmic complexity in terms of both the computational time and the memory requirements, where inefficient algorithms can lead to poor performance when faced with large-scale problems. Scalability also becomes a challenge, as the algorithm must scale well when handling the growth of data or problems [19]. Algorithm optimization to improve the computational time efficiency, memory usage, or other resources is another challenge that often requires in-depth analysis and the application of specialized techniques [7].

2.3. Global Optimization

Optimization models are a systematic approach to decision-making aimed at finding the best or optimal solution to a problem while considering existing constraints [20]. The primary objective of optimization is to maximize the benefits obtained with minimal effort. As shown in Figure 1, if the point x corresponds to the minimum value of a function f ( x ) , then that point also corresponds to the maximum value of the negative of the function, f ( x ) [21].
In general, an optimization problem is formulated as follows:
Find,
x = x 1 x 2 x n ,
which can minimize or maximize the value of a function f x , such that the following constraint equations are satisfied:
g j x 0 ,                           j = 1 , 2 , , m ,
  h i x = 0 ,                             i = 1 , 2 , , p .
Global optimization is a branch of mathematical optimization focused on finding the overall (global) optimal solution of a given objective function by considering all the possible solutions within the search space. This contrasts with local optimization, which only focuses on finding an optimal solution within a local region or around a specific initial value [22].
Definition 1 
(global maximum [23]). A global maximum x ^ X of an objective function f : X R is an input element such that f x ^ f ( x ) for every x X .
Definition 2 
(global minimum [23]). A global minimum x ˇ X of an objective function f : X R is an inout element such that f x ˇ f ( x ) for every x X .
Definition 3 
(global optimum [23]). A global optimum x * X of an objective function f : X R is either a global maximum or a global minimum.

2.4. Portfolio Investment Model

An investment portfolio model is a theoretical framework and methodology used to construct and manage a collection of investment assets to achieve an optimal balance between the expected risk and return. These models provide guidance and techniques for determining optimal asset allocation, assessing portfolio risk, and measuring investment performance [24]. Generally, investment portfolio models are built upon certain assumptions about the characteristics and behaviors of financial markets, such as the asset return distribution, asset correlations, and factors affecting asset returns.
The primary goal of an investment portfolio model is to maximize the expected returns for a given level of risk or to minimize the risk for a given expected return [10]. The risk in an investment portfolio is typically measured using metrics like the variance, standard deviation, or other risk measures consistent with the assumptions and characteristics of the model employed.
Investors can benefit from stock investments through capital gains (the difference between the selling price and the purchase price of the stock) and dividends (a company’s profit distribution to shareholders) [9].

Return and Risk

The stock return is the rate of return that investors receive from their stock investments. Generally, stock returns have two main components: capital gains and dividends. The capital gain is the profit earned from the positive difference between a stock’s buying and selling prices. The higher the selling price relative to the purchase price, the larger the investor’s capital gain. Meanwhile, dividends are portions of a company’s profits distributed to shareholders. The amount of dividend paid depends on the company’s policy and is typically disbursed periodically. There are several types of stock return rates, but this research primarily emphasizes simple returns and continuous compound returns [25].
The calculation of the asset return for a single period, from period t 1 to period t , results in the gross return as follows:
1 + R t = P t P t 1   atau   P t = P t 1 1 + R t .
From Equation (6), the simple return is obtained as follows:
R t = P t P t 1 1 = P t P t 1 P t 1 ,
where P t represents the gross return for a single period and R t represents the simple return for a single period. Meanwhile, the continuous compound return (log return) is derived from the natural logarithm of the gross simple return of an asset.
r t = ln 1 + R t = ln P t P t 1 = p t p t 1 ,
where p t = l n   l n   P t , and r t represents the continuous compound return (log return).
Risk is the likelihood of experiencing loss or unfavorable outcomes in any activity, including investments. Generally, risk can arise from various sources, such as changes in economic conditions, political events, natural disasters, and human error. In finance, risk refers to the potential variation in investment returns, whether positive or negative. Investors face risk when aiming for higher returns, making risk management essential to minimize possible losses.
In investment management, risk reflects how much the actual return deviates from the expected return. The more significant the difference between the actual and expected returns, the higher the risk [26]. To understand the risks resulting from uncertainty, investors need to grasp probability distributions:
V a r i a n c e   σ 2 = i = 1 n R i E R 2 · X i ,
where R i represents the actual of asset i , E ( R ) denotes the expected return, and X i represents the probability of event i .
Stock returns can be modeled as random variables at time t . If R t is the distribution with a probability density function denoted by f ( r t ) , the expected return of a stock can be defined as shown in Equation (10):
μ A = E R A , t = r A , t f r A , t d r A , t ,
where μ A is the expected return of stock A , r A , t is the return of stock A at time t , and f ( r A , t ) is the probability density function of stock A’s return distribution.
The estimation of the variance of a stock can be defined as in Equation (11):
μ A = E R A , t = r A , t f r A , t d r A , t = E R A , t 2 E R A , t 2 2 ,
where σ A 2 is the variance of stock A.
The covariance is a statistical measure that indicates the extent to which two random variables are related [27]. In the context of investments, the covariance is used to evaluate how closely the changes in one investment’s value are related to the changes in the value of another asset. This helps to explain how fluctuations in individual investment returns occur together [28]. The covariance between stocks A and B is defined as follows:
σ A B = E R A , t μ A R B , t μ B , = r A , t μ A r B , t μ B f r A , t , r B , t d r A , t d r B , t = E R A , t , R B , t μ A μ B ,      
where σ A B is the covariance between stock A and stock B , μ A is the expected return of stock B , r A , t is the return of stock A at time t , r B , t is the return of stock B at time t , f ( r A , t ) is the probability density function of stock A ’s return distribution, and f ( r B , t ) is the probability density function of stock B ’s return distribution.

2.5. Burr (4P) and Log-Logistic (3P) Distribution

2.5.1. Burr (4P) Distribution

The Burr (4P) distribution is a versatile statistical model widely used in fields like finance, engineering, and actuarial science due to its ability to model complex data patterns, including bimodal and heavy-tailed distributions. This flexible distribution accommodates various data shapes, and its parameters can be estimated using methods like the maximum likelihood [29]. Its applications include modeling income data and reliability analysis, particularly for lifetime data and failure rates. However, some researchers suggest that its complexity may lead to overfitting in more straightforward datasets, where simpler models can sometimes remain effective. A continuous non-negative random variable X is considered to follow a Burr (4P) distribution if its probability density function f x and cumulative distribution function F x are defined as given in Equations (13) and (14) [30].
f x = α k x γ β α 1 β 1 + x γ β α k + 1 ,
F x = 1 1 + x γ β α k ,
where k , α , β , and γ are parameters.
To calculate the expectation and variance of data following a Burr distribution, Equations (15) and (16) can be used [31,32].
E X = γ + k β B 1 + 1 α , k 1 α ,
E X 2 E X 2 = k β 2   B 1 + 2 α , k 2 α k 2 β 2   B 2 1 + 1 α , k 1 α ,
where 0 < 1 α < k , k , α , β > 0 , < γ < + , and B b , c represents the beta function.

2.5.2. Log-Logistic (3P) Distribution

The log-logistic (3P) distribution, initially developed by Verhulst (1838) for modeling population growth and later known as the Fisk distribution in economics, is widely used across various fields. It applies to non-negative random variables as a continuous distribution with an unimodal failure rate. Its applications include modeling wealth and income, economic and actuarial science, hydrology flow data, biostatistics for post-transplant survival times, seismic risk estimation, reliability analysis, and daily water consumption forecasting [33]. The probability density function f x and cumulative distribution function F x for the log-logistic distribution are given in Equations (17) and (18).
f x = α β x γ β α 1 1 + x γ β α 2 ,
F x = 1 + x γ β α 1 ,
where α , β , and γ are parameters.
To calculate the expectation and variance of the data following a Burr distribution, Equations (19) and (20) can be used [31].
E X = γ + β B 1 + 1 α , 1 1 α ,
E X 2 E X 2 = β 2 B 1 + 2 α , k 2 α B 2 1 + 1 α , 1 1 α ,
where α , β > 0 , < γ < + , and B b , c represents the beta function.

2.6. Maximum Likelihood Estimation

The maximum likelihood estimation (MLE) method is one of the most popular and frequently used parameter estimation techniques. The main principle of the MLE is to find the parameters that maximize the likelihood function, which is the probability of the observed data given the estimated parameters. The likelihood function is defined as the product of the probability density functions for each data point in the sample equation:
L θ = i = 1 n f x i θ .
To simplify the calculations, the log-likelihood is often used, which is the logarithm of the likelihood function:
l θ = log L ( θ ) = i = 1 n log f x i θ .
The MLE estimate for the parameter θ is the value θ _ that maximizes the log-likelihood function l ( θ ) . This process typically involves solving the first derivative l ( θ ) concerning θ and finding the value of θ that makes this derivative zero [34]. Parameter estimation using the MLE method is efficient because it assumes the data distribution.

2.7. Portfolio

Modern portfolio theory (MPT) provides a more specific framework for understanding risk preferences within the investment context. MPT employs the concepts of the efficient frontier and indifference curves to illustrate how investors with varying risk preferences can select an optimal portfolio aligned with their risk tolerance levels [25]. This theory emphasizes the importance of diversification to mitigate risk without reducing the expected returns while acknowledging the inherent trade-off between risk and return. Through MPT, investors’ risk preferences can be translated into concrete asset allocation strategies, enabling the construction of portfolios that match each investor’s attitude toward uncertainty and potential losses [35]. Thus, understanding risk preferences, as grounded in utility theory and applied through MPT, is crucial for effective investment decision-making that is aligned with an investor’s unique characteristics.
The expected return of a portfolio can be calculated as the sum of the expected returns of each asset, where each return is weighted according to the asset’s proportion within the portfolio. The expected return is calculated using Equation (23):
μ p t = i = 1 n w i μ i t ,
where μ p t represents the expected portfolio return, w i denotes the portfolio weights, and μ is the vector of expected returns within the investment portfolio, which is expressed as follows:
μ = μ 1 μ 2 μ n .
The portfolio risk is a statistical measure known as variance, which describes risk as the variance of returns within a portfolio of stocks. The variance of portfolio returns is defined in Equation (24):
σ p t 2 = w T Σ w ,
The covariance between stocks i and j can be determined using Equation (25):
σ i j = E r i t μ i t r j t μ j t = ρ i j σ i t σ j t ;   i j .
The covariance of the portfolio returns can be expressed in matrix form, incorporating an identity matrix, as shown in Equations (26) and (27):
Σ = σ 11 2 σ 12 σ 1 n σ 21 σ 22 2 σ 2 n σ n 1 σ n 2 σ n n 2 ,
and
I = 1 0 0 0 1 0 0 0 1 .

2.8. Portfolio Optimization Mean-VaR Model

The value at risk (VaR) model is a statistical method for measuring potential losses in an investment with a specified confidence level and over a given time horizon [36]. In other words, it is used to determine the minimum level of potential loss at a certain confidence level.
According to Sukono et al. [37], a normal distribution approach can be used to calculate the value at risk with a weight vector w , as shown in Equation (28):
V a R p t = W 0 μ p t + z α σ p t ,
or
V a R p t = W 0 w T μ + z α w T w 1 2 ,
where W 0 represents the initial weight, and z α is the percentile of the distribution   ( α = 0.05 ) .
The multitude of potential portfolios that can be formed from the available risky assets in the market presents a challenge for investors. Since the number of possible combinations is theoretically infinite, selecting an optimal portfolio becomes a significant challenge for investors. Typically, investors aim to choose an optimal portfolio [38].
When the risk level is measured using the value at risk, the solution sought for the optimization problem becomes:
maximize 2 τ μ p t V a R p t .
Subject   to ,   i = 1 N w i = 1 ,
Using the constraint e T w = 1 , vector Equations (23) and (29), with the assumption that W 0 = 1 unit, the optimization problem in Equation (30) can be rewritten as follows:
maximize 2 τ μ T w + μ T w + z α w T Σ w 1 2 , subject   to ,   e T w = 1 .
The mean variance model, introduced by Markowitz, uses the variance or standard deviation as a measure of the portfolio risk. This approach assumes that the asset returns follow a normal distribution, making it more suitable for investors who focus on symmetric risk volatility. However, in practice, asset return distributions often exhibit non-normal characteristics, such as skewness and kurtosis, making this approach less accurate in addressing extreme risks [32].
In contrast, the mean-VaR model uses the value at risk (VaR) as the risk measure, specifically assessing the maximum loss at a given confidence level. The VaR is more appropriate for investors who want to understand the downside risks (worst-case losses) rather than the general volatility. In other words, the VaR provides a more realistic perspective in risk management, especially for portfolios exposed to significant risks under extreme market conditions.
The advantages of the mean-VaR model in risk management are as follows:
  • Focus on downside risk: The VaR considers potential losses, offering a more relevant tool for conservative risk management.
  • Adaptability to non-normal markets: This model is more flexible in handling asset return distributions that are asymmetric or non-normal.
  • Application in financial regulation: The VaR is widely used by financial institutions and regulators as a standard for measuring portfolio risk exposure.

Reasons for Choosing the Mean-VaR Model

In this study, the mean-VaR model was chosen because it provides a more comprehensive framework for measuring and optimizing the portfolio risk in real-world scenarios. By using this approach, this research offers a more accurate solution for investors facing downside risks, which are often a primary concern, particularly in high-risk assets such as banking stocks.
It is essential to evaluate the portfolio performance to increase the likelihood of achieving investment objectives. Portfolio performance measurement can be conducted either before or after making investment decisions [25]. In uncertain conditions, investors can only consider the level of return offered while accounting for risk factors. Therefore, the performance of an investment portfolio is measured based on the return and risk variables.
When the portfolio risk is measured using the value at risk (VaR) ratio, the RVaR metric represents the ratio of the portfolio’s risk premium to its value at risk (VaR). Mathematically, the RVaR is expressed as follows:
R V a R = μ p t μ f V a R p t ,  
where μ p t is the average return of portfolio p at time t , μ f is the average return of the risk-free asset, and V a R p t represents the portfolio’s value at risk p at time t . The highest value of the RVaR ratio determines the portfolio performance.

2.9. Integration of Reinforcement Learning and Generative Approaches in Portfolio Optimization

2.9.1. Relevance of Reinforcement Learning in Investment Portfolios

Research by Jiang et al. (2017) introduced a reinforcement learning (RL)-based framework designed to manage financial portfolios optimally without relying on traditional economic models [39]. This approach leverages deep neural networks such as the CNN, RNN, and LSTM to predict and evaluate portfolio weight adjustments continuously. Its focus on the cryptocurrency market highlights RL’s ability to handle high volatility and non-linear market environments. The framework demonstrated significant returns despite the high transaction costs.
However, a major challenge in RL implementation lies in its reliance on historical market data, which can introduce bias if the data fail to accurately represent current market conditions. Furthermore, RL algorithms often require extensive training time to achieve convergence.
The integration of this concept into portfolio optimization highlights the need to address these challenges, particularly in ensuring that the algorithms adapt to rapidly changing market dynamics. Exploring reinforcement learning can significantly enhance the ability to optimize financial decisions dynamically.

2.9.2. The Role of Generative Models in Investment Portfolios

Cheng and Chen (2023) proposed an alternative framework based on generative models for portfolio construction. This framework applies multi-armed bandit techniques to combine portfolio strategies, including probabilistic approaches and blending methods. The findings showed that strategies incorporating generative copula-based models with objective functions like the Sharpe ratio outperformed individual portfolio strategies. This is particularly relevant in cryptocurrency markets, where the high asset correlations and unstable covariance matrices often pose challenges [40].
Generative models excel in accommodating diverse market conditions through simulations based on historical data and probabilistic parameterization. Moreover, they enhance risk mitigation compared to traditional methods by accurately processing multivariate distributions. Integrating this approach into portfolio management underscores its potential to provide more robust and flexible optimization strategies.

2.9.3. Integration in the Context of Current Research

This concept aligns closely with portfolio optimization using PSO and the mean-VaR model. The RL framework can refine PSO parameterization by incorporating reward mechanisms based on portfolio returns, while generative models can support risk estimation in the mean-VaR framework.
Combining RL and generative methods creates a hybrid approach that addresses market volatility and the limitations of relying solely on historical data. By utilizing RL for dynamic decision-making and generative models for precise risk distribution estimation, portfolio strategies can become more adaptive and resilient. This integration reflects a modernized approach to balancing return maximization and risk management, particularly in environments prone to sudden changes.

3. Materials and Method

3.1. Materials

The focal point of this research is the development and application of computational algorithms aimed at optimizing investment portfolio selection through the mean-value-at-risk (MVaR) model. This study addresses the challenge of creating a practical computational approach regarding the processing speed, accuracy, and reliability when generating optimal portfolios. By focusing on global optima, the proposed algorithm seeks to enhance portfolio performance by balancing the potential returns against the associated risks in a structured manner, thereby offering a robust solution to the complex problem of portfolio optimization.
The empirical data utilized in this study consist of the daily closing prices of stocks from companies in Indonesia’s banking sector. The selection of this dataset is intended to provide a comprehensive view of stock performance within a key economic industry, reflecting both the volatility and the return potential unique to banking stocks in emerging markets. The data were sourced from www.finance.yahoo.com, with data collection commencing on 1 August 2024 to ensure a complete and up-to-date dataset for analysis. For analytical consistency, the data utilized in the optimization span from 1 August 2022 to 1 July 2024, offering a two-year window for studying market trends, seasonal effects, and volatility patterns that may impact portfolio decisions.

3.2. Method

3.2.1. Research Method

The research method employed in this study is a quantitative approach, emphasizing numerical analysis through the application of mathematical and statistical techniques. This research aims to develop a computational algorithm based on particle swarm optimization (PSO) for global portfolio optimization using the mean-value-at-risk (mean-VaR) model.
The research method includes the following steps:
  • Data Collection
    Daily closing price data of banking sector stocks are obtained from reliable sources. These data are then processed to calculate the stock returns, the variances, and the covariance matrix, which will be used in the mean-VaR model.
  • Mean-Value-at-Risk (Mean-VaR) Modelling
    The mean-VaR objective function is formulated using a vector- and matrix-based approach. This model aims to minimize the VaR risk while maximizing the portfolio returns, referring to the distribution parameters of the stock return data.
  • Development of the PSO Algorithm
    The PSO algorithm is employed as a heuristic method to find the optimal portfolio weights. Parameters such as the inertia weight, the learning constants (c1 and c2), and the number of particles are adjusted to achieve the optimal solution.
  • Evaluation of the Algorithm and Optimal Portfolio
    The algorithm’s results are evaluated based on the speed, accuracy, and consistency. The performance of the optimal portfolio is measured using financial metrics such as the expected return, the volatility, and the Sharpe ratio.
This method provides a systematic foundation for producing optimal, data-driven investment decisions.

3.2.2. Research Flow

The research flow is divided into three systematic main stages to achieve the research objectives: developing the PSO algorithm, applying the PSO algorithm using banking sector data, and evaluating the PSO algorithm’s results. The steps for each stage are as follows:
  • Stage 1: Developing the PSO Algorithm for Global Portfolio Optimization
The first stage involves developing a PSO-based computational algorithm to determine global portfolio optimization for banking sector stocks. The steps are as follows:
  • Identify Key Variables for the Computational Algorithm
    Determine the variables used in the algorithm, such as the mean vector ( μ ) , unit vector ( e ) , and covariance matrix.
  • Formulate the Objective Function Using the Mean-VaR Model
    The objective function for the mean-VaR model is formulated using vector- and matrix-based equations to optimize the portfolio returns with controlled risk.
  • Develop the Heuristic PSO Algorithm
    The PSO algorithm is developed to find the optimal solution for the portfolio. This step includes adjusting the PSO parameters, such as the inertia weight ( w ) , the learning constants ( c 1 ,   c 2 ) , and the number of particles.
  • The Mean-VaR
    Implement the Algorithm to Determine the Global Portfolio Optimization
The PSO algorithm is implemented to find the optimal portfolio weights that minimize the VaR risk and maximize the desired returns.
  • Stage 2: Applying the PSO Algorithm Using Banking Sector Data
In the second stage, the developed PSO algorithm is applied using banking sector stock data to determine the portfolio optimization. The steps are as follows:
  • Input Daily Closing Price Data of Stocks
    The daily closing price data of banking sector stocks collected earlier are input into the algorithm to calculate the stock returns.
  • Calculate Stock Return Values
    The stock returns are calculated based on the daily closing price data obtained, using the appropriate formula (e.g., log-return).
  • Test the Distribution Model for Stock Return
    The stock return distribution model is tested using a histogram, and the distribution parameters are calculated. A goodness-of-fit test is conducted to ensure the distribution aligns with the data. Stocks that do not meet the distribution criteria are excluded from the analysis.
  • Calculate Expected Return, Variance, and Covariance
    The expected return, variance, and covariance of the selected banking sector stocks are calculated.
  • Implement the Computational Algorithm for Portfolio Optimization
    The developed PSO algorithm is applied to find the optimal portfolio weights that minimize the risk and maximize the returns for the selected banking sector stocks.
  • Measure the Performance of the Optimal Portfolio
    The portfolio performance is measured using the return levels, the volatility, and the Sharpe ratio to evaluate the efficiency of the generated portfolio.
  • Stage 3: Evaluating the Results of the PSO Algorithm
The final stage involves evaluating the results of the implemented PSO algorithm. In this stage, the PSO algorithm’s performance is measured based on its speed, accuracy, and consistency in generating an optimal portfolio. The steps are as follows:
  • Input Stock Data
    Banking sector stock data are input into the existing program to determine the optimal portfolio using the mean-VaR approach.
  • Experiment with the Developed PSO Algorithm
    Two experiments are conducted to evaluate the algorithm’s performance:
    • Experiment 1: The PSO algorithm is tested by conducting 50 trials to assess the consistency of its results. This experiment aims to ensure the algorithm reliably converges to a similar optimal solution across multiple runs.
    • Experiment 2: The impact of different parameter settings for the PSO algorithm is investigated. Several values of key parameters, such as the cognitive coefficient ( c 1 ) , social coefficient ( c 2 ) , and inertia weight ( w ) , are tested to observe how they affect the optimization process and the quality of the portfolio generated.
  • Analyze Performance Results
    The experimental results are evaluated based on three main metrics: speed, accuracy, and consistency. Insights from the two experiments are analyzed to identify the best parameter settings and ensure reliable algorithm performance. If any weaknesses are identified, improvements will be made to enhance the algorithm’s efficiency and effectiveness.

4. Results

4.1. PSO Algorithm in Determining the Optimal Portfolio Weight Based on the Mean-VaR Model

In determining the optimal portfolio weights based on the mean-VaR model, the particle swarm optimization (PSO) algorithm offers a population-based approach capable of exploring solutions globally, making it suitable for application in portfolio investment contexts requiring asset weight optimization.
To understand how PSO functions in searching for optimal solutions in portfolio optimization problems, one can start by manually simulating its process. A manual simulation illustrates the essential workings of the PSO algorithm, in which particles are randomly initialized and subsequently move toward the optimal solution based on velocities and positions updated iteratively. This manual simulation provides insights into the mechanisms behind the PSO algorithm in determining the optimal portfolio weights, as demonstrated in Algorithm 2.
Algorithm 2. PSO algorithm for determining the global optima of the investment portfolio weight using the mean-value-at-risk model
  • Parameter initialization
    1.1.
    Initialize PSO parameters
    -
    Number of particles (NW)
    -
    Maximum iteration (Imax)
    -
    Inertia (w)
    -
    Cognitive coefficient (c1)
    -
    Social coefficient (c2)
    -
    Initial tolerance value, τ = 0
    1.2.
    Initialize parameters in the optimization problem
    -
    Mean vector (μ)
    -
    Covariance matrix ( Σ )
    -
    Unit vector (e)
    -
    Distribution percentile value ( z α )
    1.3.
    Calculate the inverse of matrix Σ , denoted as Σ 1
    1.4.
    Define the objective function as a combination of the return, risk, and constraints
  • Looping for τ values
    2.1.
    For   ( τ = 0 ; τ < 1.6 ; τ = τ + 0.05 ) :
    -
    Calculate λ using the quadratic equation:
    e T Σ 1 e λ 2 + 2 τ + 1 e T Σ 1 μ + μ T Σ 1 e λ + 2 τ + 1 2 μ T Σ 1 μ z α 2 = 0 ,
    From this equation, obtain:
    a : = e T Σ 1 e b : = 2 τ + 1 e T Σ 1 μ + μ T Σ 1 e c : = 2 τ + 1 2 μ T Σ 1 μ z α 2
    -
    If  ( b 2 4 a c < 0 ) :   set   λ : = 0
    2.1.1.
    PSO initialization
    -
    Initialize the particle position
    w i 0 = r w i ( 1 ) , r w i ( 2 ) , , r w i ( 9 ) T
    using random numbers with a Dirichlet distribution,
    r w i ( j ) ,   j = 1 , 2 , , 9
    -
    Initialize the particle velocity,
    v i 0 = r v i ( 1 ) , r v i ( 2 ) , , r v i ( 9 ) T
    using random numbers with a uniform distribution,
    r v i ( j ) ,   j = 1 , 2 , , 9
    2.1.2.
    Calculate and evaluate the objective function
    2.1.2.1.
    For  ( i = 1 ; i < N W ; i = i + 1 ):
    calculate,
    f w i ( 0 ) = 2 τ + 1 μ T w i ( 0 ) + z α w i 0 T Σ w i ( 0 ) 1 2 + λ w i 0 T e 1
    2.1.2.2.
    Set the personal best position (pbest)
    p b e s t = w 1 0 , w 2 0 , , w N W 0 T
    2.1.2.3.
    Set the global best position (gbest)
    g b e s t = w best ,   where ,
    w b e s t = arg max w i   f w 1 0 , f w 2 0 , , f w N W 0
    2.1.2.4.
    Set the global best score (Gbest)
    G b e s t = f ( w b e s t )
    2.1.3.
    Update the velocity and position of particles
    Initialize: c o n d i t i o n 1 = F a l s e ,   i t e r = 1
    While  c o n d i t i o n 1 = = F a l s e   o r   i t e r < I m a x
    -
    Generate random number r 1 , r 2 0 , 1
    2.1.3.1.
    For  ( i = 1 ;   i < N W ; i = i + 1 ):
    -
    Update the particle velocity,
    v i i t e r = w v i i t e r 1 + c 1 r 1 p b e s t i w i i t e r 1 + c 2 r 2 g b e s t w i i t e r 1
    -
    Update the particle position,
    w i i t e r = v i i t e r + w i i t e r 1
    -
    Define w i i t e r : = w i i t e r × 1 T o t a l w i i t e r
    -
    Update the pbest value and position
    If  w i i t e r > f ( p b e s t i ) ;
    p b e s t i : = w i i t e r ;
    -
    Update the gbest position and Gbest value
    g b e s t ( i t e r ) : = w b e s t
    where
    w b e s t = arg max pbest i   f p b e s t 1 , f p b e s t 2 , , f ( p b e s t N w )
    G b e s t ( i t e r ) : = f ( w b e s t )
    2.1.3.2.
    If  | G b e s t ( i t e r ) G b e s t ( i t e r 1 ) | 10 16
    -
    c o n d i t i o n 1 = T r u e
    -
    Calculate the portfolio expected return ( μ p t )
    μ p t = w T μ
    -
    Calculate the portfolio risk σ p t
    σ p t = w T Σ w
    where w = g b e s t
    -
    Calculate the value at risk V a R p t
    V a R p t = W 0 μ p t + z α σ p t
    with   W 0 = 1
    -
    Calculate the portfolio performance (ratio)
    r a t i o = μ p t V a R p t
    -
    Save the iteration results into a results list (iteration_results)
    2.1.3.3.
    Update the iteration, iter = iter + 1
  • Output
    3.1
    Convert the iteration results list into a DataFrame
    3.2
    Display the iteration results DataFrame
    3.3
    Export the DataFrame to a .csv file

4.2. Application of the PSO Algorithm Using Banking Sector Stock Data

4.2.1. Banking Sector Stock Data

The data analyzed in this study consist of closing stock prices obtained from the website www.finance.yahoo.com. These data were accessed from 1 August 2022 to 30 July 2024. From this source, 33 stocks classified under the banking sector were retrieved. The list of analyzed stocks is presented in Appendix A.
Figure 2 displays the closing price movement of BBCA stock. Overall, the stock price shows a stable upward trend despite some fluctuations. These fluctuations at specific points reflect typical market volatility, possibly caused by changes in economic conditions, monetary policies, or internal company factors. The dotted trend line illustrates a general tendency of positive price movement, although temporary declines occasionally occur. This chart suggests that BBCA stock offers good long-term growth potential, yet caution is necessary due to the risk of short-term fluctuations.

4.2.2. Calculating Stock Return

The daily stock returns are calculated using Equation (8). For example, the return calculation for BBCA stock on 2 August 2022 is as follows:
r t = ln P t P t 1 = ln 7600 7500 = ln 1.01333 = 0.01324 .
The daily return calculations for BBCA stock can be performed using the data in Table 1.
Return calculations are conducted for all the banking stocks used in this study.
Figure 3 shows the daily return chart for BBCA stock over the specified period. This chart illustrates the volatility of the returns fluctuating over time. It reveals periods of high volatility with significant positive and negative spikes. At specific points, the stock return experiences sharp increases, reflecting positive momentum in BBCA’s stock price, while other points display sharp declines, indicating intense selling pressure affecting the stock price.
This fluctuation pattern suggests that BBCA stock undergoes dynamic price movements, reflecting both risks and potential returns for investors. This chart is essential in analyzing the stock risk and return, particularly for determining the optimal strategies for portfolio management.

4.2.3. Fitting and Testing the Stock Return Distribution Model

Next, by using histogram charts of the daily return data for each banking stock, we can determine the distribution model assumption for each stock.
Based on the histogram visualization results, each daily stock return data point approximates a specific distribution model. For example, in Figure 4a, the histogram of BBCA’s stock return chart displays a symmetrical pattern, with most data concentrated around the central value and long tails on both sides, characteristic of the log-logistic distribution.
Meanwhile, in Figure 4b, the histogram of BBTN’s daily return chart shows a symmetric distribution pattern around zero, with most observations concentrated at the center value. This aligns with the characteristics of the Burr distribution, which can model data with a sharp peak and broader tails.
Next, the parameter estimation process for maximizing the values for each stock’s distribution model is performed using the maximum likelihood estimation (MLE) by substituting the probability density function of each distribution model into the likelihood function. For the log-logistic distribution model, the parameter estimation is conducted using the maximum likelihood estimation (MLE). For example, the parameter estimation for BBCA stock is carried out by substituting the log-logistic distribution’s probability density function in Equation (16) into the likelihood function, resulting in:
L x α , β , γ = ln i = 1 n α β x i γ β α 1 1 + x i γ β α 2 , = i = 1 n ln α β + α 1 ln x i γ β 2 ln 1 + x i γ β α .
To ensure the results of each maximum parameter, the first derivative of the log-likelihood function must equal zero for each parameter. The first derivatives concerning each parameter are provided as follows:
  • Derivative for α
    ln L x | α , β , γ α = 0 ,
    i = 1 n 1 α + ln x i γ β 2 1 1 + x i γ β α x i γ β α ln x i γ β = 0 .
  • Derivative for β
    ln L x | α , β , γ β = 0 ,
    i = 1 n 1 β α 1 β + 2 α β x i γ β α 1 + x i γ β α = 0 .
  • Derivative for γ
    ln L x | α , β , γ γ = 0 ,
    i = 1 n α 1 x i γ + 2 α x i γ x i γ β α α 1 + x i γ β α = 0 .
Meanwhile, for the parameter estimation in the Burr (4P) distribution model for BBTN stock, the probability density function of the Burr distribution is substituted into Equation (12) for the likelihood function, yielding:
L x k , α , β , γ = ln i = 1 n a k x i γ β α 1 β 1 + x i γ β α k + 1   , = ln i = 1 n a k β   x i γ β α 1 1 + x i γ β α 1 k , = i = 1 n ln α k β + α 1 ln x i γ β + ( 1 k ) ln 1 + x i γ β α .
To ensure the maximum result for each parameter, the first derivative of the log-likelihood function must be equal to zero for each parameter. The first derivatives concerning each parameter are given as follows:
  • Derivative for k
    ln L x | k , α , β , γ k = 0 ,
    i = 1 n 1 k ln x i γ β α + 1 = 0 .
  • Derivative for α
    ln L x | k , α , β , γ α = 0 ,
    i = 1 n 1 α + 1 k ln x i γ β x i γ β α x i γ β α + 1 + ln x i γ β = 0 .
  • Derivative for β
    ln L x | k , α , β , γ β = 0 ,
    i = 1 n 1 β α 1 β 1 k α x i γ β α x i γ β α + 1 β = 0 .
  • Derivative for γ
    ln L x | k , α , β , γ γ = 0 ,
    i = 1 n α 1 x i γ 1 k α x i γ β α x i γ β α + 1 ( x i γ ) = 0 .
The first derivatives for k , α , β , and γ do not yield direct values for the parameter estimation. Therefore, the parameter estimation is performed using EasyFit 5.6 software. The estimated parameter values are shown in Appendix B.
After obtaining the parameter values, the next step is to conduct a distribution test using the Anderson–Darling (AD) method. The hypotheses used for distribution testing are as follows:
H0. 
Stock returns follow the assumed distribution model.
H1. 
Stock returns do not follow the assumed distribution model.
The criteria for the hypothesis testing state that H 0 is accepted if a stock meets the requirement, i.e., the test statistic A 2 value < the critical table value ( 3.9074 ) . Conversely, if none of the distribution tests meet this requirement (test statistic > table value), for example, using EasyFit, the following test results were obtained for BBCA stock: an AD test statistic of 0.93494 with a table value of 3.9074 at a significance level α = 0.01 . Based on these results, it can be seen that for all three distribution tests, BBCA stock meets the requirement test statistic < table value, confirming that BBCA stock follows a log-logistic distribution.
From the distribution model testing results, 14 out of 33 stocks met the test criteria, i.e., test statistic < table value, so H 0 is accepted. These 14 stocks are thus candidates for inclusion in the stock portfolio selection, as they have been verified to follow a specific distribution, either the Burr (4P) or log-logistic distribution.

4.2.4. Determining the Mean Vector, Unit Vector, and Covariance Matrix Among Selected Stock Returns

The expected return for each stock can be calculated by utilizing the stock returns using the formulas in Equations (14) and (18). Meanwhile, the formulas in Equations (15) and (19) are used to estimate the variance for each stock. The expected return and variance calculations for each stock are adjusted according to their respective distribution models. For example, for BBCA stock with a log-logistic distribution, the expected return is obtained as follows:
  • Log-logistic expected return
    E X = γ + β B 1 + 1 α , 1 1 α , = 0.19579 + 0.19599 B 1 + 1 29.145 , 1 1 29.145 = 0.00058 .
    and the variance of return for the log-logistic distribution can be calculated as:
    E X 2 E X 2 = β 2   B 1 + 2 α , 1 2 α B 2 1 + 1 α , 1 1 α , = 0.19599 2 B 1 + 2 29.145 , 1 2 29.145 B 2 1 + 1 29.145 , 1 1 29.145 , = 0.000150 .
    For the BBTN stock, which follows the Burr (4P) distribution, the following is obtained:
  • The expected return for the Burr (4P) distribution
    E X = γ + k β   B 1 + 1 α , k 1 α , = 2.5887 + 0.60647 2.582   B 1 + 1 353.49 , 0.60647 1 353.49 , = 0.00023 .
    and the variance of return for the Burr (4P) distribution can be calculated as:
    E X 2 E X 2 = k β 2   B 1 + 2 α , k 2 α k 2 β 2   B 2 1 + 1 α , k 1 α , = 0.60647   2.582 2   B 1 + 2 353.49 , 0.60647 2 353.49 0.60647 2 2.582 2   B 2 1 + 1 353.49 , 0.60647 1 353.49 , = 0.00028 .
    The results of the expected return and variance calculations for each stock are presented in Table 2.
Based on Table 2, nine stocks show a positive expected return, meaning they are projected to generate profits. For example, BBCA stock has an expected return of 5.80 × 10 4 , indicating potential profitability. On the other hand, five stocks show a negative expected return, meaning they are projected to incur losses.
The variance of the returns presented provides insight into the volatility or risk associated with each stock. A higher variance means more significant uncertainty regarding the actual return, while a lower variance indicates more stable and predictable returns.
Based on this, stocks with positive expected returns are selected as candidates for investment portfolio selection. Table 3 shows the selected stocks.
Next, the covariance of the returns between stocks is calculated using Equation (24). The results of the covariance calculation between stock returns are presented in Table 4.
Based on Table 4, it can be observed that the covariance of the returns between all the stocks is positive. Positive covariance values indicate that the two stocks tend to move in the same direction, meaning that when one stock experiences a return increase, the other stock also tends to rise. For example, the covariance between BBCA and BBNI is 0.000076, indicating a positive but relatively low relationship between the two stocks. This means that the two stocks tend to move together in a similar trend.

Forming the Vectors μ, e, and Σ

The vector μ is a vector with entries that represent the expected return values for each of the selected portfolio stocks, as presented in Table 3, and it is formed as shown in Equation (22). The vector e is a vector with all the entries equal to one, and it is the same size as the vector μ . The vectors μ and e are defined as follows:
μ = 0.0005844 0.0005183 0.0002974 0.0001388 0.0001603 0.0012600 0.0007985 0.0005044 0.0013100 ,                   e = 1 1 1 1 1 1 1 1 1
Next, the calculated covariance values of the stock returns presented in Table 4 are formed as in Equation (25), referred to as the vector Σ . This vector can be seen in Appendix C.

4.2.5. Determining the Optimal Portfolio Weight Proportion Based on the Mean-VaR Model

The PSO algorithm is simulated for several values τ , starting from zero and incrementally increasing until the algorithm stops at the last iteration when at least one stock weight is harmful to a particular value τ . This simulation aims to find the optimal portfolio with positive stock weights, ensuring the portfolio is feasible for implementation. Furthermore, several calculations are performed to support the evaluation of the portfolio performance. The portfolio’s expected return ( μ p t ) is calculated using Equation (22), which measures the portfolio’s average return. Next, the portfolio volatility ( σ p t ) is calculated using Equation (23), which represents the total risk associated with the portfolio. The portfolio risk is also assessed using the value at risk ( V a R p t ), calculated using Equation (28), which estimates the maximum loss that may occur at a certain confidence level. Lastly, the portfolio performance is evaluated using the Sharpe ratio, derived from Equation (31), to assess the portfolio’s efficiency in generating returns relative to the risk taken. The complete results of the simulation and calculations can be found in Appendix D, which shows how variations τ affect the stock weights and overall portfolio performance. The optimal portfolio weights calculation results using the mean-VaR model and PSO can be found in Appendix D.
Appendix D presents the results of the portfolio stock weight optimization using the PSO method for various values τ , representing different calculation scenarios in the optimization process. The first column displays the values of τ and the number of iterations, where each value of τ corresponds to a different iteration count in the PSO. In this study, the first simulation selected τ values in the range 0 τ 2 with an increment of 0.1, and it stopped when at least one weight became negative for a specific value τ . In this simulation, a negative weight for BBTN stock was found at τ = 1.6 . The τ scale was then refined to determine the optimal solution. The second simulation was conducted with τ values in the range of 1.5 τ 1.6 , with an increment of 0.01. The trials continued this way until a precise value τ was obtained with four decimal places.
Based on the results in Appendix D, it can be seen that for a risk tolerance value of τ = 0 , the portfolio’s average return ( μ p t ) is 0.00063, and the risk level ( V a R p t ) is 0.01447, as achieved after 331 iterations in the PSO algorithm. These values represent the minimum average return and V a R of the portfolio. For a risk tolerance value of τ = 1.5224 , the portfolio’s average return is 0.00074, with a risk level of 0.01463. These values correspond to the maximum average return and VaR of the portfolio. τ > 1.5224 Negative weights were found for the values of BBTN stock, such as the weight for BBTN stock is 0.0008 at τ = 1.5225 , rendering it unsuitable for portfolio selection.
Overall, the values provided in Appendix D indicate that an increase in the risk tolerance value leads to an increase in the portfolio’s average return, accompanied by a rise in the risk level.
Figure 5 displays the iteration plot for each value τ in the portfolio optimization process using the PSO method. The horizontal axis represents the VaR of the portfolio, which measures the maximum risk that the portfolio might incur, while the vertical axis shows the portfolio’s expected return ( μ p t ) . Each point on the plot corresponds to the portfolio outcome at a specific iteration for each value τ . The colors in the plot indicate the risk tolerance values τ , ranging from τ = 0 (purple) to τ = 1.5224 (yellow).
Based on the plot in Figure 5, the evolution pattern of the portfolio is observed as τ changes. As τ increases, the portfolio moves toward the upper right, indicating an increase in the expected return and an increase in the risk (VaR) simultaneously. Iterations for lower values τ (from purple to green) are spread out toward the lower part of the graph, showing portfolios with lower returns and relatively controlled risk. In contrast, iterations for higher values of τ (yellow) tend to result in higher returns but with a significant increase in risk. This plot shows how the PSO method iterates and balances the two main factors in portfolio decision-making: the expected return and the risk, as measured through the VaR.
This graph reveals the evolutionary pattern of the portfolio as the risk tolerance parameter ( τ ) changes. Investors can observe that portfolios with lower τ values (represented by purple to green colors) tend to offer lower risks but also lower expected returns, while portfolios with higher τ values (yellow colors) achieve higher returns but with significantly greater risks. Understanding this pattern allows investors to determine their portfolio preferences based on their risk tolerance levels.
Figure 6 represents the efficient portfolio surface in the three-dimensional space, with three main axes: portfolio value at risk ( V a R p t ) , expected return portfolio ( μ p t ) , and tolerance ( τ ) . This surface illustrates the optimal path of the portfolio generated through the particle swarm optimization (PSO) algorithm for various risk tolerance values ( τ ) within the range 0 τ 1.40 . Each point on this surface represents a combination of the expected return ( μ p t ) and risk ( V a R p t ) associated with a specific risk tolerance value. The optimal path displayed shows the points of efficient solutions, where each portfolio offers the best combination of return and risk according to the investor’s preferences.
Investors can select the optimal portfolio that provides the highest ratio between the expected return and risk, often referred to as the Sharpe ratio, which is the main target of the optimization strategy. Once a set of efficient portfolios has been identified, the next crucial step is determining which portfolio composition will yield the highest benefit. Investors typically seek a portfolio that can offer the highest average return while minimizing the level of risk as much as possible. For decision-making, the optimal portfolio is identified as the one that delivers the best trade-off, particularly the portfolio with the highest Sharpe ratio.
This efficient frontier chart further aids in simplifying the process of portfolio selection. It visually guides investors by highlighting the efficient portfolios across various risk tolerance levels. To identify the optimal portfolio, investors can focus on points along the frontier with the maximum Sharpe ratio, representing the most favorable combination of return and risk. For instance, in this study, the optimal portfolio achieves the highest Sharpe ratio at τ = 1.5224 , offering a balance between acceptable risk levels and attractive returns. This visualization underscores the effectiveness of PSO in addressing portfolio optimization challenges.
The Sharpe ratio is a widely recognized metric that evaluates the efficiency of a portfolio by measuring its ability to generate a return relative to the amount of risk taken. The ratio considers volatility as a proxy for risk, with higher values of the Sharpe ratio indicating a more efficient portfolio in terms of return generation. Portfolios with higher Sharpe ratios are better at rewarding investors for the level of risk they assume. Therefore, the portfolio with the highest Sharpe ratio is deemed optimal, as it offers the most favorable trade-off between the expected return and the risk investors are willing to undertake. This selection method ensures that investors choose a portfolio that not only maximizes the return potential but also minimizes the volatility or uncertainty associated with that return. The results of the Sharpe ratio calculations can be seen in Appendix D, and a visual representation of these ratios is provided in Figure 7, allowing for a comprehensive understanding of how the portfolios compare in terms of the risk-adjusted returns.
Based on Figure 7 and Appendix D, the analysis reveals that the optimal portfolio achieves the highest performance relative to the risk with a ratio of average return ( μ p t ) to risk ( V a R p t ) of 0.050378, which occurs at a risk tolerance value of τ = 1.5224 . This optimal portfolio composition results from carefully balancing the return expectations and the risk using the mean-VaR optimization approach.
The optimal portfolio comprises nine banking stocks: BBCA, BBNI, BBRI, BBTN, BDMN, BMRI, BNGA, BRIS, and NISP. The corresponding stock weight vector, which represents the proportion of each stock in the portfolio, is as follows: w =   ( 0.3314 ,   0.0366 ,   0.0062 ,   2 × 10 7 ,   0.1147 ,   0.036 ,   0.232 ,   0.054 , and 0.1891 ) . This distribution of weights indicates that BBCA has the most significant weight in the portfolio at 33.14%, followed by BNGA and NISP with 23.2% and 18.91%, respectively. The remaining stocks, such as BBNI, BBRI, and BDMN, contribute smaller portions to the portfolio.
This optimal portfolio composition yields an average return of 0.00074, representing the expected return over the given investment horizon. Additionally, the portfolio’s risk level, as measured by the value at risk (VaR), is 0.01463. This means that the maximum potential loss in the portfolio, at a specified confidence level, is approximately 1.463% of the portfolio’s value.
A VaR of 1.463% indicates that, under normal market conditions, the likelihood of experiencing losses beyond this percentage is minimal. This risk level is particularly appealing to risk-averse investors, as it signifies that the portfolio exhibits stability and limited exposure to extreme market fluctuations. In practical terms, such a VaR aligns well with investors aiming for predictable returns without significant deviations from the expected performance.
The combination of a relatively high return and manageable risk level makes this portfolio a strong candidate for investors seeking an efficient balance between return and risk. However, it is important to note that the VaR does not account for extreme or rare market conditions, which could result in losses exceeding the estimated threshold.
The results of this optimization process suggest that the chosen portfolio strikes a favorable balance, offering the potential for steady returns while maintaining a level of risk that is within acceptable limits. The analysis further demonstrates the effectiveness of the PSO-based optimization method in selecting an optimal portfolio that meets the investor’s objectives in the context of banking sector stocks.

5. Discussion

The execution of the PSO algorithm was evaluated to assess its performance in solving the optimization problem. A total of 50 algorithm trials were conducted using different initial guesses. For the implementation of the PSO algorithm in portfolio weight optimization, the following device specifications were used:
  • Processor: Intel(R) Core(TM) i3-7020U CPU @ 2.30 Ghz
  • RAM: 4.00 GB
  • Operating system: Windows 11 Pro, 64-bit OS, x64-based processor
  • Storage: SSD WD Green 240 GB dan HDD WD Blue 1 TB
  • GPU: Intel(R) HD Graphics 620
For programming and executing the algorithm, this study utilized Google Compute Engine with the following specifications:
  • Programming language: Python 3
  • Virtual machine RAM: 12.7 GB
  • Storage capacity: 107.7 GB
The specifications of the devices used in this study played a significant role in the success and efficiency of the PSO algorithm. While the primary device had limitations in terms of the physical RAM (4.00 GB), the use of Google Compute Engine, which provided a more powerful virtual machine with 12.7 GB of RAM and ample storage, allowed for faster computation and accommodated the high computational demands of the algorithm. These enhanced resources were significant in handling the large dataset of banking sector stocks and ensuring that the algorithm could perform many iterations without performance degradation.
To evaluate the accuracy of the developed PSO algorithm in optimizing the portfolio using the mean-value-at-risk model, a series of trials with various initial values were conducted. These trials aimed to assess the consistency of the results obtained from the algorithm, particularly in generating an expected return, standard deviation, and the value at risk (VaR) of the optimized portfolio. The results of these trials are presented in Table 5.
Table 5 presents the results of the accuracy tests for the computational algorithm developed using the particle swarm optimization (PSO) method. The tests were carried out 50 times, each with different initial values, to evaluate the accuracy and stability of the algorithm. The primary outcomes from each trial included three critical parameters: portfolio expected return, portfolio standard deviation, and portfolio value at risk (VaR). These values were averaged to overview the algorithm’s performance comprehensively. At the same time, the trial results’ standard deviations indicated how consistently the algorithm produced similar outcomes in each repetition. This evaluation process was essential to ensure the reliability of the PSO method in optimizing the portfolio weights and to assess the algorithm’s robustness under different initial conditions.
The table demonstrates that the average values of the parameters are as follows: the expected return ( μ p t ) is 0.0007369986, the portfolio standard deviation ( σ p t ) is 0.0093421662, the VaR is 0.0146294973, and the Sharpe ratio is 0.0503775769. These results indicate that the algorithm consistently generates stable outcomes with minimal fluctuations. This is further supported by the minimal standard deviations: 3 × 10 9 for μ p t , 7 × 10 9 for σ p t , 9 × 10 9 for V a R p t , and 1.68 × 10 7 for the Sharpe ratio, demonstrating that the PSO algorithm has a high level of accuracy and precision when optimizing the portfolio. The minimal variation in the results between trials suggests that the algorithm is not highly sensitive to changes in the initial values, thereby increasing its reliability in finding the optimal solution.
When evaluating the consistency of the PSO algorithm, it is essential to consider both the execution time and the optimization results. In this study, the consistency was measured from two key perspectives: the stability of the execution time and the consistency of the optimization results. The results show that the PSO algorithm demonstrates stable performance across all the trials in terms of both the execution speed and the quality of the optimized portfolio. These findings suggest that the PSO algorithm, in the context of the mean-value-at-risk model, is reliable and consistent in solving complex optimization problems, which is crucial for practical applications in portfolio management.
Furthermore, the table also provides the execution times for each of the 50 trials, showing the variation in the time required to complete the PSO algorithm for solving the optimization problem. The time for each trial was recorded in seconds, offering insight into the computational efficiency of the algorithm. From the data, it is clear that there is some variation in the execution time across the trials, with the shortest execution time recorded at 25.69 s in trial 15 and the longest time at 27.48 s in trial 30. Despite these variations, the average execution time across all the trials was 26.40 s, reflecting the algorithm’s efficiency in performing the optimization task. While there were some fluctuations in the execution time between trials, the overall consistency in the average time suggests that the PSO algorithm operates with good stability, ensuring that it is both efficient and reliable for large-scale optimization tasks.
The PSO algorithm employs different initial position and velocity values for particles in each experiment. This variation influences the number of iterations needed to converge to the optimal solution for portfolio optimization. As a result, the execution time for each iteration fluctuates, depending on the total iterations required in each trial. This inherent variability highlights the dynamic nature of the PSO algorithm in addressing optimization problems.
In conclusion, the evaluation of the PSO algorithm in terms of its accuracy and speed confirms its capability to optimize the portfolio based on the mean-value-at-risk model. The results from the 50 trials demonstrate that the algorithm can reliably produce stable and efficient solutions with minimal variation in both the optimization outcomes and the execution times. This makes the PSO algorithm a viable tool for portfolio optimization in financial applications, where accuracy and computational efficiency are crucial.
The parameter values used in the PSO algorithm are also crucial to evaluate as they can impact the portfolio optimization results. Experiments were conducted with various variations of the inertia weight ( w ), cognitive learning coefficient ( c 1 ) , and social learning coefficient ( c 2 ) , each performed five times. The results of these experiments can be seen in Table 6. This discussion aims to examine how changes in the parameters can affect the distribution of the weights on the stocks and assess the stability and effectiveness of the parameter combinations used.
The results of the experiments with various parameter values in the PSO algorithm, as shown in Table 6, indicate that changes in the parameter values have a significant impact on the portfolio weight distribution. The inertia weight is a parameter that determines how much the particle’s velocity influences its new best position. In contrast, the cognitive ( c 1 ) and social c 2 learning coefficients determine the extent of the search space used in the PSO algorithm. Lower inertia values ( w = 0.1   w = 0.25 ) generally result in inconsistent weights, as observed after five trials with wide and narrow search spaces. Furthermore, a tremendous inertia value ( w = 1 ) , which implies that the velocity entirely determines the particle’s position, also leads to inconsistent results.
In contrast, an inertia value w = 0.75 , which suggests that velocity does not entirely dominate the discovery of new particle positions, produces consistent results when combined with a vast search space c 1 = 2 ,   c 2 = 2 . This combination supports the stability and reliability of the portfolio’s decision-making process for stock weight allocation. Thus, this parameter combination effectively generates consistent solutions, which is crucial for portfolio optimization in an investment context.

6. Conclusions

This research successfully developed an effective computational algorithm for determining the global optima of an investment portfolio based on the mean-value-at-risk (mean-VaR) model by adapting the particle swarm optimization (PSO) algorithm. This modified PSO algorithm addressed the challenge of determining the optimal portfolio weights by adjusting the parameters to account for the return distribution of banking sector stocks. When applied to Indonesian banking sector stock data from 1 August 2022 to 30 July 2024, 9 out of 33 stocks were selected based on the positive expected returns and distributions aligned with the model. The stock selection considered the risk characteristics and return potential, yielding the optimal portfolio weights and enabling PSO to produce a portfolio composition that aligns with investment objectives in the mean-VaR context. This application’s success indicates that PSO can be a reliable computational method for processing accurate capital market data and providing relevant recommendations for investment decisions in the banking sector.
Further evaluation of the PSO algorithm’s performance demonstrated high consistency in generating optimal portfolios with appropriate parameter selection. Across 50 trials, the algorithm recorded an average expected return of 0.000737, a return standard deviation of 0.00934, a value at risk of 0.01463, and a Sharpe ratio of 0.0504. The low standard deviation across these trials highlights the algorithm’s accuracy, stability, and robustness against variations in the initial values. With an average execution time of 26.4 s, the PSO algorithm demonstrated stable performance in terms of the speed, accuracy, and consistency in the optimization results.
Several experiments have been conducted, showing that variations in the VaR parameter values consistently result in well-calibrated portfolio weights (summing to one). This indicates that the PSO algorithm demonstrates reliable and adaptive performance, making it suitable for application across various market conditions.
In this study, the stock selection method utilized a data distribution model based on the closing prices of banking sector stocks. However, this method has limitations since not all the data conform to the applied distribution model. Consequently, the range of data used in the simulation becomes a critical aspect to consider. For future research, alternative methods, such as Monte Carlo simulation or the ARMA-GARCH method, are recommended to allow for more flexible data ranges and to optimize the stock selection process for investment portfolios.
Additionally, for a more comprehensive risk analysis, it is suggested to explore supplementary risk models, such as the conditional value at risk (CVaR) or expected shortfall (ES), particularly when addressing highly volatile market conditions. Adopting these alternative risk models can provide broader perspectives in portfolio risk measurement and support more comprehensive investment decision-making.

Author Contributions

Conceptualization, M.A.A., H.N. and S.; methodology, M.A.A., H.N. and S.; software, M.A.A. and H.N.; validation, M.A.A., H.N. and S.; formal analysis, M.A.A., H.N. and S.; investigation, M.A.A. and H.N.; resources, M.A.A.; data curation, M.A.A. and S.; writing—original draft preparation, M.A.A.; writing—review and editing, M.A.A., H.N. and S.; visualization, M.A.A.; supervision, H.N. and S.; project administration, H.N.; funding acquisition, S. All authors have read and agreed to the published version of the manuscript.

Funding

Ministry of Education, Culture, Research, and Technology’s Outstanding Scholarship, number: DIPA023.01.1.690399/2024.

Data Availability Statement

Data are contained within the article.

Acknowledgments

Thanks are conveyed to Universitas Padjadjaran, who provided the “Ministry of Education, Culture, Research, and Technology’s Outstanding Scholarship”, and the grant of “Academic Leadership Grant (ALG)” under the Chairperson of Sukono, and the Article Processing Charges (APC) was funded by Universitas Padjadjaran.

Conflicts of Interest

The authors declare no conflicts of interest.

Appendix A

StockCompany NameStockCompany Name
BBCABank Central Asia Tbk.ARTOBank Jago Tbk.
BBNIBank Negara Indonesia (Persero) Tbk.BJBRBank Pembangunan Daerah Jawa Barat dan Banten Tbk.
BBRIBank Rakyat Indonesia Tbk.BJTMBank Pembangunan Daerah Jawa Timur Tbk.
BBTNBank Tabungan Negara (Persero) Tbk.AGROBank Raya Indonesia Tbk.
BDMNBank Danamon Indonesia Tbk.SDRABank Woori Saudara Indonesia 1906 Tbk.
BMRIBank Mandiri (Persero) Tbk.BCICBank JTrust Indonesia Tbk.
BNGABank CIMB Niaga Tbk.BBYBBank Neo Commerce Tbk.
BRISBank Syariah Indonesia Tbk.BINABank Ina Perdana Tbk.
BTPNBank BTPN Tbk.MAYABank Mayapada Internasional Tbk.
NISPBank OCBC NISP Tbk.BVICBank Victoria International Tbk.
PNBNBank Panin Indonesia Tbk.DNARBank Oke Indonesia Tbk.
BNIIBank Maybank Indonesia Tbk.BBHIBank Harda Internasional Tbk.
BNLIBank Permata Tbk.AMARBank Amar Indonesia Tbk.
BBKPBank KB Bukopin Tbk.BANKBank Aladin Syariah Tbk.
MEGABank Mega Tbk.BGTGBank Ganesha Tbk.
BSIMBank Sinarmas Tbk.INPCBank Artha Graha Internasional Tbk.
BACABank Capital Indonesia Tbk.

Appendix B

Σ = 0.000150 0.000076 0.000078 0.000068 0.000041 0.000090 0.000042 0.000042 0.000056 0.000076 0.000431 0.000122 0.000105 0.000067 0.000134 0.000050 0.000097 0.000058 0.000078 0.000122 0.000378 0.000109 0.000057 0.000110 0.000064 0.000099 0.000073 0.000068 0.000105 0.000109 0.000281 0.000068 0.000092 0.000076 0.000107 0.000074 0.000041 0.000067 0.000057 0.000068 0.000210 0.000062 0.000073 0.000063 0.000058 0.000090 0.000134 0.000110 0.000092 0.000062 0.000805 0.000047 0.000091 0.000063 0.000042 0.000050 0.000064 0.000076 0.000073 0.000047 0.000181 0.000055 0.000093 0.000042 0.000097 0.000099 0.000107 0.000063 0.000091 0.000055 0.000522 0.000066 0.000056 0.000058 0.000073 0.000074 0.000058 0.000063 0.000093 0.000066 0.000240

Appendix C

NoStockDistribution ModelParameters Value A 2  ValueHypothesis
k α β γ
1BBCALog-Logistic (3P) 29.145 0.196 0.1958 0.93 Accepted
2BBNILog-Logistic (3P) 2 × 10 8 1 × 10 6 1 × 10 6 1.42 Accepted
3BBRILog-Logistic (3P) 2 × 10 8 1 × 10 6 1 × 10 6 0.66 Accepted
4BBTNBurr (4P) 0.606 353.49 2.582 2.5887 2.19 Accepted
5BDMNBurr (4P) 0.668 60.69 0.3966 0.4015 2.85 Accepted
6BMRILog-Logistic (3P) 2 × 10 8 2 × 10 6 2 × 10 6 0.91 Accepted
7BNGALog-Logistic (3P) 25.692 0.1893 0.189 3.64 Accepted
8BRISLog-Logistic (3P) 21.221 0.2652 0.2657 2.03 Accepted
9BTPNBurr (4P) 0.962 29,064 136.47 13,647 8.17 Rejected
10NISPLog-Logistic (3P) 14.198 0.119 0.1187 1.39 Accepted
11PNBNBurr (4P) 0.843 45.778 0.6252 0.6305 2.16 Accepted
12BNIILog-Logistic (3P) 60.642 0.4524 0.4532 9.18 Rejected
13BNLILog-Logistic (3P) 4 × 10 8 2 × 10 6 2 × 10 6 6.55 Rejected
14BBKPLog-Logistic (3P) 22.532 0.2565 0.2601 5.96 Rejected
15MEGABurr (4P) 0.696 29,808 209.1 209.1 10.95 Rejected
16BSIMLog-Logistic (3P) 37.446 0.2815 0.2814 21.70 Rejected
17BACALog-Logistic (3P) 35.821 0.2266 0.2271 23.54 Rejected
18ARTOBurr (4P) 0.728 19.412 0.3668 0.3827 0.98 Accepted
19BJBRBurr (4P) 1.202 419.46 1.9485 1.9477 5.29 Rejected
20BJTMBurr (4P) 1.026 1 × 10 7 66,045 66,045 17.12 Rejected
21AGROBurr (4P) 0.885 18.729 0.2684 0.2753 1.01 Accepted
22SDRABurr (4P) 0.973 340,270 2199.7 2199.7 9.26 Rejected
23BCICLog-Logistic (3P) 18.116 0.2225 0.2252 6.37 Rejected
24BBYBLog-Logistic (3P) 10.806 0.2218 0.229 2.89 Accepted
25BINALog-Logistic (3P) 161 0.5912 0.5912 19.83 Rejected
26MAYALog-Logistic (3P) 91.569 1.3356 1.3374 10.77 Rejected
27BVICBurr (4P) 0.716 29.841 0.2839 0.2914 4.80 Rejected
28DNARLog-Logistic (3P) 32.315 0.3758 0.3784 5.04 Rejected
29BBHILog-Logistic (3P) 10.965 0.1752 0.1814 5.28 Rejected
30AMARLog-Logistic (3P) 83.868 0.9832 0.9839 8.67 Rejected
31BANKBurr (4P) 0.72 1 × 10 7 173,380 173,380 3.09 Accepted
32BGTGLog-Logistic (3P) 20.156 0.2508 0.2537 6.88 Rejected
33INPCLog-Logistic (3P) 15.268 0.154 0.1564 10.60 Rejected

Appendix D

τ IterationStock Weight μ p t σ p t V a R p t Sharpe Ratio (RVaR)
BBCABBNIBBRIBBTNBDMNBMRIBNGABRISNISP
03310.33870.03490.02410.03170.16650.01770.21030.05460.12170.000630.009180.014470.043731
0.12860.33820.03500.02290.02960.16310.01880.21170.05460.12600.000640.009190.014470.044193
0.23520.33770.03510.02180.02760.15980.02000.21310.05450.13030.000650.009190.014470.044651
0.32640.33730.03520.02060.02550.15640.02120.21450.05450.13470.000650.009200.014480.045106
0.42890.33680.03530.01950.02350.15310.02240.21590.05440.13910.000660.009200.014480.045557
0.53310.33630.03540.01830.02140.14970.02360.21730.05440.14340.000670.009210.014490.046005
0.62810.33590.03560.01710.01940.14640.02480.21870.05440.14780.000670.009220.014490.046449
0.73200.33540.03570.01600.01730.14300.02600.22010.05430.15220.000680.009230.014500.046890
0.83180.33490.03580.01480.01520.13960.02720.22160.05430.15670.000690.009240.014510.047327
0.93130.33440.03590.01360.01320.13620.02840.22300.05420.16110.000690.009250.014520.047761
14480.33400.03600.01250.01110.13280.02960.22440.05420.16550.000700.009260.014540.048191
1.15210.33350.03610.01130.00900.12940.03080.22580.05410.17000.000710.009280.014550.048617
1.23750.33300.03620.01010.00690.12590.03200.22730.05410.17450.000710.009290.014570.049040
1.33590.33250.03630.00890.00470.12250.03320.22870.05410.17900.000720.009310.014590.049459
1.43180.33200.03640.00770.00260.11900.03450.23020.05400.18350.000730.009320.014600.049874
1.54840.33160.03660.00650.00050.11550.03570.23170.05400.18810.000740.009340.014620.050286
1.514970.33150.03660.00630.00030.11520.03580.23180.05400.18850.000740.009340.014630.050327
1.525760.33150.03660.00620.00010.11480.03600.23200.05400.18900.000740.009340.014630.050368
1.5213360.33150.03660.0062 3 × 10 5 0.11480.03600.23200.05400.18900.000740.009340.014630.050372
1.5226570.33140.03660.0062 9 × 10 6 0.11470.03600.23200.05400.18910.000740.009340.014630.050376
1.52235620.33140.03660.0062 2 × 10 6 0.11470.03600.23200.05400.18910.000740.009340.014630.050377
1.52244090.33140.03660.0062 2 × 10 7 0.11470.03600.23200.05400.18910.000740.009340.014630.050378
1.5225970.33140.03720.0054−0.00080.11530.03550.23270.05450.18870.000740.009340.014630.050361

References

  1. Cannelli, L.; Facchinei, F.; Kungurstev, V.; Scutari, G. Asynchronous parallel algorithms for nonconvex optimization. Math. Program. 2020, 184, 121–154. [Google Scholar] [CrossRef]
  2. Chen, M.; Zhou, Y.; Luo, Q. An Improved Arithmetic Optimization Algorithm for Numerical Optimization Problems. Mathematics 2022, 10, 2152. [Google Scholar] [CrossRef]
  3. Vuik, T.; Vermolen, F.J.; van Gijzen, M.B.; Vuik, M.J. Numerical Meethods for Ordinary Differential Equation; TU Delft Open Publishing: Delft, The Netherlands, 2023. [Google Scholar]
  4. Kaur, H. Analysis of Various Optimization Techniques in Machine Learning. Turk. J. Comput. Math. Educ. 2021, 12, 472–482. [Google Scholar] [CrossRef]
  5. Tao, Y.; Wang, C. Global optimization for max-plus linear systems and applications in distributed systems. Automatica 2020, 119, 109104. [Google Scholar] [CrossRef]
  6. Cormen, T.H.; Leiserson, C.E.; Rivest, R.L.; Clifford, S. Introduction to Algorithms, 3rd ed.; The MIT Press: London, UK; Cambridge, MA, USA, 2009. [Google Scholar]
  7. Kodnyanko, V. Two Algorithms for Global Optimization of One-Variable Functions Based on the Smallest Estimate Distances Between Extremes and Their Number. Radio Electron. Comput. Sci. Control 2020, 36–43. [Google Scholar] [CrossRef]
  8. Meselhi, M.A.; Elsayed, S.M.; Sarker, R.A.; Essam, D.L. Contribution Based Co-Evolutionary Algorithm for Large-Scale Optimization Problems. IEEE Access 2020, 8, 203369–203381. [Google Scholar] [CrossRef]
  9. Asthana, A.; Ahmed, S.S. Risk and Return Analysis of Sectoral Indices in the context of the Bombay Stock Exchange. Asian J. Probab. Stat. 2023, 22, 40–46. [Google Scholar] [CrossRef]
  10. Xidonas, P.; Steuer, R.; Hassapis, C. Robust portfolio optimization: A categorized bibliographic review. Ann. Oper. Res. 2020, 292, 533–552. [Google Scholar] [CrossRef]
  11. Gianin, E.R.; Sgarra, C. Risk Measures: Value at Risk and Beyond. In Mathematical Finance: Theory Review and Exercises; Springer: Cham, Switzerland, 2023; pp. 269–299. [Google Scholar] [CrossRef]
  12. Subramoney, S.D.; Chinhamu, K.; Chifurira, R. VaR Estimation Using Extreme Value Mixture Models for Cryptocurrencies. Preprints 2023, 2023070187. [Google Scholar] [CrossRef]
  13. Tsao, C.-Y. Portfolio selection based on the mean-VaR efficient frontier. Quant. Financ. 2010, 10, 931–945. [Google Scholar] [CrossRef]
  14. Zhang, T.; Liu, Z. Fireworks algorithm for mean-VaR/CVaR models. Phys. A Stat. Mech. Its Appl. 2017, 483, 1–8. [Google Scholar] [CrossRef]
  15. Jiang, M.; Liu, W.; Xu, W.; Chen, W. Improved multiobjective bat algorithm for the credibilistic multiperiod mean-VaR portfolio optimization problem. Soft Comput. 2021, 25, 6445–6467. [Google Scholar] [CrossRef]
  16. Babazadeh, H.; Esfahanipour, A. A novel multi period mean-VaR portfolio optimization model considering practical constraints and transaction cost. J. Comput. Appl. Math. 2019, 361, 313–342. [Google Scholar] [CrossRef]
  17. Zadiraka, V.; Khimich, O.; Shvidchenko, I. Models of Computer Calculations. Cybern. Comput. Technol. 2022, 6, 38–51. [Google Scholar] [CrossRef]
  18. Kennedy, J.; Eberhart, R.C. Particle swarm optimization. In IEEE International Conference on Neural Networks; IEEE Serivce Center: Piscataway, NJ, USA, 1995. [Google Scholar]
  19. Al Nuaimi, K.; Mohamed, N.; Al Nuaimi, M.; Al-Jaroodi, J. A survey of load balancing in cloud computing: Challenges and algorithms. In Proceedings of the 2012 Second Symposium on Network Cloud Computing and Applications, London, UK, 3–4 December 2012; pp. 137–142. [Google Scholar]
  20. Calafiore, G.C.; El Ghaoui, L. Optimization Models; Cambridge University Press: Cambridge, UK, 2014. [Google Scholar]
  21. Rao, S.S. Engineering Optimization: Theory and Practice, 4th ed.; John Wiley and Sons Inc.: Hoboken, NJ, USA, 2009. [Google Scholar] [CrossRef]
  22. Boyd, S.; Vandenberghe, L. Convex Optimization, 7th ed.; Cambridge University Press: New York, NY, USA, 2009. [Google Scholar]
  23. Pintér, J.; Szabó, J. Global Optimization Algorithms: Theory and Some Applications, 2nd ed.; Springer: Berlin/Heidelberg, Germany, 2008. [Google Scholar] [CrossRef]
  24. Attar, A.; Mule, P.; Kulkarni, P.; Narale, S.; Bankar, J. Investment Portfolio Management System: A Survey. Int. J. Res. Appl. Sci. Eng. Technol. 2023, 11, 169–174. [Google Scholar] [CrossRef]
  25. Elton, E.J.; Gruber, M.J.; Brown, S.J.; Goetzmann, W.N. Modern Portfolio Theory and Investment Analysis, 8th ed.; John Wiley & Sons, Inc.: New York, NY, USA, 1991. [Google Scholar]
  26. Irsan, M.Y.T.; Priscilla, E.; Siswanto, S. Comparison of Variance Covariance and Historical Simulation Methods to Calculate Value at Risk on Banking Stock Portfolio. J. Mat. Stat. Komputasi 2022, 19, 241–250. [Google Scholar] [CrossRef]
  27. Ahmadzade, H.; Gao, R. Covariance of Uncertain Random Variables and Its Application to Portfolio Optimization. J. Ambient. Intell. Humaniz. Comput. 2020, 11, 2613–2624. [Google Scholar] [CrossRef]
  28. Buhler, C.K.; Benson, H.Y. Efficient Solution of Portfolio Optimization Problems via Dimension Reduction and Sparsification. arXiv 2023, arXiv:2306.12639. [Google Scholar]
  29. Bhatti, F.A.; Hamedani, G.G.; Sobhi, M.M.A.; Korkmaz, M. On the burr xii-power cauchy distribution: Properties and applications. AIMS Math. 2021, 6, 7070–7092. [Google Scholar] [CrossRef]
  30. Shakil, M.; Kibria, B.M.G.; Singh, J.N.; Ahsanullah, M. On Burr (4P) Distribution: Application of Breaking Stress Data. Jnanabha 2020, 50, 190–199. [Google Scholar] [CrossRef]
  31. Yasmin, A.A.; Riaman, R.; Sukono, S. Investment Portfolio Optimization in Infrastructure Stocks Using the Mean-VaR Risk Tolerance Model. Int. J. Quant. Res. Model. 2024, 5, 74–82. [Google Scholar] [CrossRef]
  32. Vimelia, W.; Riaman, R.; Sukono, S. Investment Portfolio Optimization in Renewable Energy Stocks in Indonesia Using Mean-Variance Risk Aversion Model. Int. J. Quant. Res. Model. 2024, 5, 40–48. [Google Scholar] [CrossRef]
  33. Gaire, A.K.; Gurung, Y.B. Skew Log-Logistic distribution: Properties and application. Stat. Transit. New Ser. 2024, 25, 43–62. [Google Scholar] [CrossRef]
  34. Mai, A.T.; Bastin, F.; Toulouse, M. On Optimization Algorithms for Maximum Likelihood Estimation; Interuniversity Research Center on Enterprise Networks, Logistics and Transportation: Torino, Italy, 2014. [Google Scholar]
  35. Wen, Z. Theoretical Analysis of Modern Portfolio Theory. BCP Bus. Manag. 2023, 47, 99–104. [Google Scholar] [CrossRef]
  36. Sukono, S.; Sidi, P.; Bon, A.T.B.; Supian, S. Modeling of Mean-VaR portfolio optimization by risk tolerance when the utility function is quadratic. AIP Conf. Proc. 2017, 1827, 020035. [Google Scholar] [CrossRef]
  37. Parmikanti, K.; Gw, S.H.; Saputra, J. Mean-Var Investment Portfolio Optimization Under Capital Asset Pricing Model (CAPM) with Nerlove Transformation: An Empirical Study Using Time Series Approach. Ind. Eng. Manag. Syst. 2020, 19, 498–509. [Google Scholar]
  38. Bodie, Z.; Kane, A.; Marcus, A.J. Investments, 10th ed.; McGraw-Hill Education: New York, NY, USA, 2014. [Google Scholar]
  39. Jiang, Z.; Xu, D.; Liang, J. A Deep Reinforcement Learning Framework for the Financial Portfolio Management Problem. arXiv 2017, arXiv:1706.10059. [Google Scholar]
  40. Cheng, T.; Chen, K. A general framework for portfolio construction based on generative models of asset returns. J. Financ. Data Sci. 2023, 9, 100113. [Google Scholar] [CrossRef]
Figure 1. The minimum of f ( x ) is the maximum of f ( x ) .
Figure 1. The minimum of f ( x ) is the maximum of f ( x ) .
Mathematics 12 03920 g001
Figure 2. BBCA stock closing price (blue line) and the trendline for the stock closing price (red dotted line).
Figure 2. BBCA stock closing price (blue line) and the trendline for the stock closing price (red dotted line).
Mathematics 12 03920 g002
Figure 3. Chart of BBCA stock’s daily return.
Figure 3. Chart of BBCA stock’s daily return.
Mathematics 12 03920 g003
Figure 4. Distribution model assumption chart for daily returns of BBCA stock (a) and BBTN stock (b).
Figure 4. Distribution model assumption chart for daily returns of BBCA stock (a) and BBTN stock (b).
Mathematics 12 03920 g004
Figure 5. Iteration plot for each value of τ .
Figure 5. Iteration plot for each value of τ .
Mathematics 12 03920 g005
Figure 6. Efficient frontier portfolio chart.
Figure 6. Efficient frontier portfolio chart.
Mathematics 12 03920 g006
Figure 7. Portfolio performance chart.
Figure 7. Portfolio performance chart.
Mathematics 12 03920 g007
Table 1. BBCA stock return.
Table 1. BBCA stock return.
DateClose PriceReturn
8/1/20227500-
8/2/202276000.01324
8/3/202276250.00328
7/29/202410,250−0.00729
7/30/202410,175−0.00734
Table 2. Expected returns and variance of returns for the banking sector stocks that meet the distribution model assumptions.
Table 2. Expected returns and variance of returns for the banking sector stocks that meet the distribution model assumptions.
StockExpected ReturnVarian ReturnStockExpected ReturnVarian Return
BBCA 5.80 × 10 4 1.50 × 10 4 BRIS 5.04 × 10 4 5.22 × 10 4
BBNI 5.18 × 10 4 4.31 × 10 4 NISP 0.00131 2.40 × 10 4
BBRI 2.97 × 10 4 3.78 × 10 4 PNBN 7.11 × 10 4 7.21 × 10 4
BBTN 2.30 × 10 4 2.81 × 10 4 ARTO 0.00283 0.00174
BDMN 1.60 × 10 4 2.10 × 10 4 AGRO 0.00246 7.89 × 10 4
BMRI 0.00126 8.05 × 10 4 BBYB 0.00402 0.00148
BNGA 7 × 10 4 1.81 × 10 4 BANK 0.00116 8.48 × 10 4
Table 3. Selected stocks.
Table 3. Selected stocks.
StockExpected ReturnVarian Return
BBCA 5.80 × 10 4 1.50 × 10 4
BBNI 5.18 × 10 4 4.31 × 10 4
BBRI 2.97 × 10 4 3.78 × 10 4
BBTN 2.30 × 10 4 2.81 × 10 4
BDMN 1.60 × 10 4 2.10 × 10 4
BMRI 0.00126 8.05 × 10 4
BNGA 7 × 10 4 1.81 × 10 4
BRIS 5.04 × 10 4 5.22 × 10 4
NISP 0.00131 2.40 × 10 4
Table 4. The covariance of the stock returns values.
Table 4. The covariance of the stock returns values.
Covariance
StockBBCABBNIBBRIBBTNBDMNBMRIBNGABRISNISP
BBCA 0.000150 0.000076 0.000078 0.000068 0.000041 0.000090 0.000042 0.000042 0.000056
BBNI0.0000760.0004310.0001220.0001050.0000670. 0001340.0000500.0000970.000058
BBRI0.0000780.0001220.0003780.0001090.0000570.0001100.0000640.0000990.000073
BBTN0.0000680.0001050.0001090.0002810.0000680.0000920.0000760.0001070.000074
BDMN0.0000410.0000670.0000570.0000680.0002100.0000620.0000730.0000630.000058
BMRI0.0000900.0001340.0001100.0000920.0000620.0008050.0000470.0000910.000063
BNGA0.0000420.0000500.0000640.0000760.0000730.0000470.0001810.0000550.000093
BRIS0.0000420.0000970.0000990.0001070.0000630.0000910.0000550.0005220.000066
NISP0.0000560.0000580.0000730.0000740.0000580.0000630.0000930.0000660.000240
Table 5. PSO algorithm trial table.
Table 5. PSO algorithm trial table.
TrialIteration μ p t σ p t V a R p t Sharpe RatioTime
14860.00073699860.00934216610.01462949720.050377574227.02
24180.00073699830.00934216550.01462949640.050377559826.58
34370.00073699840.00934216560.01462949660.050377562826.14
44830.00073699460.00934215630.01462948510.050377344926.26
56310.00073699840.00934216570.01462949670.050377565926.54
493940.00073699840.00934216560.01462949660.050377562926.70
507880.00073701520.00934220700.01462954780.050378536926.98
Average0.00073699860.00934216620.01462949730.050377576926.40
Std. Deviation0.000000003 0.000000007 0.000000009 0.000000168
Table 6. PSO parameter testing.
Table 6. PSO parameter testing.
Parameter ValueIterationPortfolio WeightRatio
BBCABBNIBBRIBBTNBDMNBMRIBNGABRISNISP
w = 0.1
c 1 = 2 ,
c 2 = 2
2240.207980.085880.056710.021310.110480.047570.235160.061650.173270.047813
2060.300390.039360.029660.032580.121830.036350.208630.067080.164120.047491
2120.300520.038970.033300.023830.109070.032150.213810.057640.190710.049096
1980.300770.061310.010430.044670.106390.034600.197980.068270.175580.048052
2240.287840.054040.039130.018220.104960.042900.219630.040520.192760.049728
w = 0.25
c 1 = 0.1
c 2 = 0.1
670.338950.031530.02867−0.002730.147300.028020.175890.053870.198510.048468
750.334450.032860.006720.002350.143460.036720.183370.054350.205730.049639
730.335160.036490.01103−0.002990.111750.035800.231410.051700.189630.050445
780.322180.03453−0.000690.004320.120860.036670.234980.058750.188400.050260
570.332310.036940.00618−0.000320.114580.035830.231330.054170.188970.050365
w = 0.75
c 1 = 2
c 2 = 2
5910.331440.036590.006200.000000.114730.036000.231990.053950.189090.050378
3510.331450.036590.006200.000000.114730.035990.232000.053950.189090.050378
3920.331450.036590.006200.000000.114730.035990.232000.053950.189090.050378
4130.331440.036590.006200.000000.114730.036000.232000.053950.189090.050378
7250.331440.036590.006200.000000.114730.035990.232000.053960.189090.050378
w = 0.75
c 1 = 0.1
c 2 = 0.1
2530.308490.037720.003620.007190.119890.037490.242610.054470.188500.050282
2710.312290.042300.000300.010220.128080.040270.219520.053720.193300.050072
2570.325440.037510.010070.000020.123120.037590.214170.053690.198400.050321
2340.331270.036610.00625−0.000150.114790.036010.232340.053920.188960.050377
2410.331690.035350.006560.003310.123020.036290.223440.051910.188420.049985
w = 1
c 1 = 2
c 2 = 2
5760.329760.036520.004820.003190.118230.036730.227290.052070.191390.050323
3360.336080.039500.01062−0.006890.121550.036590.224480.062140.175920.049572
5310.330280.036670.00630−0.000010.118680.036780.221610.051770.197930.050555
9990.333600.035090.007440.001760.116890.035970.227300.054110.187830.050158
4520.330880.036620.005510.003280.110710.036030.236700.053730.186550.050372
Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content.

Share and Cite

MDPI and ACS Style

Amal, M.A.; Napitupulu, H.; Sukono. Particle Swarm Optimization Algorithm for Determining Global Optima of Investment Portfolio Weight Using Mean-Value-at-Risk Model in Banking Sector Stocks. Mathematics 2024, 12, 3920. https://doi.org/10.3390/math12243920

AMA Style

Amal MA, Napitupulu H, Sukono. Particle Swarm Optimization Algorithm for Determining Global Optima of Investment Portfolio Weight Using Mean-Value-at-Risk Model in Banking Sector Stocks. Mathematics. 2024; 12(24):3920. https://doi.org/10.3390/math12243920

Chicago/Turabian Style

Amal, Moh. Alfi, Herlina Napitupulu, and Sukono. 2024. "Particle Swarm Optimization Algorithm for Determining Global Optima of Investment Portfolio Weight Using Mean-Value-at-Risk Model in Banking Sector Stocks" Mathematics 12, no. 24: 3920. https://doi.org/10.3390/math12243920

APA Style

Amal, M. A., Napitupulu, H., & Sukono. (2024). Particle Swarm Optimization Algorithm for Determining Global Optima of Investment Portfolio Weight Using Mean-Value-at-Risk Model in Banking Sector Stocks. Mathematics, 12(24), 3920. https://doi.org/10.3390/math12243920

Note that from the first issue of 2016, this journal uses article numbers instead of page numbers. See further details here.

Article Metrics

Back to TopTop