In a general approach, theories on the formation of stock portfolios can be divided into two modern and ultramodern groups  -  . A Modern Portfolio Theory (MPT) or portfolio theory was introduced by Harry Markowitz’s “Portfolio Selection,” published in the 1952 Journal of the Facsimile  . Thirty-eight years later, Markowitz, along with Merton Miller and William Sharp, received the Nobel Prize for what was called the “Broad-Select Theory of Portfolios”. Markowitz, by explaining the details of maths of diversification, suggested that investors instead focus on portfolios based on their overall risk profile and returns rather than portfolio selection, consisting of individually-owned stocks with attractive risk-return characteristics.
In short, investors should choose portfolios, not simply to select securities. One of the methods for selecting the optimal portfolio is the use of artificial neural networks. Artificial Neural Network (ANN) is a method for computing, which is based on the interconnection of several processing units. The network consists of the arbitrary number of cells or nodes or units or neurons that associate the input set with the output. In these networks, with the help of programming, a data structure is constructed that can act as a neuron. This node (or nodes) then will train the network by creating a network between these nodes and applying an educational algorithm to it. If the yields of one round of securities are considered as random variables, then they can determine the expected values, standard deviations and correlation for them  . Based on these values, we can calculate the expected returns and the volatility of any portfolios composed of securities. The expected returns and volatility may be considered as estimates of risk and returns   . In all the portfolios where it is possible to form them, some portfolios will have the best balance in terms of risk and return. These portfolios contain what Markowitz calls the boundary of the efficiency of portfolios.
The investor should select a portfolio that is on the verge of efficiency. Regarding the weaknesses described for variance as a risk measure, the purpose of this research is to form an optimal stock portfolio using the Neural Network and the Hopfield model in the basket selection question. We have a series of assets or securities that we want to find an optimal way of investing a certain amount of money in this asset. Different ways used to diversify this money between several assets is called a basket. In order to solve the basket selection problem, Markowitz presented the so-called mean-variance model and it is assumed that the total basket returns can be recommended using the average return on assets and the return variance (risk) between these assets. However, the Markowitz average variance model does not have cardinality constraints, which ensures that the number of assets in each basket is taken into account, nor the bounding limits, which, is the amount of money that must be paid in each assets are not invested. This series of limitations is very useful in practice     .
In order to overcome this incompatibility, the standard Marquette model can be generalized to these constraints. These constraints guarantee the investment in a certain number of assets and limit the amount of capital that must be invested in each asset. When the Markovitz mean-variance model is considered, the basket selection problem is a quadratic programming problem. But if this model is generalized with constraints of returns and integers, then the basket selection problem will be converted to the quadratic and integer programming problem. But there is no algorithm that can solve the portfolio selection problem optimally   . Hopfield’s neural network is used to optimize some of the optimization problems and to solve the basket selection problem.
The purpose of this research is to select the best portfolio of the Markovitz model based on the Hopfield Neural Network from among the top 50 third-year firms in Tehran Stock Exchange.
The statistical population of the study was the shares of the companies belonging to the top 50 companies of the Tehran Stock Exchange in the third quarter of 2011. The spatial domain of this research is the companies admitted to the Tehran Stock Exchange and the domain of the time is related to a number of trading days of each of the shares in the 3rd quarter of 2011. Independent variable is the final prices of the top 50 companies in the third quarter of the year in Tehran Stock Exchange 2011. The dependent variable is the returns of companies that are calculated using Excel software. Raw data was collected by referring to the capital market database and then, the variables of the calculation were calculated using the Excel software. Finally, the optimal portfolios at different levels of risk aversion were identified using MATLAB software.
Investment can be defined as: buying a real or financial asset that is proportionate to its expected return risk. The investment period is usually long-term and takes 3 to 10 years. Investment in general has two forms:
1) Investment in Real Assets: such as buying a home, land, durable goods such as carpets and artistic works. Individuals with this type of investment will protect their capital from inflation.
2) Investment in Financial Assets: Financial assets such as securities represent the claims and rights of the investor in relation to the company’s profits or real assets.
3. Modern Portfolio Theory
Prior to Markowitz’s “widespread portfolio selection theory”, investors were focused on portfolio selection on risk assessment and portfolio yields individually. At this time, the standard investment recommendation was to identify the investor with the best range and least risk, and select a portfolio of them. Following this advice, an investor might have concluded that all stocks of an industry have a risk profile and good returns, and the entire portfolios of the industry’s stock should be formed. But this is not logical. Markowitz formulated and systematized this logic. By explaining the details of math diversification, he suggested that investors focus on portfolio selection, based on their overall risk profile and returns, instead of choosing portfolios consisting of individually owned stocks with attractive risk-return characteristics. In short, investors should choose portfolios, not simply to select securities. If the yields of one round of securities are considered as random variables, then they can determine the expected values, standard deviations and correlation for them. Based on these values, we can calculate the expected returns and the volatility of any portfolios composed of securities. That is, the expected returns and volatility may be considered as estimates of risk and returns.
In all the portfolios where it is possible to form them, some portfolios will have the best balance in terms of risk and return. These portfolios contain what Markowitz calls the boundary of the efficiency of portfolios. The investor should select a portfolio that is on the verge of efficiency.
James Tobin    , by adding risk-free assets to this analysis, developed Markowitz’s work, which enabled a person-investor to use leverage or non-leverage portfolios located on the efficiency frontier. This led to the creation of concepts of super-efficient portfolios and the capital market line. Through the leverage, portfolios on the capital market line can operate beyond the portfolios existing on the boundary of efficiency.
Investors in a general approach usually recommend a three-step process for portfolio management  :
1) Financial Fundamental Principles Learning
2) Create portfolios
3) Portfolio management and protection
The Marquette model is based on the following assumptions:
1) Investors are risk averse and have an expected desirability, and their marginal utility curve is diminishing.
2) Investors choose their portfolio based on the average and expected yield variance. Therefore, their indifference curves are a function of expected rate of return and variance.
3) Each investment option can be divided into infinite.
4) Investors have a “one-off” time horizon, which is the same for all investors.
5) Investors prefer a higher return at a certain level of risk, and vice versa, for the same level of return, they want the least risk.
Consider an investor (person A) who considers “high expected returns”, which is desirable, and “uncertainty of return” as undesirable as two important factors in their investment decision. He has an n-shirt sheet. Therefore, the yield of sheet I (a random variable) with mean and variance is considered. In addition, covariance is assumed to be between the returns of both contributions.
If an investor has some money to invest in n, then the question is: “How should the investment amount be allocated between the n sheet and the resulting portfolio, has the maximum expected return?”
Markowitz suggests that the answer to the above question should be done in two steps:
1) Defining a portfolio of efficient, efficient portfolios is a portfolio with the least variance of returns among all portfolios with the expected returns, or the highest expectation among all those with the same variance;
2) Selection of the efficient sum; that is, selecting the portfolio that will provide the most appropriate combination of risk and return for the investor.
The Markowitz mean-variance model is as follows:
Which variables are defined as follow:
N: Total number of assets
: Average asset yield i
: Covariance between asset yield i and j
λ: Risk Incompatibility Parameter
: Share of investment in in asset i
If λ = 0, the maximum average return of a basket (without regard to the variance) will be obtained and the optimal solution will be formed only with the asset with the largest average return, and if λ = 1, then the minimum value of the total variance of a basket (without considering the average returns), in which case the optimal solution would typically include several assets. In fact, is the balance between the mean of returns and the variance and obtaining an answer between the states λ = 1 and λ = 0.
Figure 1 shows the Mean return in various variance of returns.
4. Important Papers, Worthy Documents
An important paper or a worthy document is a document based on the right to claim the income and assets of an institution. In other words, electricity from securities represents a claim against an asset item and any cash flow from which that asset is derived. Bonds are also a kind of securities that the holder has the right, at the maturity date, to receive a nominal amount of “nominal value of the bonds” and, on certain dates, the amount received as interest.
An ordinary share of the document is based on the fact that the shareholder owns a certain percentage of a company and hence he has a certain percentage of profits that will be paid in cash and any other benefits to the shareholders of the
Figure 1. Mean return vs variance of return.
company will receive. Except for the two above, important papers or worthy documents include a range of financial instruments that holders have different claims. When a person signs a stitch, a type of securities is published. A land tenure document is a type of security. Hence, the scope of the investment debate and the analysis of securities goes beyond the study of ordinary shares and bonds. The analysis of securities involves calculating the expected degree and risk of the expected cash flows of the securities. In order to determine the future value of a securities sheet, various factors, such as information about the industry that participates in analyzes the strategies of rival companies and analyzes the company’s data, in order to be able to predict the risk of securities and the price of those bonds.
5. Selection of 50 Active Companies
Examining the experience of securitized securities in different countries shows that the identification of preferred or superior companies is often done on the basis of the following criteria:
1) The power of stock liquidity,
2) The company’s impact on the market,
3) The superiority of financial ratios
The identification of the top companies in the Tehran Stock Exchange is based on the combination of the power of stock liquidity and the impact of companies on the market and in the following dimensions:
a) The volume of trading in the trading room includes:
1) Number of traded shares
2) The value of the traded shares
b) The trading frequency of the stock exchanges in the trading room includes:
1) The number of days traded
2) Number of traded
c) The measure of the company’s impact on the market include:
1) The average number of shares published
2) Average current value of shares of the company during the review period
Mj: Company rating of j
N: Number of Indicators Examined
Ii: Indicator value of i
6. Artificial Neural Network (ANN)
An intelligent data processing system that integrates the idea of a human brain and processes data into small and large processors that behave in an interconnected and parallel way to solve a problem. Artificial Neural Network (ANN) is
a method for calculating multiple interworking units based on interconnect.
The schematic of an artificial neuron is depicted in Figure 2. The network consists of the arbitrary number of cells or nodes or units or neurons that associate the input set with the output. In these networks, with the help of programming, a data structure is constructed that can act as a neuron, which is also referred to as a node. Then, by creating a network between these nodes and applying an algorithm to it, the network they teach.
Learning nerve networks is nothing but adjusting the communication weights of these neurons to get different examples so that the network output converges to the optimal output.
7. Hopfield’s Neural Network
Hopfield’s network is a single-layer neural network model with fully interconnected neurons that all neurons are connected to each other. Figure 3 shows the outline of the Hopfield’s network. Hopfield’s network is a recursive network, meaning the network output returns as an input to the network. Investment management involves two main issues of “securities analysis” and “portfolio management”. The analysis of securities involves estimating the benefits of individual
Figure 2. Artificial neuron.
Figure 3. Hopfield’s network.
investments. While portfolio management involves analyzing the combination of investments and managing the maintenance of a set of investments.
In recent years, the trend of investment issues has changed from portfolio selection methods (portfolio analysis) to portfolio management. Hopfield’s discrete network is used in a variety of combinational optimization problems.
Although the desired problem is a composite optimization problem, the authors of the reference article have used the fact that the objective function in the Markovitz-Variance-Covariance Model is the same with the energy function in the Hopfield network. As a result, the objective function in the Markowitz-Variance-Covariance Model will be minimal if we follow Hopfield’s steps.
Hopfield Energy and Dynamic Power Function:
Using this definition, the energy function for the Hopfield network is as follow:
: An external constant value for the neuron i
: The weight of the neuron is i to j.
Now we can look at the target function of the basket selection problem:
By comparison with the energy function, the values of the weights are obtained:
As well as foreign input:
N variables in the problem are displayed with N neurons in the network. And is equal to the share of the capital that must be invested in the i-th asset. The state of the neuron i is represented by .
The variables are as follow:
N: Total number of assets
: Average asset yield i
: Covariance between asset yield i and j
λ: The risk aversion we have:
: Share of investment in property of i
From here, let me work at discrete times, so if we display the neuron state i at time t with , the equations that control the side of the Hopfield network are:
That is the input of the neuron i at time t:
and is the activity function as follow:
with a β > 0 and the specified γ.
In our simulation, the middle value was maximized and the minimum inputs were assigned to to ensure that the outputs are within the range .
For the remaining subsections, let’s assume (without loss of integrity) that all the lower holes have the same values of and all the holes are equal to . In this project, ε = 0 and δ = 1. The output vector on the Hopfield Hally network provides an available problem. This vector is multifaceted . Network stability can prove the determination of the energy function for the network and prove that its time derivative is non-ascending. The nonlinear nature of the Hopfield network produces multiple equilibrium points. For each given set of initial positions , the symmetric Hopfield network (of equal size) with converges to a constant equilibrium point. When the network is deterministic (algebraic). The position of that point is determined uniquely by the initial conditions: all the initial positions that are in the sphere of absorbing a point of equilibrium will tend to converge to that point.
8. Methods of Calculation of Rate of Return
To measure the return on investment, the investment income is divided by the initial investment amount. The proceeds from the investment consist of two parts:
1) Amount received for dividends or interest on bonds
2) Profit or loss of capital due to changes in the price of securities during the investment period.
In other words, the difference between the inflow cash flow from the cash flow outflow, divided by the cash flow outflow, will indicate the “return on investment”. It means:
Rate of Return: Outgoing Cash Flow/(Cash Flow Outflow of Cash Flow Input)
Bond yields are calculated according to their maturity date. Therefore, the rate of return is compounded because it includes annual income and the increase or decrease of the value of the bonds until the maturity date.
The return on investment in ordinary shares is achieved in a given period, taking into account the first and last price and the benefits derived from ownership.
The interests derived from ownership in the periods that the company holds is held by the shareholder and will be zero in periods when the forum has not been held. The return on investment in stocks can be calculated using the following equation:
= share price at the end of period t;
= Share price at the beginning of period t or end of period t − 1;
= Interest generated by the ownership of shares held during the period t by the shareholder.
Benefits of ownership may be paid to shareholders in different forms, the most important of which are  :
1) Cash profit;
2) Increasing capital from the reserve (prize shares);
3) Increased capital from claims and cash inflows;
4) Stock split;
5) Stock aggregation.
For Equation (1), using the formula for calculating the rate of return per share. For the “2 and 3” modes, the formula for calculating the rate of return is as follows:
: Cash benefit paid
α: Percentage of capital increase from demand and cash inflow;
β: Percentage of capital increase from the reserve
C: The nominal amount paid by the investor for increasing the capital from the place of cash (and claims)
If the time of occurrence of each of the above states is before the payment (holding of the assembly), or in other words, if the extraordinary general assembly (in connection with the increase of capital) places before the ordinary general meeting (in terms of dividend), the rate of return will be as follows:
The symbols used are the same icons used in the previous formula. When decomposing shares, the company decides to devalue; in this case, the number of shares held by shareholders in proportion to the stock is decomposed, and the stock price in the market will decrease equally. Share yield in such a situation is obtained from the following relationship:
where S is Number of new shares.
“Stock aggregation” is a situation in which the company makes a decision to increase the nominal value of shares due to its low nominal value. The aggregation or combination of stocks, on the one hand, reduces the number of shares in the company and, on the other hand, increases stock prices in the market. Given that the rise in stock prices is not realistic in such a situation and has resulted from the aggregation of stocks, the factor of adjustment of returns with a “negative sign” appears in the relationship:
where Z is the number of shares that has become a share in accordance with the company’s resolution.
9. Stock Baskets
Raw data was collected by referring to the capital market database and then using the Excel software, the variables of the calculation were calculated and finally, by MATLAB software, identifies the optimal portfolios at different levels of risk aversion.
K: The number of optimal assets in the portfolio
λ: Risk aversion
Numbers represent the fraction of the total investor’s capital, which can be invested in each company.
In the portfolio selection question, there are a series of portfolios of assets that we want to find the optimal method for investing a certain amount of money in this asset. Different ways used to diversify this money between several assets is called a basket. To solve the basket selection problem, Markowitz proposed the so-called mean-variance model and it is assumed that the total basket returns can be described using the average return on assets and the return variance (risk) between these assets. Baskets that provide the minimum risk for a certain level of returns make the efficient frontier. For each level of expected average return, the effective boundary gives us the best way to invest our money. However, the average-variance model does not have the main cardinality constraints, which ensures that the number of assets in each basket is considered different, nor the bounding limits, which is the amount of money that must be invested in each asset. This series of limitations is very tight in practice. In order to overcome this incompatibility, the standard Markowitz model can be generalized with these restrictions.
A generalization is considered on the standard Markowitz Mean-Variance Model, which includes some limitative limbs. When the Markowitz mean-variance model is considered, the basket selection problem is a quadratic programming problem. But if this model is generalized with limitations, then the basket selection
Table 1. K5 related portfolios.
Table 2. K20 related portfolios.
problem will be transformed into a quadratic programming and numerical design. In this recent model, there is no algorithm and method that can solve the basket selection problem optimally. In this case, the use of the heuristic algorithm is essential. A special neural network model has been used in this project. The Hopfield network has been used to optimize some of the other optimization problems and is used to solve the portfolio selection problem.
The research has been supported by Tarbiat Modarres University, Shahid Beheshti University, and Khatam Al-Anbiya University of Tehran.
 Chang, T.-J., Meade, N., Beasley, J. and Sharaiha, Y. (2000) Heuristics for Cardinality Constrained Portfolio Optimization. Computers & Operations Research, 27, 1271-1302.
 Gilli, M. and Këllezi, E. (2000) Heuristic Approaches for Portfolio Optimization. Sixth International Conference on Computing in Economics and Finance of the Society for Computational Economics, Barcelona, 6-8 July 2000.
 Kellerer, H. and Maringer, D. (2001) Optimization of Cardinality Constrained Portfolios with an Hybrid Local Search Algortihm. MIC’2001—4th Methaheuristics International Conference, Porto, 16-20 July 2001.
 Xia, Y., Liu, B., Wang, S. and Lai, K. (2000) A Model for Portfolio Selection with Order of Expected Returns. Computers & Operations Research, 27, 409-422.