Skip to main content
. 2022 Aug 29;7(3):124. doi: 10.3390/biomimetics7030124
Algorithm 2 DBAS Algorithm.
  • Objective Function:

  • F(X,O)

  • DBAS Initialization:

  • η=0.99

  • d=0.9

  • d1=0.9

  • d2=0.9

  • τ=0.9

  • Portfolio Initialization:

  • T=iter        %Iterations

  • D=pop        %Total Portfolios

  • K=dim        %No. of Stocks In Each Portfolio

  • X=randn(D,K)

  • Xbest=X

  • O=[O1,O2,O3,,OK]

  • % OK Includes Parameters For k-th Portfolio

  • % OK=[MK,CK]MK: Mean CK: Covariance

  • Pmin=F(X,P)

  • [Gbest,ind]=min(F(X,P)

  • Sbest=Xind

  • Fori=1:T

  •        b=randn(D,K)

  •        b1=randn(1,1)

  •        b2=randn(1,1)

  •        b3=randn(1,1)

  •        Compute V using (36)

  •        Compute Xr and Xl using (37) and (38)

  •        Compute Fr and Fl suing (39) and (40)

  •        Compute X using (42)

  •        Forj=1:D

  •               F=Fj(Xj,Oj)

  •               IfF<Pminj:

  •                      Pminj=F

  •                      Pbestj=Xj

  •               End If

  •               

  •        End For

  •        

  •        [F,ind]=min(F(X,O))

  •        

  •        IfF<Gbest:

  •               Gbest=F

  •               sbest=Xind

  •               Sbest=repmat(sbest,D,1)

  •        End If

  •        r= rand

  •        Ifr<0.5:

  •               d=ηd+0.01

  •               d1=ηd1+0.01

  •               d2=ηd2+0.01

  •               τ=ητ

  •        End If

  •               

  • End For