working paper 3/2018 m 2018 - unimi.itwp.demm.unimi.it/files/wp/2018/demm-2018_03wp.pdf3 given these...

13
DIPARTIMENTO DI ECONOMIA, MANAGEMENT E METODI QUANTITATIVI Via Conservatorio 7 20122 Milano tel. ++39 02 503 21501 (21522) - fax ++39 02 503 21450 (21505) http://www.economia.unimi.it E Mail: [email protected] PORTFOLIO MANAGEMENT USING PROSPECT THEORY: COMPARING GENETIC ALGORITHMS AND PARTICLE SWARM OPTIMIZATION SEYEDEHZAHRA NEMATOLLAHI GIANCARLO MANZI Working Paper 3/2018 MARCH 2018

Upload: others

Post on 06-Nov-2020

2 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Working Paper 3/2018 M 2018 - unimi.itwp.demm.unimi.it/files/wp/2018/DEMM-2018_03wp.pdf3 Given these assumptions, we describe the mean‐variance model considering a market of J different

DIPARTIMENTO DI ECONOMIA, MANAGEMENT E METODI QUANTITATIVI

Via Conservatorio 7 20122 Milano

tel. ++39 02 503 21501 (21522) - fax ++39 02 503 21450 (21505) http://www.economia.unimi.it

E Mail: [email protected]

PORTFOLIO MANAGEMENT USING PROSPECT THEORY: COMPARING GENETIC ALGORITHMS AND PARTICLE SWARM

OPTIMIZATION

SEYEDEHZAHRA NEMATOLLAHI GIANCARLO MANZI

Working Paper 3/2018

MARCH 2018

FRANCESCO GUALA

Working Paper n. 2011-18

SETTEMBRE 2011

ARE PREFERENCES FOR REAL?

CHOICE THEORY, FOLK PSYCHOLOGY,

AND THE HARD CASE FOR COMMONSENSIBLE REALISM

FRANCESCO GUALA

Working Paper n. 2011-18

SETTEMBRE 2011

Page 2: Working Paper 3/2018 M 2018 - unimi.itwp.demm.unimi.it/files/wp/2018/DEMM-2018_03wp.pdf3 Given these assumptions, we describe the mean‐variance model considering a market of J different

1  

Portfolio Management Using Prospect Theory:  Comparing Genetic Algorithms and Particle Swarm Optimization 

SEYEDEHZAHRA NEMATOLLAHI1, GIANCARLO MANZI2 Department of Economics, Management and Quantitative Methods 

Università degli Studi di Milano  

Abstract In this work, we compare the performance of two metaheuristic optimization algorithms, namely the Genetic Algorithms (GA) and the Particle Swarm Optimization  (PSO),  in  finding an optimized  investing portfolio. This comparison  is based on two performance criteria:  the  consistency and quality of  the  solution and  the  speed of  convergence of  these  two algorithms. These metaheuristic algorithms will be developed further to specify the weights of assets  in an optimal portfolio, which  is a portfolio with a maximum level of return (or a minimum level of risk) using a portfolio optimization model. We chose the prospect theory portfolio optimization as our background model. The prospect theory model is the main behavioral alternative to the expected utility theory and is still a relatively new subject in the financial literature. A mean‐variance portfolio optimization has also considered as a benchmark to our behavioral model. The performance of these two models has been evaluated in practice using several criteria such as the CPU time and the ratio between the portfolio mean returns   and the standard deviation   (as a measure of portfolio’s risk). Finally, an out‐of‐sample test as well as simulated bullish and bearish markets were performed to analyze the efficiency of these models based on historical data.  

                                                            1 Email: [email protected] 2 Email: [email protected] 

Page 3: Working Paper 3/2018 M 2018 - unimi.itwp.demm.unimi.it/files/wp/2018/DEMM-2018_03wp.pdf3 Given these assumptions, we describe the mean‐variance model considering a market of J different

2  

1. Introduction Portfolio  selection  can  be  described  as  a  procedure  of estimation,  analysis  and  collection  of  risky  assets  with different weights to provide an  investor with an acceptable trade‐off between portfolio return and risk. There are many different  theories,  which  try  to  formulate  this  portfolio optimization  problem.  Among  them,  the modern  portfolio theory  and  the  behavioral  portfolio  theory  are  two widely known theories to explain the investors’ behavior in financial markets. The  modern  portfolio  theory  was  introduced  by  Nobel winner  Harry  Markowitz  in  1952  as  a  parametric optimization model  for  portfolio  selection  [1]. Markowitz’s theory,  known  as  the mean‐variance model,  considers  the portfolio  selection  problem  as  a  procedure  for  the estimation,  analysis  and  choice  of which  financial  assets  a risk‐averse investor should hold for a specific period with the aim  of  maximizing  the  expected  return  (as  a measure  of portfolio return) given a constant variance (as a measure of portfolio  risk)  [2].  In  this model,  the  number  of  different securities  and  their  correlation  are  factors  worthy  of consideration  in  constructing  a  diversified  portfolio  [3]. Markowitz  analysis  shows  that  the  risk  of  a  position  is  as important  as  its  realized  returns,  and  should  therefore  be included in an investor’s analysis [4]. Contrary to the assumptions in Markowitz’s theory, the work of Daniel Kahneman  and Amos  Tversky  [5]  shows  that  the behavior  of  an  investor  in  the  real  market  completely violates  the mean‐variance  theory’s  assumption  about  the investor  to be a  risk‐averse maximizer of expected  returns. They have  suggested  the  ‘prospect  theory’  as  a behavioral alternative  to  the  mean‐variance  model.  Their  suggested model  tries  to  describe  a  decision‐making  framework  to choose  between  several  risky  alternatives,  considering  the effects of behavioral biases on an investor’s decision [6]. The prospect theory model  includes a value function, which is described on the domain of gains and losses instead of the final wealth  (in  case of  the expected utility  theory),  and  is weighted by a non‐linear probability in various states of the world,  called  scenarios.  This  theory  assumes  that  investors are  loss‐averse  in  general,  and  that  they  are  risk‐averse when comparing two gains, but risk seeking when comparing two losses [7]. In 2000, the behavioral portfolio theory (BPT) was developed by [8] based on the security, potential and aspiration theory (SP/A) [9] and prospect theory as two psychological theories to describe the process of choice under uncertainty. Today, both modern portfolio  theory  (MPT) and behavioral portfolio  theory  (BPT)  are  being  used  to  explain  the investors’  behavior  in  financial  markets.  We  can  think  of modern portfolio theory as a model describing the financial market  mechanism  in  an  ideal  world,  while  behavioral portfolio  theory  tries  to characterize  this mechanism  in  the real world. In this paper, we apply a prospect theory model to construct an optimal portfolio based on  the desire of  a hypothetical investor  with  certain  loss  and  risk  aversion  levels  to  be discussed  in  later  sections. We  also  use  a  mean‐variance portfolio  optimization model  as  a  benchmark  to  check  the performance  of  our  behavior‐based  portfolio  selection model. 

Since our prospect theory model is non‐convex, it cannot be efficiently  solved  by  exact  optimization  algorithms  [10]. Therefore,  many  sources  in  the  literature  suggest metaheuristic algorithms to obtain an “optimal” solution for this  portfolio  optimization model.  For  some  examples,  see [11] and [12]. In this study, we  implement the genetic algorithm (GA) and particle  swarm  optimization  algorithm  (PSO)  as  two examples  of  the  increasingly  popular  nature‐inspired metaheuristic  algorithms  to  solve  portfolio  optimization models. In  the  GA,  we  represent  the  practical  solutions  of  our problem  using  chromosomes.  Then  for  each  generation,  a “fitness  function”  (the  objective  function  of  the optimization)  is  assigned  to  the  population  of  these chromosomes  to  evaluate  them.  The  chromosomes  with more  fitness  value  are  given  higher  opportunities  to “recombine”  and  form  a  new  generation  as  “offspring” sharing  some  features  taken  from each “parent.” The  least fit members of the population are  less  likely to get selected for  recombination and  so  “die out.” Moreover, a mutation operator  will  change  some  features  of  this  offspring  to ensure the diversity of the next generation [13]. Like  GAs,  PSO  is  a  nature‐inspired  optimization  method based  on  the movement  behavior  of  bird  and  fish  flocks. Considering  the  feasible  solutions of our problem as a bird swarm  and  the  food  resource  as  the  best  solution  in  the whole  search  area,  the  birds  moving  from  one  place  to another  is equal  to  the development of  this  solution using the  information‐sharing  property  of  a  swarm.  Indeed,  bird swarm  individuals  are  transmitting  information,  especially the good information, at any time while searching from one place to another for food. The PSO algorithm is very simple, easily computable and needs only a  few parameters. These properties  have  contributed  to  the  algorithm  becoming  a widely‐used  method  to  solve  many  complex  optimization problems [14]. 

