Research on Portfolio Optimization Based on particle swarm optimization

Tecdat 2021-02-22 13:11:29
research portfolio optimization based particle


Link to the original text :http://tecdat.cn/?p=6811

My research topic this year is to use particle swarm optimization (PSO) To optimize the transaction portfolio of the currency . In this paper , I'll introduce portfolio optimization and explain its importance . secondly , I'll show you how particle swarm optimization can be applied to portfolio optimization . Third , I'll explain the arbitrage portfolio , And then summarize my findings .

Combinatorial optimization

A portfolio consists of assets and investment capital . Portfolio optimization involves determining how much money should be invested in each asset . With such diverse demands , Minimum and maximum asset exposure , The introduction of restrictive factors such as transaction cost and foreign exchange cost , I use particle swarm optimization (PSO) Algorithm .

The working principle of portfolio optimization is to predict the expected risk and return of each asset in the portfolio . The algorithm takes these predictions as input , And determine how much capital should be invested in each asset , In order to maximize the risk adjusted return of the portfolio and meet the constraints . The forecast of the expected risk and return of each asset needs to be as accurate as possible , To make the algorithm perform well . There are various ways , In this study , I studied three common methods .

  1. Normal distributed revenue - In this method , Create a distribution of historical asset values and randomly sample to get the future value of each asset . The method assumes that historical and future values are normally distributed .
  2. Revenue follows Brownian motion - In this way , Generate random walks for each asset over time , Represents daily revenue . The total return of the portfolio is calculated . This method assumes that future returns follow a random walk .
  3. The yield follows the geometric Brownian motion - In this way , Generate random walk again , But standardizing based on daily variance and long-term market drift . The method assumes that future earnings follow a standardized random walk .

In my research , I found the third method to be the most accurate


Particle swarm optimization (PSO)

stay PSO in , Each particle in a group is represented as a vector . In the context of portfolio optimization , This is a weight vector , Represents the allocated capital of each asset . The vector is transformed into a position in the multidimensional search space . Each particle will also remember its best historical position . about PSO Every iteration of , Find the global optimal location . This is the best position in the group . Once the global optimal location is found , Each particle will be closer to its local optimal position and global optimal position . When executed in multiple iterations , The process produces a good solution to the problem , Because the particles converge on the near optimal solution .

 # This class contains the particle code in the swarm
class Particle:
velocity = []
pos = []
pBest = []
def __init__(self):
for i in range(dimension):
self.pos.append(random.random())
self.velocity.append(0.01 * random.random())
self.pBest.append(self.pos[i])
return 

The graph depicts the particle swarm optimization algorithm relative to the global optimum ( Blue ) And local optimal location ( Red ) How to update the position of each particle in the population .

# This class includes particle swarm optimization algorithm and particle parameter optimizer
class ParticleSwarmOptimizer:
solution = []
swarm = []
def __init__(self):
for h in range(swarmSize):
particle = Particle()
self.swarm.append(particle)

PSO Performance is influenced by weight . Exploration describes PSO Explore the ability to search different areas of space .Exploitation It describes PSO The ability to focus search on promising areas of the search space . To enhance PSO The ability to explore and develop , The following algorithm enhancements are applied :

  • Random reinitialization of aggregate particles - Improve exploration by restarting particles when they gather on globally optimal particles . Using two particles ( carrier ) The similarity function between measurements converges .

If the particles converge near the globally optimal particles , But it's not as good as the global optimal particle , Then it is reinitialized randomly somewhere in the search space . This improves PSO The ability to explore .

  • Selective mutation of the optimal particle - By initializing the neighbor of the nearest global optimal particle to improve . If neighbors are better than global optimal particles , Then the globally optimal particles are replaced by neighbors .

For each iteration of the algorithm , Creating neighbors near globally optimal particles . If any of these neighbors is better than the global optimal particle , Then replace the globally optimal particle .


Portfolio optimization using particle swarm optimization

PSO The algorithm can be used to optimize the portfolio . In the context of portfolio optimization , Each particle in the group represents the potential allocation of capital among the assets in the portfolio . The relative suitability of these portfolios can be determined using one of many financial utility functions that balance risk and expected return . I use the sharp ratio , Because it has become a benchmark portfolio performance standard recognized by the industry . Consider the following for a portfolio of three assets PSO Icon ,

Using particle swarm optimization (PSO) An example of portfolio optimization of . Grey particles are updating . The red particle is the local optimal position of the gray particle , The blue particle is the global best position .

Gray particles are transformed into vectors (0.5,0.2,0.3), It means the cost of portfolio capital 50% Allocated to assets 1,20% Allocated to assets 2,30% Allocated to assets 3. The expected Sharpe ratio for this allocation is 0.38, Less than the local optimal position ( Red particles ) And global optimal location ( Blue particles ). such , The position of the gray particles is updated , Make it closer to the global optimal particle and the local optimal particle .

​  

Using particle swarm optimization (PSO) An example of portfolio optimization of . The gray particles are updated , Make it closer to the global optimum , And it's locally optimal . The resulting vector is better than before .

The gray particles have moved , Now convert to vector (0.3,0.3,0.4), Its expected Sharpe ratio is 0.48. This value is higher than the previous local optimal position , So the local optimal position ( Red particles ) Will be updated to the current location .

Using particle swarm optimization (PSO) An example of portfolio optimization of . Local optimal location ( Red particles ) Now updated to the current position of the particle .