2. Problem formulation 2.1. Mean‐variance model 

The  mean‐variance  model  states  that  the  most  desirable portfolios  have  the  minimum  expected  risk  at  any  given expected  rate  of  return  or,  conversely,  the  maximum expected rate of return at any given level of expected risk. In this paper, we analyze the latter case. This  classic  portfolio  optimization  theory  is  based  on  four fundamental behavioral assumptions: 1. Each asset  is presented by a probability distribution of 

return   measured  over  a  specified  time  interval  (its holding period). 

2. The  investors’ estimates of risk are proportional to the standard deviation of returns  . 

3. The investors’ decisions are only based on the expected return and risk statistics. Considering the distribution of asset  returns  to  be  normal,  this  means  that  the investors’ utility  is a function of the standard deviation of returns   and the expected value of return  . 

4. For any given  level of risk, the rational  investors prefer higher  returns  to  lower  returns.  Conversely,  for  any given  level  of  rate  of  return,  the  rational  investors prefer less risk to more risk. In other words, all rational investors are risk‐averse and rate of return‐maximizers [15]. 

Page 4: Working Paper 3/2018 M 2018 - unimi.itwp.demm.unimi.it/files/wp/2018/DEMM-2018_03wp.pdf3 Given these assumptions, we describe the mean‐variance model considering a market of J different

3  

Given  these  assumptions,  we  describe  the  mean‐variance model considering a market of    different assets which are traded  at  the  initial  time  0  with  prices  

0 , 0 ,⋯ , 0 0. We know that at the final time ,  the  asset  prices    , , ⋯ ,   are  non‐negative 

random variables on a probability space  Ω, , Ρ . For  constructing  our  Markowitz‐based  portfolio,  we calculate the return of each asset as: 

≔   (1) 

for  1,⋯ , .   

Then, we can obtain the expected rate of return and risk for a given asset   using the historical mean and variance of the return as an estimate: 

  (2) 

  (3) 

1,⋯ , .   

As mentioned  earlier,  the  correlation  coefficient  is  one  of the  key  factors  in  Markowitz’  portfolio  selection.  This component helps us to know whether a positive deviation in one asset will  lead  to positive or negative deviations  in  the other assets or whether they are  independent [16]. We can calculate the correlation coefficient between assets     and   using the next equation: 

  (4) 

where the covariance of assets   and   is calculated as: ,   (5) 

A perfect positive  linear  relationship between   and   will have a  value of +1, while a value of –1  indicates a perfect negative  relationship between  these assets’  rates of  return [17]. Given  these  assets’  financial  relationships,  now  we  can simply  calculate  the  performance  of  each  hypothetical portfolio.  Technically  speaking,  the  risk  and  return  of  a portfolio  can  be  treated  as  a  convolution  of  the  individual assets’  returns  and  covariance  when  these  assets  can  be described by  the distributions of  their  returns. So,  suppose that an  investor  is  interested  in  investing  in    risky assets. We  can  present  her  choice  as  an  1  vector  array 

, … ,   of  asset weights where  each    represents  the share of asset   in this portfolio wherefore the sum of these weights must be equal to 1: 

1  (6) 

Then, the expected return of our portfolio with the weight of allocated assets presented as   , … ,  is: 

  (7) 

And the variance of this portfolio will be: 

  (8) 

Accordingly,  for  a  portfolio  with  a  low  or  negative correlation  among  asset  returns,  the  standard deviation of the  portfolio’s  rates  of  return  and  hence  the  risk  of  the portfolio itself will be reduced. In fact, equation (8) shows us the  effect  of  diversification  in  which  combining  different asset  categories  in  a  portfolio  may  reduce  the  overall portfolio risk without harming potential returns. 

As  stated  already,  the  basic  idea  of Markowitz  is  that  the rational  investor  takes  decisions  based  on  a  tradeoff between  the expected  return  (i.e. portfolio mean) and  risk (i.e.  portfolio  variance).  Indeed,  the  investor  solves  the portfolio optimization problem by setting a lower bound for the portfolio  return,  and  then he/she  tries  to determine  a portfolio vector with the lowest possible risk. In the classical mean‐variance model,  the  task  of minimizing  the  portfolio risk   given a lower bound   for the expected return    can be illustrated as follows: 

  (9) 

Subject to:  0 for  1,⋯ ,   (10) 

1  (11) 

  (12) 

We  can  also  add  transaction  costs  and  other  particular constraints, such as a short sell allowance  in  the market or weights bounds on  the  investor’s portfolio  to our portfolio optimization  problem  (if  short  selling  is  allowed,  then  the weights of assets in the portfolio can be negative). Therefore,  for  finding  the optimal mean‐variance portfolio, we have a convex quadratic programming problem to solve. Here,  the  first  and  second  constraints  indicate  that  the weights of assets in our portfolio are non‐negative (no short sale) and  sum up  to 1. The  third constraint  shows  that  the expected  return  is no  less  than  a boundary  value   when our objective function is the total variance of the portfolio. Solving  this  problem  for  different  values  of  the  expected return  boundary  , we  obtain  a  set  of  feasible portfolios. We  use  the  term  efficient  portfolios  for  those  feasible portfolios with maximum  return  among  all  portfolios with the  same  variance  (risk).  The  set  of  all  these  efficient portfolios constructs the mean‐variance efficient frontier or simply efficient  frontier, which  is  a  two‐dimensional  curve. Each  point  of  the  efficient  frontier  corresponds  to  the standard deviation  and  the  expected  return of  an  efficient portfolio [18]. So,  given  this  efficient  frontier,  the  investor  could  choose his/her  preferred  portfolio,  based  on  his/her  personal  risk return preferences. 2.2.  Prospect Theory Model First, we define a prospect as a function from a finite set of states of nature   to a set of probable monetary outcomes  which  assigns  a  monetary  outcome  to  each  state  ∈ .  Considering     as the probability of each state of nature  , we  can  show  a  lottery  as  the  corresponding  pairs  of  all monetary  outcomes  and  their  probability  of  occurrence  as , ; … ; ,   where the sum of all probabilities is equal to 

one. 

⋯ 1  (13) 

Here,    1,2, … , 1,  denotes  the  finite  set of  states of nature while  ,   is  representing a scenario  (prospect)  in which the probability of having an amount of outcome    is equal to  . Assuming a reference point   , we can classify the monetary outcomes  as  gains  (positive  outcomes  which  are  greater than ) or  losses  (negative outcomes which are  lower than ) [19]. 

Page 5: Working Paper 3/2018 M 2018 - unimi.itwp.demm.unimi.it/files/wp/2018/DEMM-2018_03wp.pdf3 Given these assumptions, we describe the mean‐variance model considering a market of J different

4  

Then  we  can  write  the  subjective  utility  function  for  this lottery as: 

: ,  (14) 

where  the  prospect  theory  utility  function  is  a  non‐linear function  wherein  ∶ →   is  the  value  function  defined over  changes  in wealth  instead  of  final wealth  (in  case  of mean variance model), and  ∶ 0,1 → 0,1  is the probability weighting  function  which  transfers  real  probabilities  into subjective probabilities [20]. The probability weighting function   has some properties: 

x It is a continuous and monotonous increasing function. 

x For  small  values of  0 , we have  ,  and  for large values of  1 , we have  . This captures the  fact  that  individuals  tend  to overweight  the  small probabilities  and  underweight  the  large  probabilities. Moreover, we have  0 0 and  1 1. 

It  is  important  to  note  that  the  probability  weighting function  represents  not  just  the  probability  of  events  but also  the  impact  of  these  events  on  the  desirability  of prospects  and  so  is  a  distortion  of  the  given  probability. Therefore,  0.5  is not necessarily equal to 0.5. The value function   has also three key features: x It  is a continuous and monotonous  increasing  function 

defined  over  the  domain  of  gains  and  losses, considering some neutral reference point  . 

x It  is  strictly  concave  in  the gain domain and convex  in the loss domain. 

x The value  function  is steeper  for  losses  than  for gains. (Its slope at   is greater than its slope at  ) [20]. 

It should also be mentioned that the concavity of the value function  in  the  domain  of  gain  justifies  the  risk‐averse behavior  of  investors  while  the  convexity  of  the  value function  in  the  domain  of  loss  justifies  their  risk‐seeking behavior. Besides,  the higher slope of  the value  function  in the domain of losses demonstrates the loss aversion attitude of investors in the prospect theory model. Now, we need to find   and   which are appropriate for our optimization problem. Our choice of value function is the value function   proposed [21] as a piecewise power function for  , ∈ 0,1  and  1   and a reference point  , as: 

,,   (15) 

Here,    and    are risk aversion coefficients with respect to gains and losses while   is the loss aversion coefficient which underlines the observed fact that investors respond to losses more strongly than to gains. Kahneman and Tversky suggest the loss aversion coefficients 

0.88  and  the  loss  aversion  coefficient  2.25  , based on their laboratory results. For the probability weighting function  , different forms have  been  suggested  as  well.  The  original  choice  of Kahneman and Tversky is as follows: 

≔1

  (16) 

where    captures  the  perception  of  probabilities  by investors  and  0.27 1.  A  lower    indicates  a  stronger distortion in the probabilities they perceived. 

We can also consider different weighting functions for gains and losses denoted by   and  . However, for the sake of simplicity  in  this  study,  we  considered    in  our constructed prospect theory model. The  form  of  value  function  and  probability  weighting function  for a  standard prospect  theory model  is  shown  in Figure . In  the  following, we  fit  the  prospect  theory model  to  our asset  allocation  problem.  Assuming  a  portfolio  of    risky assets where  the proportional weight of asset    is denoted by    for  1,… ,  and the sum of all weights is equal to 1, i.e. ∑ 1.  Moreover, we consider the weights to be non‐negative  0, ∀  which means  that  short  selling  is not allowed in the market. 

 Figure  1.  Value  function  and  weighting  function  of  the  prospect theory model

Now,  the  return  of  a  portfolio  , … .   can  be defined as a weighted average of all assets in different states of nature. So, we have the following equation: 

  (17) 

where    is  the  proportional  weight  of  asset    in  the portfolio  and    is  the  return of  asset    in  scenario  .  (1,… , ). The  standard  prospect  theory  asset  allocation  problem consists of maximizing the objective function of this portfolio with  a  desired  level  of  return  above  .  This  optimization problem is formulated as follows: 

  (18) 

subject to the constraints: 

1  (19) 

0 , ∀ (20) 

  (21) 

To solve  this optimization problem, we commonly confront two  types of computational complexity: First, our objective function is not differentiable for some  ; for them,   is equal to zero. Second, this problem is categorized as a non‐smooth optimization  problem.  The  available  algorithms  for  non‐smooth  problems  require  the  objective  function  to  be convex.  This  is not  the  case  for our prospect  theory‐based asset  allocation  problem  which  is  a  non‐linear  and  non‐convex optimization model with the objective function being non‐linear  and  non‐convex.  Despite  this,  in  case  we  have many  assets  in  our  portfolio,  the  asset  allocation  problem will become too complex to be solved by classical numerical methods [21]. Therefore,  many  researchers  and  financial  experts  use heuristic methods to solve this type of portfolio optimization 

Page 6: Working Paper 3/2018 M 2018 - unimi.itwp.demm.unimi.it/files/wp/2018/DEMM-2018_03wp.pdf3 Given these assumptions, we describe the mean‐variance model considering a market of J different

5  

problems. These heuristics optimize the problem by using a procedure of producing and evaluating some new points and finally  yield  the  best  solution  found  during  this  process  as the  optimal  point.  In  fact,  heuristic methods  combine  the advantages of classical algorithms, yet they are more flexible and less restricted to constraints [16]. In  this  study,  we  have  used  genetic  algorithms  (GA)  and particle swarm optimization (PSO) as the two most common metaheuristic  methods  for  the  asset  allocation  problems with prospect theory objective function. 

3. Solution approaches 3.1 Genetic algorithms (GA) Genetic algorithms are based on concepts derived from both genetics and evolution theory.  Nowadays, Holland’s Theory is known as an operative  tool  in  the domain of  search and optimization  problems  and  is widely  used  by  scientist  and engineers [22]. Genetic algorithms can be taught as a broad collection of  stochastic optimization algorithms  that  let  the fittest survive and the weak die [23]. A typical continuous GA works as follows.   1. Initialize the population of chromosomes.  2. Evaluate  each  chromosome  using  an  evaluation 

function  . 3. Repeat  the  following steps until a stopping criterion  is 

satisfied.  � Select parents from the population. � Perform a mating operation on parents, creating a 

new population of offspring. � Perform a mutation operation on a percentage of 

the offspring.  � Evaluate the chromosomes of a new population.  

A  genetic  algorithm,  like  any other optimization  algorithm, begins by specifying the model variables known as genes. A potential  solution  (a  chromosome)  to  our  optimization problem can be represented as a set of these variables. For example, a chromosome with   variables (in the case of an N‐dimensional  optimization  problem)  can  be written  as an array with 1  elements:  

, , , … ,   (22) 

where    is  the value of  the     variable.  In  this way, each chromosome can be defined either as a binary or a real code string [24]. A  real GA has  several  advantages.  For  instance,  it  requires less storage space and is particularly faster than a binary GA. In  addition,  it  is  more  convenient  to  solve  continuous optimization problems. Therefore, we decided  to  construct our GA algorithms based on real encoding.   In  a  GA with  real  encoding,  a  chromosome  is  a  vector  of floating point numbers and the size of each chromosome  is the same as the length of this vector [25].  The GA  procedure  starts with  defining  a  group  of  random chromosomes known as the initial population  . The total number of variables in each generation can be presented by a    matrix.  Then  we  evaluate  each  chromosome  of  this  initial population to find the chromosomes which are fit enough to survive and more likely to participate in producing offspring in  the  next  generation.  Thus,  we  employ  an  objective function   to obtain the fitness of each chromosome:   

, , , … ,   (23) 

The  aim  of  our  optimization  problem  is  to  find  the  global optimum  for  this  objective  function.  After  evaluating  each chromosome  in  a  standard  genetic  algorithm,  the  next generation  of  chromosomes  (probable  solutions)  will  be produced  using  three  operations:  selection,  mating (crossover) and mutation.  In the selection stage, we choose the fittest chromosomes in the  initial population  to survive and possibly reproduce  the next  generation.  These  selection  processes  are  mostly stochastic, and  their aim  is  to preserve  the diversity of  the population and prevent an early termination of the process (in case of trapping in some sub‐optimal solutions) [26]. The  selection  operation  can  be  undertaken  by  several methods  including  rank‐based  selection,  roulette  wheel selection and  the  tournament  selection.  For  this  study, we implemented  the  tournament  selection as one of  the most common selecting methods.  In  the  tournament selection method, several chromosomes are  randomly  chosen  from  the  population.  These chromosomes are compared with each other, and  the best fitting one  is chosen to be the parent of the next offspring. This  procedure  will  continue  until  we  find  the  adequate number of parents to mate [27]. After choosing the set of parents using a selection method, it is time to produce the next generation of chromosomes. In a genetic  algorithm,  two  operators  are  used  to  produce  the next  generation:  the  mating  operator  (sometimes  called crossover) and the mutation operator.  In  the  mating  operation,  two  parents  are  chosen  and combined  to make  the  offspring.  There  are many mating operators, but  the most common procedure  is  to randomly select two parents and then exchange some portion of their characteristics  between  them  to  create  two  new  offspring [28]. Many different approaches have been tried for mating in  continuous  GAs.  We  will  review  and  apply  the  whole arithmetic mating to our portfolio optimization model. The whole arithmetic mating is probably the most commonly used operator in which the offspring are produced by taking the weighted mean of two parents. With two parents, A and B, each offspring will be generated as: 