The real challenge with particle swarm optimization is to ensure that the constraints of portfolio optimization are met . As mentioned earlier , There are many limitations . The most common constraints are, first of all, that assets are no longer allocated and no less than 100% Available capital ( That is, the weight vector must add up to 1.0). secondly , Negative distribution of assets is not allowed . Last , Capital should be allocated to at least so many assets in the portfolio . The latter is the cardinality constraint . Two common techniques are used to ensure that particles satisfy constraints ,

  1. Fix particles that don't satisfy the constraint - For each particle that doesn't satisfy the constraint , Apply a set of rules to change the position of particles .
  2. The adaptability of penalizing particles that don't satisfy the constraint - For each particle that doesn't satisfy the constraint , The Sharpe ratio that penalizes the particle .

Arbitrage portfolio

For my research , I apply this technique to Arbitrage Portfolios . The arbitrage portfolio includes multiple arbitrage transactions . Arbitrage is a trading strategy , Among them, traders sell currencies with relatively low interest rates , And use that money to buy different currencies , That leads to higher interest rates . Traders using this strategy try to find the difference between interest rates called interest rate difference .


By diversifying investments in multiple currencies , Can reduce the risk of foreign exchange losses , But it can't be eliminated . therefore , The risk of arbitrage is lower than that of individual arbitrage . In the context of Arbitrage Portfolios , The objective of portfolio optimization is to further reduce the risk of foreign exchange losses , At the same time, improve the investment return realized by the portfolio .

The goal of portfolio optimization is to determine how much money should be allocated to each transaction to optimize risk adjusted returns .

In my research , I use particle swarm optimization to determine the optimal allocation of investment capital between a set of arbitrage transactions . The arbitrage portfolio in my research includes 22 Two different currencies . Currencies include the Australian dollar , Canadian dollars , Swiss francs , RMB, etc .

Thank you very much for reading this article , If you have any questions, please leave a message below !


The most popular insights

1. Using machine learning to identify changing stock market conditions — The hidden Markov model (HMM) Application

2.R Language GARCH-DCC Models and DCC(MVT) Modeling estimation

3.R Language implementation Copula Algorithm modeling dependency case analysis report

4.R Language COPULAS And financial time series data VaR analysis

5.R Language diversity COPULA GARCH Model time series prediction

6. use R Language implementation of neural network to predict the stock example

7.r The realization of language prediction volatility :ARCH Model and HAR-RV Model

8.R How language makes Markov transformation model markov switching model

9.matlab Use Copula Simulation optimizes market risk

版权声明
本文为[Tecdat]所创,转载请带上原文链接,感谢
https://pythonmana.com/2021/02/20210221135309615h.html

  1. Python中的解决中文字符编码的问题
  2. Solving the problem of Chinese character coding in Python
  3. Translation: practical Python Programming 02_ 01_ Datatypes
  4. Installation and use of Python and tensorflow in win10 environment (Python version 3.6, tensorflow version 1.6)
  5. Python series 46
  6. Linux安装Python3
  7. 【python接口自动化】- 正则用例参数化
  8. Python RestFul Api 设计
  9. filecmp --- 文件及目录的比较│Python标准库
  10. Installing python3 on Linux
  11. [Python] Matplotlib 圖表的繪製和美化技巧
  12. (資料科學學習手札108)Python+Dash快速web應用開發——靜態部件篇(上)
  13. 翻譯:《實用的Python程式設計》02_01_Datatypes
  14. 【python接口自动化】- 正则用例参数化
  15. 翻译:《实用的Python编程》02_02_Containers
  16. 两年Java,去字节跳动写Python和Go
  17. [Python interface automation] - regular use case parameterization
  18. Python restful API design
  19. 翻译:《实用的Python编程》02_02_Containers
  20. 两年Java,去字节跳动写Python和Go
  21. 翻译:《实用的Python编程》02_02_Containers
  22. Python基于粒子群优化的投资组合优化研究
  23. ubuntu部署django项目
  24. 兩年Java,去位元組跳動寫Python和Go
  25. 翻譯:《實用的Python程式設計》02_02_Containers
  26. 这样学习Python,爷爷都学会了!超简单Python入门
  27. [Python] 基于 jieba 的中文分词总结
  28. 【python】递归听了N次也没印象,读完这篇你就懂了
  29. [Python] 基于 jieba 的中文分词总结
  30. 人理解迭代,神则体会递归,从电影艺术到Python代码实现神的逆向思维模式
  31. [Python] 基於 jieba 的中文分詞總結
  32. Python属于后端开发还是前端开发?Python入门!
  33. 【python】递归听了N次也没印象,读完这篇你就懂了
  34. 一天快速入门python
  35. 学习Python对年龄有没有要求?30岁可以吗?
  36. 清华教授!12小时整理的最全Python教程(文末无偿分享)
  37. 使用Python开发DeFi项目
  38. python 函数详解
  39. Python工程师是做什么的?前景如何?
  40. Filecmp -- comparison of files and directories
  41. Python - zip() 函数
  42. 30 周年生日,Python 先驱是怎么评价这门语言的?
  43. Drawing and beautifying skills of [Python] Matplotlib chart
  44. Python + dash rapid web application development static components
  45. Translation: practical Python Programming 02_ 01_ Datatypes
  46. python将excel自适应导入数据库
  47. 从小白到大师,这里有一份Pandas入门指南
  48. [Python] 茎叶图和复合饼图的画法
  49. [Python interface automation] - regular use case parameterization
  50. Translation: practical Python Programming 02_ 02_ Containers
  51. Two years of Java, to write Python and go
  52. Translation: practical Python Programming 02_ 02_ Containers
  53. Two years of Java, to write Python and go
  54. Python-geoplot 空间核密度估计图绘制
  55. Python-seaborn 经济学人经典图表仿制
  56. python空间绘图- regionmask掩膜操作示例
  57. Python 空间绘图 - Cartopy 经纬度添加
  58. Python-pykrige包-克里金(Kriging)插值计算及可视化绘制
  59. Python 批量重采样、掩膜、坡度提取
  60. python - 多种交通方式可达圈分析