1 ∗ 1 ∗   (24) 

2 ∗ 1 ∗   (25) 

Here,   is a random value between [0,1].  The  mutation  operation  is  the  final  step  of  the  GA procedure. This operator allows  the GA process  to explore new  potential  solutions  to  our  problem while  keeping  the GA  from an excessively  fast  convergence  through  finding a local  maximum.  This  operator  randomly  modifies  both offspring  resulting  from each mating operation  to  form  the new generation [29]. There are many different forms of mutation for the different kinds  of  representation.  In  this  study, we  have  decided  to implement the uniform mutation.  In  the uniform mutation,  ‐th element of  the chromosome  , , , … , , … ,  are  randomly  selected. Then, a normally distributed random number   is added to  . The new  chromosome  is  a  vector  , , , … , , … ,  where  . This  process  of  selection, mating  and mutation  operations iterates until an acceptable optimal solution is found by the algorithm.  The  GA  algorithm’s  speed  of  convergence  is 

Page 7: Working Paper 3/2018 M 2018 - unimi.itwp.demm.unimi.it/files/wp/2018/DEMM-2018_03wp.pdf3 Given these assumptions, we describe the mean‐variance model considering a market of J different

6  

affected  by  different  methods  of  selection,  mating  and mutation  employed  in  our  optimization  problem.  So, deciding on  the appropriate operators  is a major  issue  in a genetic algorithm. Indeed, each of these methods leads to a different  set  of  parents  so  the  composition  of  the  next generation will be different for each selection method [30]. 3.2 Particle swarm optimization (PSO) The  Particle  Swarm  Optimization  (PSO)  algorithm  is  a population‐based  stochastic  optimization  technique introduced by  [31]. This algorithm  is based on a population of  search  points  called  particles.  These  particles  move stochastically in the search space, and the best position ever attained by  these particles, also known as  its experience,  is retained  in  a  specific  memory.  This  experience  is  then communicated to a part of or the whole particle population, leading  its movement  towards  the  best  areas  detected  so far. This communication design  is determined by a  fixed or adaptive  social  network  and  plays  a  key  role  in  the convergence properties of  the particle  swarm optimization algorithm [32]. As  mentioned  earlier,  the  PSO  model  consists  of  a population  of  individuals  where  each  member  of  this population represents a potential solution in a search space. This  population  is  called  a  swarm,  and  its  members  are called  particles; We  can  represent  the  swarm    as  an  ‐dimensional set:  

, , … ,   (26)

where    represents  the  current  positions  of  the  particles and each particle is defined as: 

, , ⋯ , ∈ , 1,⋯ ,   (27)

Here  ⊂   is  the  feasible  space  of  the  problem,  and  the objective function of our optimization problem  : → ⊂  is as follows: 

∈   (28)

First, we  initialize  the particles’ positions  randomly, using a uniform  distribution  on  the  search  space  A.  Then,  each particle    is  iteratively moved  through  the search space A, with some velocity   denoted as: 

, , ⋯ , , 1,⋯ , (29) 

This  velocity  vector  determines  the  next  direction  and distance  of  the particles,  allowing  them  to  be  investigated throughout the search space area.  The  velocity  is  updated  based  on  information  obtained  in previous steps of the algorithm. This information is stored in a memory, where each particle can save the best position it has  ever  visited  during  its  search.  For  this  purpose,  we introduce the PSO memory set as: 

, , ⋯ ,   (30) 

which  includes  the  best  positions  ever  visited  by  each particle:  

, , ⋯ , , 1,2,⋯ , (31) 

These positions are demonstrated by: max   (32) 

where    represents  the  iteration  numerator  and    is  our objective function.  So,  for   denoting our  iteration numerator, each particle  in the  swarm  consists  of  three  parts:  (1)  its  position  in  the search  space  ,  (2)  its  velocity    and  (3)  its memory  , where the best positions are saved.  Then,  the PSO algorithm will approximate  the best position ever  visited  by  whole  particles  using  an  information 

exchange  mechanism.  This  mechanism  allows  particles  to mutually  communicate  their  experience  to  find  the  best solution within our  search  space. So, at a given  iteration  , the best position of the entire population   is obtainable using the formula: 

argmax   (33) 

In the early version of PSO presented by [31], the velocity is updated by using an equation as follows: 

1  

 (34) 

1, …  and  1,… ,    

where    is  the  number  of  iterations.    and    denote random  variables uniformly distributed within  0,1 ; and   and    are  weighted  acceleration  factors  adjusting  the impact of the local and global information.  Then,  the position of particle    in  the next  iteration will be calculated as: 

1 1   (35) 1,⋯ , 1,⋯ ,    

 The particles are evaluated at each iteration after which the best position will be updated. Hence  the new best position of   at iteration  1 can be formulated as follows: 

Each  iteration  of  PSO  will  be  completed  by  finding  and updating the general best position   [32].  The  basic  concept  of  PSO  lies  in  accelerating  each  particle toward its   and   positions, with a random weighted acceleration at each iteration. The  particle  swarm  optimization  (PSO)  procedure  can  be summarized with this pseudo‐code: � Objective function  , , … ,  � Initialize locations   and velocity   of   particles � Find   from  , … , 0  � While (criterion) � For loop over all   particles � Generate new velocity  1   � Calculate new locations  1   � Evaluate objective functions at new locations  1  � Find the current best for each particle   � Update  1 � End While  � Output the results  Although this  initial version of PSO can be perfectly applied to  a  simple  optimization  problem,  researchers  have confronted  some  deficiencies  in  using  this  algorithm  for harder problems with a vast search space and several  local maxima.  The  swarm  explosion  effect  is  one  of  these  deficiencies caused by an  increase  in the value of a particle’s velocities, leading  to  divergence  in  the  PSO  algorithm.  In  fact,  this explosion  indicates  the  lack  of  a  proper  mechanism  for constricting velocities in initial PSO. Therefore,  [33]  suggested  a  more  generalized  PSO  by appending  constriction  coefficients  to  the  initial  version  of the  algorithm.  Their  model  is  defined  by  the  following equations: 

11 , 1,

  (36) 

Page 8: Working Paper 3/2018 M 2018 - unimi.itwp.demm.unimi.it/files/wp/2018/DEMM-2018_03wp.pdf3 Given these assumptions, we describe the mean‐variance model considering a market of J different

7  

1

(37) 

1 1   (38) 

for 1,2,⋯ , 1,2,⋯ , .

where  the  constriction  coefficient    controls  the convergence  of  the  particle  and  prevents  the model  from the explosion effect and divergence  [34]. This coefficient  is calculated using the follow equation: 

22 4

  (39) 

Here,    and  4.  In  Clerc  and  Kennedy’s constriction method, we usually set  0.729 and 2.05. In this study, we have applied a PSO algorithm with adjusted velocity and position limits to handle the particles’ positions and  velocities which  are  placed  outside  our  search  space. The feasible search space for our asset allocation problem is an  0,1   interval  for each particle  (that  is,  it corresponds  to the weight of each asset in our portfolio). Thus, to maintain the  particles  within  the  interval  of  feasible  solutions,  we have  implemented  two  constraint‐handling  mechanisms, namely  the  reflect  method  and  the  deterministic  back method,  on  the  position  and  velocity  of  particles  in  each iteration of algorithm.  As  a  position  limit, we  have  applied  the  reflect method  in which  the boundary of  search  space operates  like a mirror and  if  the  updated  velocity  refers  to  a  non‐feasible  point (outside  our  search  space),  it  will  be  reflected  at  the boundaries of our feasible interval.  Moreover,  we  have  used  a  deterministic  back method  to restrict the particles’ velocity. In this method, the velocity of particles outside the search space will be multiplied with   for  some  0.  In  our  particle  swarm  optimization algorithm, we set  1 [35]. 

4. Experimental set‐up 4.1. Data In  this  paper,  we  try  to  solve  the  portfolio  optimization problem using the publicly available data of 30 assets in the Nasdaq stock market as a major market  index  for 260  time periods each  (weekly data),  taken  from  the Yahoo Finance! website.  The  data  is  presented  in  the  form  of matrices  of asset  adjusted  close  prices.  We  transformed  the  original data set into matrices of asset returns using the logarithmic rate of return. Then, to test the performance of our models in different problem conditions, several subsets of the main data set with 10, 15 and 20 assets were randomly picked.  We  also  conducted  an  out‐of‐sample  test  to  evaluate  the performance of the proposed models. To do so, the first 90 data points were considered as  the  in‐sample data and  the remaining  periods  (170  data  points)  were  used  as  the historical out‐of‐sample test inputs.  Further, we applied the data set to create two simulated markets (namely a bearish market  and  a  bullish  market)  as  out‐of‐sample  tests  to analyze the efficiency of these models. In [36], a bearish market is defined as a period in which the prices  of  securities  or  commodities  fall  by  20  percent  or more.  During  such  a  period,  the  investment  interest  is generally  limited,  the  investors’ concern about  the  state of the economy will rise, and the investors are more interested 

in  selling  their  investment  than  to  increase  their  risk  by holding them. On the other hand, a bullish market denotes a period in which prices are rising, securities are traded in high volumes, the investment interest is high, and investors view the economy as strong and getting stronger.   To  simulate  these  two  markets’  behaviors,  bearish  and bullish,  we  used  the  built‐in  functions  accessible  in  the Statistics Toolbox in MATLAB.  To  construct  a  sample with  the  characteristics  of  a  bullish market, we  picked  out  a  set  of  assets  returns  from  4‐Jan‐2013  to 2‐Jan‐2014 which  indicates a progressive economic market. Then the simulated data of the bullish market were obtained  using  the  MATLAB  function  ,   that  returns k observations  sampled uniformly  at  random, with  replacements  filled  in  from  our data set. The  bearish market  sample was  based  on  a  set  of  assets returns  from  4‐Jan‐2008  to  31‐Dec‐2014,  which encompasses the 2008 financial crisis as the worst economic situation  since  the  great depression of  1929. We used  the MATLAB function   ; ;  that returns a matrix  of  random  numbers  chosen  from  the multivariate   distribution,  where   is  the  matrix  of historical data,   is the degrees of freedom and  is either a scalar or  is a vector with   elements  (we  choose 4).  For  , the  number  of  columns  in  ,  the output   has   rows and   columns.  The  student  t  distribution was  selected  because  of  the  fat tails  characteristic  of  asset  return  distributions  which allocate more  probability weights  to  low  returns  imitating the real market situation [37]. 4.2. Experimental design  During this study, we run each GA and PSO algorithm 5 times to eliminate  the probability of a  lucky  initialization. To  test the  performance  of  these  algorithms,  a  prospect  theory model  is  applied.  The  best  solution  of  each  run  with  the same parameters and objective function will be stored. The error of each algorithm   as a metric of the solution quality can be obtained by calculating the average deviation of the best  solution  of  each  run  of  an  algorithm  from  the  best solution  of  all  runs  of  this  algorithm.  However,  since  the optimal solution of the prospect theory problem  is typically unknown,  and  we  have  no  benchmark  for  comparative analysis, the errors of our optimization algorithms from the optimal  solution  using  above  metrics  are  not  the  actual errors [38]. Moreover, since the consistency of an algorithm is defined as the ability of an algorithm to always find a good (near‐optimal) solution, we can take the standard deviation of  algorithm  errors    as  a  consistency  measure  of  our metaheuristics.  To measure  the  speed  of  our  optimization  algorithms, we use  the  average  CPU  time  and  number  of  function evaluation (NFE) which is required by each algorithm to find an acceptable solution. Here, NFE reports  the  total number of  objective  function  evaluations. We will  also  analyze  the sensitivity of these two metaheuristic algorithms to different values of the population size and the number of iterations. After  testing  several  cases we  found  out  that  in  our  non‐linear  problems  with  continuous  design  variables,  PSO outperforms  GA;  so,  we  performed  the  next  part  of  the study using PSO algorithm.  

Page 9: Working Paper 3/2018 M 2018 - unimi.itwp.demm.unimi.it/files/wp/2018/DEMM-2018_03wp.pdf3 Given these assumptions, we describe the mean‐variance model considering a market of J different

8  

In  this  step,  we  implement  the  selected  metaheuristic algorithm in our behavioral asset allocation model to find an optimal  solution  which  maximizes  the  utility  of  an assumptive  investor. We also apply  this heuristic algorithm to solve a mean‐variance portfolio optimization model as a benchmark  to  analyze  the  performance  of  our  behavior‐based model.  While the convex mean‐variance model will be solved easily using  the  portfolio object  in  the  Financial  Toolbox  of MATLAB,  the  non‐convexity  of  the  prospect  theory model makes  its  solution  approach  a mathematical  challenge.  To reduce  the  complexity  of  the  behavior‐based  problem, we define  the prospect  theory’s weighting  function as   , and employ original Tversky’ value function. The  risk  aversion  and  loss  aversion  coefficients  are  also chosen as  2.25,  0.88  which are exactly the parameter values suggested by [19]. In addition, we calculate the desired level of return   for the selected portfolio  considering  the mean  return of assets  in the market using this equation:  ∗ 0.25  (40) 

Here,   and    are  the  maximum  and  minimum mean of asset returns for every specific set of assets [39]. In  Table  1,  the  desired  level  of  return    along  with  the chosen amount of reference point   for markets with 10, 15 and 20 assets are reported. The value of the reference point in  our model  is  proportional  to  the  3‐month  Treasury  Bill Rate for November 2012.  

Table 1. Desired returns and reference points of current models 

     

10  0.0031  0.0007 

15  0.0032  0.0007 

20  0.0034  0.0007 

4.2.2. Parameters of the heuristic algorithms Both  genetic  algorithm  and  particle  swarm  optimization have  parameters  that must  be  tuned  before  applying  the algorithms  to  our  portfolio  optimization models.  Since  the efficiency of these algorithms is strongly affected by chosen parameters,  it  is  important  to  find  an  adequate  set  of parameters  for  each  metaheuristic  algorithm  to  increase their performance. As we mentioned earlier,  the performance of an algorithm can be measured using several criteria. To choose a proper set  of  parameters, we will  evaluate  the  efficiency  of  each algorithm  using  computational  time,  the  average  value  of the best solution of the algorithm and the error term  .  To  analyze  the  efficiency  of  heuristic  algorithms, we  use  a prospect  theory  utility  as  our  objective  function  to  be maximized. Hereby, we evaluated  the performance of each optimization  algorithms  to  solve  a  prospect  theory  based asset allocation model without boundary on  the number of assets or portion of asset weights to be held  in the optimal portfolio. The parameter sets  leading each algorithm  to  find a better solution for the prospect theory optimization problem, with lower mean errors   and standard deviation of errors  , will be passed on  to  the next part of our study.  In  fact, we are interested  in  achieving  a  balance  between  computational time and the consistency of solutions.  

We  know  that  the  parameters  of  heuristic  algorithms  are highly dependent on  the objective  function  characteristics. There are a lot of cases in the literature which have studied sets  of  parameters  suitable  for both  PSO  and GA  heuristic algorithms. See for example [40‐43]. The number of particles/chromosomes (population size) and the number of iterations are two common parameters which greatly  affect  the  efficiency  of  our  intended  heuristic algorithms. To find the most appropriate population size and number of  iterations for both GA and PSO  in this study, we have performed a test with different values for each of these two parameters using the prospect theory model. Then the test was  repeated 5  times  for each  set of parameters, and the performance of our model was evaluated.   We  test  several population  sizes, namely  40, 50, 60,  for both algorithms  to  find a  suitable value  for  this parameter considering the CPU time, consistency and the quality of the solution. Then,  to  choose  the  adequate  number  of  iterations,  we repeat the tests for  150, 200, 250 and evaluate again the CPU time, consistency and the quality of the solution of both the GA and PSO algorithms. In  the  genetic  algorithms,  apart  from  the  size  of  the population and the maximum number of iterations, we must choose other parameters,  including  the mutation  rate,  the mating rate and the selection method. The mating rate is the probability  that  a mating  procedure will  be  performed  on two  selected  chromosomes  while  the  mutation  rate  is likewise  the  probability  that  a  mutation  procedure  will happen on the offspring of two chromosomes. The appropriate rate of the mutation operation  is generally indeterminable.  It depends on  the problem  characteristics, the population size, encoding methods and other factors. In fact,  the  mutation  rate  used  in  genetic  algorithms  as observed in nature is very small [44]. Implementing  an  arithmetic  mating  as  well  as  a  uniform mutation to our genetic algorithm, the mating and mutation rate was chosen to be 0.8 (80%) and 0.1 (10%) respectively. Moreover, we use the tournament selection as our selection method  since  its  results  are  more  efficient  compared  to other  selection  methods,  especially  in  the  cardinality constraint model.   For  the particle  swarm optimization algorithm, we must as well  make  a  decision  about  the  values  of  the  personal learning coefficient   and the swarm learning coefficient   which are applied in the constriction coefficients of the PSO model.  We  choose  the  constriction  factors  based  on  the work of [45] which suggests  1.49445 .  All  algorithms  are  implemented  in  MATLAB®  version  9.1 (R2016b). The system runs under MS Windows 7 64‐bit, and in  our  experiments, we  used  an  Intel®  Core  i7‐3517U with 1.90 GHz and 2.40 GHz processor and 4.00 GB RAM. 

5. Experimental Results 5.1. The influence of the population size and the number of iterations  The  analyses  and  selection  procedures  to  choose  an adequate set of parameters  for  the PSO and GA algorithms for our asset allocation problem is presented in Table 2.   Thus,  based  on  these  preliminary  analysis  and  other recommendations  from  literature,  we  have  decided  to 

Page 10: Working Paper 3/2018 M 2018 - unimi.itwp.demm.unimi.it/files/wp/2018/DEMM-2018_03wp.pdf3 Given these assumptions, we describe the mean‐variance model considering a market of J different

9  

continue our  study with a population  size equal  to 50  (50) and a number of iteration (It=200) for both PSO and GA.  It is important to note that the value of the prospect theory objective  function  is  almost  the  same  for  selected algorithms.  It  supports  our  choice  of  implementing  the heuristic approach to solve the prospect theory model.  5.2. Comparison of the performance of the algorithms  5.2.1.  Consistency,  solution  quality  and  Speed  of convergence In  the  first experimental  run, we check  the solution quality and  consistency  as well  as  the  convergence  speed  of  our algorithms  for  solving  the behavioral portfolio optimization problem. Here, we use a prospect theory model for a market containing 20 assets. Each PSO and GA algorithm is executed 5  times with  50  particles/chromosomes  for  a maximum  of 200  iterations.  Table  3  presents  the  results  of  this experiment considering ε as a criterion for the quality of the solution;  the  PSO  algorithm  had  a  higher  quality  solution (less  amount  of  error)  than  its  GA  counterpart.  The  PSO optimal solutions also are more consistent due to the lower 

value of  σ,  indicating  the  lower volatility of  the algorithm’s best  solutions.  However,  the  difference  between  their consistency is very small. For testing the speed of convergence, an average CPU time, where  the  number  of  fitness  evaluations  (NFE)  and  the minimum number of iterations needed for each algorithm to converge within 0.1% of the best solution of each algorithm are examined. These  results  show  that  the  particle  swarm  optimization algorithm needed less iterations and hence CPU time to find an acceptable  solution within 0.1% of  the optimal  solution ever  found  by  an  algorithm.  Also,  the  average  number  of fitness evaluations to solve the prospect theory optimization problem is much lower for PSO than for GA.  To make the result of the consistency test more visible, we illustrate the optimal solutions of the PSO and GA algorithms for  12  different  runs  in  Figure  2,  left  side.  As  the  figure shows,  the  results  of  the  genetic  algorithm  have  more fluctuation and thus  less consistency  in the best solution of all runs. 

Table 2. The influence of the population size and number of iterations on the performance of the PSO and GA 

  Particle Swarm Optimization  Genetic Algorithms 

Na  Parameter  Parameter Value  NFE  CPU Time  PT(x)  ε  σ  NFE  CPU Time  PT(x)  ε  σ 

20 

40  8040  571.57  0.020 0.003 0.002 10440 798.30 0.02036  0.0038 0.00232

50  1005 730.34  0.021 0.001 0.001 13050 994.12 0.02084  0.0022 0.00129

60  1206 906.06  0.021 0.002 0.002 15660 1195.62  0.02056  0.0040 0.00224

It 

150  7550  559.40  0.019 0.002 0.001 9800 759.85 0.01956  0.0027 0.00141

200  1005 730.34  0.021 0.001 0.001 13050 994.12 0.02084  0.0022 0.00129

250  1255 925.01  0.021 0.001 0.001 16300 1247.98  0.02116  0.0017 0.00113

 Table 3. Comparing the consistency, solution quality and speed of convergence of PSO and GA Na  Algorithm  PT(x)  ε  σ  Nit  NFE  CPU Time 

20 PSO  0.0216 0.0017 0.0012 344.6 17280 1278.33 

GA  0.0208 0.0022 0.00129 354.4 23086 1633.12 

 Figure2. Comparing the volatility of results and Trend of Convergence for GA and PSO 

The process of finding the optimal solution during iterations undertaken by both algorithms is also illustrated in Figure 2, right side.  It shows  that  the convergence of particle swarm optimization  occurs  faster  and  in  a  lower  number  of iterations compared  to  the genetic algorithm. PSO has also found a better solution in a reasonable number of iterations. One can see that the PSO fitness curve changes step by step, while  GA  presents  a  smoother  and  more  continuous progression.  

5.4.  Comparison  of  the  portfolio  optimization  models’ performance  During  the  experiment,  we  noticed  that  the  value  of  the genetic  algorithm’s  best  solution  is  somewhat  lower  than the  best  solution  achieved  by  the  particle  swarm optimization  algorithm.  At  the  same  time,  the  CPU  time needed  for  the  convergence  of  PSO  to  an  acceptable optimum  is much  less  than  GA,  thus  reducing  the  overall time required for further tests. Therefore, we have decided 

Page 11: Working Paper 3/2018 M 2018 - unimi.itwp.demm.unimi.it/files/wp/2018/DEMM-2018_03wp.pdf3 Given these assumptions, we describe the mean‐variance model considering a market of J different

10  

to implement the PSO algorithm for our prospect theory and mean‐variance portfolio optimization models.  5.4.1. Portfolio optimization models 5.4.1.1.  In‐sample data In this section, the performance of the prospect theory and the mean‐variance models  using  3  random  subsets  of  in‐sample data  (with 10, 15 and 20 assets) are evaluated. The summary of this evaluation is displayed in Table 4. This table contains the portfolio mean return  , the portfolio standard deviation    as  the  proxy  of  the  risk,  the mean  return  to standard  deviation  ratio  ,  the  number  of  assets  in  the optimal portfolio as well as the CPU time for each model.   Clearly,  the  CPU  time  needed  for  the  convergence  to  an optimal  solution  is  significantly  high  in  the  case  of  the prospect  theory  model  compared  to  the  mean‐variance model with the same number of assets in the market which was predictable considering the mathematical complexity of behavior‐based  models.  The  CPU  time  also  increases  in 

markets with more  assets  for both  the mean‐variance  and the prospect theory based models.  Since the prospect theory model finds portfolios with better returns and accordingly higher risks, it is difficult to compare the average return and risk of the optimal portfolio selected by our studied models. So [39] suggests using the    ratio as a unified measure  of  performance which  contains  the mean return as well as the risk of the selected portfolio. A model with a higher    ratio is more efficient.  

However,  in our case,  it  is hard  to compare  the      ratio  for the prospect  theory and mean‐variance portfolio using  the in‐sample data.  For  instance,  for  a market with  10  and  20 assets, PT model outperforms the MV model which is against the  result  achieved  in market with  15  assets. Despite  this, the  return  of  portfolio  is  often  extremely  higher  for  the prospect theory model than the mean‐variance model. This can be  caused by  the existence of a  reference point which encourages  the model  to always  choose assets with higher returns and less focus on the related risk of the portfolio.  

Table 4. Comparison of PT and MV basic models (in‐sample data) 

  Model  CPU Time        

10 MV  16.93 9 0.2172 0.0043 0.0198

PT  368.70  10  0.2245  0.0047  0.0209 

15 

MV  17.03  10  0.3006  0.0052  0.0173 

PT  701.18  15  0.2472  0.0052  0.0211 

20 MV  21.37  13  0.2000  0.0034  0.0170 

PT  701.79  20  0.2024  0.0043  0.0212 

It can also be seen  that  the number of assets  in  the mean‐variance model portfolio is always lower than the entirety of available  assets  in  the  market,  but  the  prospect  theory model  has  a  greater  tendency  to  use  all  existing  assets  to construct its optimal portfolio. In fact, the portfolio selected by our prospect  theory model  is more diversified  than  the mean‐variance portfolio. 5.4.1.2. Out‐of‐sample data In  this  section, we  conduct  a  performance  analysis  on  the MV  and PT models using  the out‐of‐sample data.  First, we consider  the  historical  data  for  the  remaining  170  data points as our out‐of‐sample data which we use  to  test  the efficiency  of  the  models’  portfolio.  Then,  we  use  this historical  data  sample  to  calculate  the mean  return  ,  the risk   and the return to risk ratio   of the portfolio selected by the MV and PT models in the previous section. For further study,  we  extend  our  out‐of‐sample  tests  to  analyze  the models’  performance  for  a  simulated  bullish  and  bearish market, respectively. As one can see in Table 5 for historical data, despite the higher amount of portfolio risk, the   ratio is  always  better  for  a  behavior‐based  portfolio  than MV’s. Moreover,  as  in  the  case  of  in‐sample  data,  the  prospect theory portfolio gains a far greater average return   whereas MV’s portfolio carries less portfolio risk. 

In  Figure  3  the  cumulative  returns  for  the  MV  and  PT models’  portfolios  during  in‐sample  and  out‐of‐sample periods are demonstrated. Evidently, the ascending slopes of the curves for the in‐sample test is followed by the historical out‐of‐sample  test  in  both  the  MV  and  PT  portfolios. However, as we have anticipated from the results in Table 5, the PT curve is always above the MV curve for out‐of‐sample data, indicating the higher average return of behavior‐based portfolios. 

 Figure 3. Comparison of basic PT and MV models using in‐sample 

data vs historical out‐of‐sample data (the results of a market with 20 assets)

  

Page 12: Working Paper 3/2018 M 2018 - unimi.itwp.demm.unimi.it/files/wp/2018/DEMM-2018_03wp.pdf3 Given these assumptions, we describe the mean‐variance model considering a market of J different

11  

 

Table 5. Comparison of PT and MV models (out‐of‐sample test) 

  historical data  simulated bullish market  simulated bearish market 

  Model       

     

     

10 MV  0.0833  0.0020  0.0240  0.1587  0.0013  0.0083  ‐0.1141  ‐0.0861  0.7548 

PT  0.1312  0.0030  0.0230  0.1395  0.0012  0.0086  ‐0.1305  ‐0.0909  0.6969 

15 MV  0.0784  0.0016  0.0204  0.1724  0.0015  0.0087  ‐0.1516  ‐0.1365  0.9005 

PT  0.1199  0.0027  0.0225  0.1719  0.0015  0.0088  ‐0.1161  ‐0.0845  0.7280 

20 MV  0.0777  0.0016  0.0206  0.1609  0.0014  0.0087  ‐0.0409  ‐0.0401  0.9815 

PT  0.1486  0.0034  0.0230  0.1893  0.0017  0.0090  ‐0.0392  ‐0.0302  0.7713 

 

 

Figure 4. Comparison of PT and MV models using out‐of‐sample data (simulating a bullish market and a bearish market) 

For  simulated  bullish  market,  our  behavior‐based  model does not perform well  in markets with  a  lower number of assets both  in  terms of portfolio mean  return and  risk. But for a market of 20 assets, the PT model’s portfolio shows a higher  average  return  and      ratio  than MV’s portfolio. At the same time, the MV model is more beneficial considering the  risk parameter    for all  three markets. The  cumulative returns  for  the  prospect  theory  and mean‐variance model portfolios for a bullish market are also shown in Figure 4, left side.  It  seems  that  both  the  PT  and MV  curves  show  the same trend during this simulated bullish market.  Finally,  we  checked  the  performance  of  the  basic  mean‐variance and prospect theory models’ optimal portfolios for a market with  declining  securities  prices,  also  known  as  a bearish market.  As can be seen, for simulated bearish market, the risk of the prospect theory’s optimal portfolio is surprisingly lower than the MV’s  portfolio  for  all  three markets,  even  though  its returns  are  low  in markets with  10  assets. Moreover,  this portfolio  shows  a  better  performance  for  both  15  and  20 assets markets  in  terms  of  the      ratio.  It  seems  that  the behavior‐based  portfolio  provides  a  lower  risk  in  critical market situations  in comparison with  the  traditional mean‐variance approach.  It  is a  surprising  result  since, unlike  the mean‐variance model, we  didn’t  set  any  boundary  for  our level of portfolio risk in the prospect theory model.  In  Figure  4  right  side,  we  also  illustrate  the  cumulative returns of our basic models’ portfolio for a simulated bearish market. It is obvious that both the PT and MV curves have a 

decreasing  trend  with  similar  fluctuations  while  the cumulative returns of both portfolios fall to a negative point.  6.Conclusion In this study, two metaheuristic approaches, namely Particle Swarm Optimization (PSO) and Genetic Algorithm (GA), were applied  to  find  an  optimal  solution  for  a  prospect  theory portfolio  optimization model.  In  addition,  a mean‐variance portfolio  optimization model was  used  as  a  benchmark  to compare the performance of our behavior‐based model. The objective  function  to be maximized was  the utility  function of each model calculated by using  in‐sample historical data. To effectively use  the available data, several subsets of  the main dataset were randomly chosen.  As  a  part  of  our  study,  the  performance  of  these  two metaheuristic algorithms in finding an optimal solution for a prospect  theory  model  was  compared  as  well.  This comparison was based on the consistency and quality of the solution  as  well  as  the  speed  of  convergence  for  each algorithm.  The results showed that both heuristic algorithms could find an  optimal  solution  in  an  acceptable  amount  of  time. However,  for  the prospect  theory model, PSO outperforms GA both  in  terms of consistency and speed of convergence to an optimal  solution. We also performed  several  tests  to specify  the  adequate  population  size  and  number  of iterations  for  each  heuristic  algorithm  to  converge  to  the optimal  solution of our models  in  a  reasonable  amount of time and with equally reasonable consistency.  

Page 13: Working Paper 3/2018 M 2018 - unimi.itwp.demm.unimi.it/files/wp/2018/DEMM-2018_03wp.pdf3 Given these assumptions, we describe the mean‐variance model considering a market of J different

12  

Further, we used the particle swarm optimization to analyze the performance of both prospect theory and mean‐variance models. Then, we  tested  the optimal portfolios selected by the  prospect  theory  and  mean‐variance  models,  using  a historical out‐of‐sample data  set  as well  as  simulated data obtained from hypothetical bearish and bullish markets.  This  comparison  seems  to  point  in  favor  of  the  solutions obtained  with  the  prospect  theory  model,  especially  for datasets  with  a  greater  number  of  assets.  The  optimal portfolio  of  this  behavioral model  is  also more  diversified than  the optimal portfolio of our classical model. However, the portfolio of the mean‐variance model usually has a lower level  of  risk  in  both  the  basic  and  the  constrained  asset allocation problems. As  we  mentioned  earlier,  the  return  from  the  prospect theory model’s optimal portfolio  is higher  than  that of our mean‐variance model. That is probably due to the existence of  a  reference  point  which  induces  the  model  to  find  a portfolio  with  a  higher  return  without  considering  the increasing degree of risk.  However,  in  a  simulated  bearish  and  bullish  market,  the performance of our prospect  theory model  is  rather worse than that of the mean‐variance model.   Finally,  it  is  also  important  to  know  that  these  heuristic algorithms  are  not  guaranteed  to  always  find  the  best solution  for an optimization problem. Yet,  they can  find an acceptable solution to a problem.   References 1. Markowitz, H., 1952. Portfolio selection. The journal of finance, 7(1), pp. 77‐91. 2. Elton, E.J. and Gruber, M.J., 1997. Modern portfolio theory, 1950 to date. Journal of 

Banking & Finance, 21(11), pp. 1743‐1759. 3. Curtis, G., 2004. Modern portfolio theory and behavioral finance. The Journal of 

Wealth Management, 7(2), pp. 16‐22. 4. Prigent, J., 2007. Portfolio optimization and performance analysis. s.l.:CRC Press. 5. Kahneman, D. and Tversky, A., 1979. Prospect theory: An analysis of decision under 

risk. Econometrica: Journal of the econometric society, pp. 263‐291. 6. Levy, H. a. L. M., 2003. Prospect theory and mean‐variance analysis. Review of 

Financial Studies, 17(4), pp. 1015‐1041. 7. Hens, T. and Bachmann, K., 2011. Behavioural finance for private banking. 534 ed. 

s.l.:John Wiley & Sons. 8. Shefrin, H. and Statman, M, 2000. Behavioral Portfolio Theory. Journal of Financial 

and Quantitative Analysis, 35(02), pp. 127‐151. 9. Lopes, L., 1987. Between hope and fear: The psychology of risk. Advances in 

experimental social psychology, Volume 20, pp. 255‐295. 10. Grishina, N., Lucas, C.A. and Date, P., 2017. Prospect theory–based portfolio 

optimization: an empirical study and analysis using intelligent algorithms. Quantitative Finance, 17(3), pp. 353‐367. 

11. Chang, T.J., Meade, N., Beasley, J.E. and Sharaiha, Y.M., 2000. Heuristics for cardinality constrained portfolio optimisation. Computers & Operations Research, 27(13), pp. 1271‐1302. 

12. Liu, J., Jin, X., Wang, T. and Yuan, Y.,, 2015. Robust multi‐period portfolio model based on prospect theory and ALMV‐PSO algorithm. Expert Systems with Applications, 20(42), pp. 7252‐7262. 

13. Maaranen, H., Miettinen, K. and Penttinen, A., 2007. On initial populations of a genetic algorithm for continuous optimization problems. Journal of Global Optimization, 37(3), pp. 405‐436. 

14. Bai, Q., 2010. Analysis of particle swarm optimization algorithm. Computer and information science, 3(1), p. 180. 

15. Francis, J.C. and Kim, D, 2013. Modern Portfolio Theory: foundations, analysis, and new developments. 795 ed. s.l.:John Wiley & Sons. 

16. Maringer, D., 2006. Portfolio management with heuristic optimization. 8 ed. s.l.:Springer Science & Business Media. 

17. Reilly, F.K. and Brown, K.C, 2011. Investment analysis and portfolio management. s.l.:Cengage Learning.. 

18. Cornuejols, G. and Tütüncü, R., 2006. Optimization methods in finance. 5 ed. s.l.:Cambridge University Press. 

19. Tversky, A. and Kahneman, D., 1992. Advances in prospect theory: Cumulative representation of uncertainty. Journal of Risk and uncertainty, 5(4), pp. 297‐323. 

20. Hens, T. and Rieger, M.O., 2010. Financial Economics: A Concise Introduction to Classical and Behavioral Finance. s.l.:Springer‐Verlag Berlin Heidelberg. 

21. De Giorgi, E., Hens, T. and Mayer, J., 2007. Computational aspects of prospect theory with asset pricing applications. Computational Economics, 29(3), pp. 267‐281. 

22. Sivanandam, S.N. and Deepa, S.N., 2007. Introduction to genetic algorithms. s.l.:Springer Science & Business Media. 

23. Ao, S., 2010. Applied time series analysis and innovative computing. 59 ed. s.l.:Springer Science & Business Media. 

24. Haupt, R.L. and Haupt, S.E., 2004. Practical genetic algorithms. s.l.:John Wiley & Sons. 

25. Herrera, F., Lozano, M. and Verdegay, J.L., 1998. Tackling real‐coded genetic algorithms: Operators and tools for behavioral analysis. Artificial intelligence review, 12(4), pp. 265‐319. 

26. Blickle, T. and Thiele, L., 1995. A comparison of selection schemes used in genetic algorithms, s.l.: s.n. 

27. McPhee, N.F., Poli, R. and Langdon, W.B., 2008. A field guide to genetic programming. s.l.:Lulu. com. 

28. Deb, K., 2005. Multi‐objective optimization using evolutionary algorithms. s.l.:John Wiley & Sons. 

29. Abdoun, O. and Abouchabaka, J., 2012. A comparative study of adaptive crossover operators for genetic algorithms to resolve the traveling salesman problem. arXiv preprint arXiv, p. 1203.3097. 

30. Simon, D., 2013. Evolutionary optimization algorithms. s.l.:John Wiley & Sons. 31. Eberhart, R. and Kennedy, J., 1995. A new optimizer using particle swarm theory. 

Proceedings of the sixth international symposium on micro machine and human science, IEEE, pp. 39‐43. 

32. Parsopoulos, K. e., 2010. Particle swarm optimization and intelligence: advances and applications. s.l.:IGI Global. 

33. Clerc, M. and Kennedy, J., 2002. The particle swarm‐explosion, stability, and convergence in a multidimensional complex space. IEEE transactions on Evolutionary Computation, 6(1), pp. 58‐73. 

34. Poli, R., Kennedy, J. and Blackwell, T., 2007. Particle swarm optimization. Swarm intelligence, 1(1), pp. 33‐57. 

35. Schmitt, B., 2015. Convergence Analysis for Particle Swarm Optimization. s.l.:FAU University Press. 

36. BusinessDictionary.com, 2017. WebFinance, Inc. [Online] available at: http://www.businessdictionary.com/definition/bear‐market [Accessed 12 June 2017]. 

37. Hu, W. and Kercheval, A.N.,, 2010. Portfolio optimization for student t and skewed t returns. Quantitative Finance, 10(1), pp. 91‐105. 

38. Silberholz, J. and Golden, B., 2010. Comparison of metaheuristics. In: Handbook of metaheuristics. 2 ed. s.l.:Springer US,, pp. 625‐640. 

39. Grishina, N., 2014. A Behavioral Approach to Financial Portfolio Selection Problem: an Empirical Study Using Heuristics, s.l.: Brunel University. 

40. Haupt, R., 2000. Optimum population size and mutation rate for a simple real genetic algorithm that optimizes array factors. In Antennas and Propagation Society International Symposium. IEEE , Volume 2, pp. 1034‐1037. 

41. Srinivas, M. and Patnaik, L.M., 1994. Adaptive probabilities of crossover and mutation in genetic algorithms. IEEE Transactions on Systems, Man, and Cybernetics, 24(2), pp. 656‐667. 

42. Shi, Y. and Eberhart, R., 1998. Parameter selection in particle swarm optimization. In Evolutionary programming. Springer Berlin/Heidelberg, Volume VII, pp. 591‐600. 

43. Trelea, I., 2003. The particle swarm optimization algorithm: convergence analysis and parameter selection. Information processing letters, 85(6), pp. 317‐325. 

44. Back, T., 1996. Evolutionary algorithms in theory and practice: evolution strategies, evolutionary programming, genetic algorithms. s.l.:Oxford university press. 

45. Eberhart, R.C. and Shi, Y., 2000. Comparing inertia weights and constriction factors in particle swarm optimization. In Evolutionary Computation. Proceedings of the 2000 Congress on IEEE, Volume 1, pp. 84‐88.