WO2020000718A1 - Investment portfolio generation method and apparatus, and computer-readable storage medium - Google Patents

Investment portfolio generation method and apparatus, and computer-readable storage medium Download PDF

Info

Publication number
WO2020000718A1
WO2020000718A1 PCT/CN2018/107502 CN2018107502W WO2020000718A1 WO 2020000718 A1 WO2020000718 A1 WO 2020000718A1 CN 2018107502 W CN2018107502 W CN 2018107502W WO 2020000718 A1 WO2020000718 A1 WO 2020000718A1
Authority
WO
WIPO (PCT)
Prior art keywords
matrix
sample
transaction data
target market
market index
Prior art date
Application number
PCT/CN2018/107502
Other languages
French (fr)
Chinese (zh)
Inventor
李海疆
Original Assignee
平安科技(深圳)有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 平安科技(深圳)有限公司 filed Critical 平安科技(深圳)有限公司
Publication of WO2020000718A1 publication Critical patent/WO2020000718A1/en

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q10/00Administration; Management
    • G06Q10/06Resources, workflows, human or project management; Enterprise or organisation planning; Enterprise or organisation modelling
    • G06Q10/063Operations research, analysis or management
    • G06Q10/0635Risk analysis of enterprise or organisation activities
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F17/00Digital computing or data processing equipment or methods, specially adapted for specific functions
    • G06F17/10Complex mathematical operations
    • G06F17/16Matrix or vector computation, e.g. matrix-matrix or matrix-vector multiplication, matrix factorization
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q40/00Finance; Insurance; Tax strategies; Processing of corporate or income taxes
    • G06Q40/04Trading; Exchange, e.g. stocks, commodities, derivatives or currency exchange

Definitions

  • the present application relates to the field of information processing technology, and in particular, to a method, a device, and a computer-readable storage medium for generating a portfolio.
  • This application provides a method, device, and computer-readable storage medium for generating a portfolio, the main purpose of which is to implement denoising processing on the sample covariance matrix and reduce the risk of the portfolio.
  • this application also provides a method for generating a portfolio, which method includes:
  • the present application further provides an investment portfolio generation device, which includes a memory and a processor, where the memory stores an investment portfolio generation program that can be run on the processor, and the investment portfolio When the generated program is executed by the processor, the following steps are implemented:
  • the present application further provides a computer-readable storage medium, where the computer-readable storage medium stores a portfolio generation program, and the portfolio generation program can be executed by one or more processors. To achieve the following steps:
  • the investment portfolio generation method, device and computer-readable storage medium proposed in this application determine the target market index, and generate a sample matrix based on the transaction data of the constituent stocks of the target market index over multiple consecutive historical trading days; calculate the target based on the sample matrix
  • the first sample covariance matrix of the constituent stocks of the market index calculates the eigenvalues of the first sample covariance matrix and the eigenvectors corresponding to the eigenvalues; calculates the theoretical maximum eigenvalue of the first sample covariance matrix based on MP's law , Performing a denoising process on the eigenvalues of the first sample covariance matrix based on the eigenvalues and the theoretical maximum eigenvalues; calculating the second based on the eigenvalues diagonal matrix and the matrix composed of eigenvectors after denoising Sample covariance matrix; calculate the investment proportion of each constituent stock based on the second sample covariance matrix and the Markowitz mean variance model, and generate an investment portfolio based on the investment proportion.
  • This solution is based on MP's law to denoise the sample covariance matrix of the market index and filter out the random data, so that the data in the recalculated second sample covariance matrix is a relatively reliable correlation coefficient, which makes investment
  • the portfolio is optimized to reduce investment risks.
  • FIG. 1 is a schematic flowchart of an investment portfolio generation method according to an embodiment of the present application
  • FIG. 2 is a schematic diagram of an internal structure of an investment portfolio generating device according to an embodiment of the present application
  • FIG. 3 is a schematic diagram of a module of a portfolio generation program in a portfolio generation device provided by an embodiment of the present application.
  • This application provides a method for generating a portfolio.
  • a schematic flowchart of a method for generating a portfolio provided by an embodiment of the present application is shown. The method may be performed by a device, which may be implemented by software and / or hardware.
  • the method for generating a portfolio includes:
  • step S10 a target market index is determined, and a sample matrix is generated according to the transaction data of the constituent stocks of the target market index over multiple consecutive historical trading days.
  • Step S20 Calculate a first sample covariance matrix of the constituent stocks of the target market index according to the sample matrix.
  • the target market index in this application may be a market index such as the Shanghai Composite Index, Shanghai and Shenzhen 300.
  • the method of this application will be described using the Shanghai and Shenzhen 300 as an example.
  • step S10 includes the following detailed steps:
  • the target market index is determined, and transaction data of constituent stocks of the target market index within multiple consecutive historical trading days is obtained; the acquired transaction data is standardized; and the sample matrix is constructed according to the standardized processed transaction data.
  • the closing price data is used as financial time series data, it has the characteristics of peaks and fat tails.
  • the log closing data of the stock is first processed:
  • the logarithmic rate of return is standardized.
  • the standardized treatment method is as follows:
  • T is the total number of trading days
  • ⁇ i is the standard deviation of the logarithmic yield of stock i.
  • the number of component bonds in the target market index is N.
  • N 300
  • T 300
  • All the logarithmic return data after normalization process form a N ⁇ T matrix.
  • the logarithmic yield of a constituent stock can be regarded as a random variable, and the logarithmic yield of all constituent stocks in T trading days constitutes a sample logarithmic yield matrix.
  • the logarithmic return sequence matrix of all constituent stocks after normalization is as follows:
  • the first sample covariance matrix obtained is an N ⁇ N matrix.
  • Step S30 Calculate a feature value of the first sample covariance matrix and a feature vector corresponding to the feature value.
  • Step S40 Calculate the theoretical maximum eigenvalue of the first sample covariance matrix based on the M-P law, and perform denoising processing on the angular matrix of the eigenvalues of the first sample covariance matrix based on the theoretical maximum eigenvalue.
  • Step S50 Calculate a second sample covariance matrix according to the eigenvalue diagonal matrix and the matrix composed of the eigenvectors after the denoising process.
  • Step S60 Calculate the investment ratio of each constituent stock according to the second sample covariance matrix and the Markowitz mean variance model, and generate an investment portfolio according to the investment ratio.
  • Step S40 may include the following detailed steps: calculating a theoretical maximum eigenvalue of the first sample covariance matrix based on MP law; arranging the eigenvalues in ascending order to generate a diagonal matrix of eigenvalues; from The eigenvalues of the first sample covariance matrix that are greater than the theoretical maximum eigenvalue and whose previous eigenvalue is less than the theoretical maximum eigenvalue are found as the intercept point eigenvalues; the eigenvalue pairs are deleted Eigenvalues in the angular matrix that are smaller than the eigenvalues of the intercept points are used to denoise the angular matrix on the characteristic values.
  • the eigenvalues ⁇ (i) of the first sample covariance matrix are solved, and the eigenvalues are sorted in ascending order of the eigenvalues ⁇ (1) ⁇ (2) ⁇ ... ⁇ (N) .
  • the values form the eigenvalue diagonal matrix ⁇ :
  • u (i) is a feature vector corresponding to ⁇ (i)
  • the feature vector is a column vector
  • the intercept point eigenvalues are found. Specifically, the eigenvalues ⁇ (1) , ⁇ (2) , ... are arranged in ascending order. In ⁇ (N) , the k-th largest eigenvalue ⁇ (k) is found so that it meets the following conditions:
  • ⁇ (k-1) is the eigenvalue ranked one ahead of ⁇ (k) .
  • ⁇ (k) be the eigenvalue of the intercept point, and replace all eigenvalues whose eigenvalues in the eigenvalue diagonal matrix are smaller than the eigenvalue of the intercept point with 0.
  • the theoretical maximum eigenvalues are consistent with If the eigenvalues calculated based on actual data are greater than the theoretical maximum eigenvalues, it means that some elements in the matrix are not independent and identically distributed, but have a certain correlation.
  • the eigenvalues that conform to MP's law are deleted, and the second covariance matrix recalculated from the diagonal matrix based on the new eigenvalues excludes random data, and the remaining data is relatively reliable related data.
  • the theoretical minimum eigenvalue of the first sample covariance matrix can also be calculated according to MP's law, and for eigenvalues smaller than the theoretical characteristic minimum, the absolute value is generally close to 0 and can be ignored Neglect, and the smaller the eigenvalue, the lower its importance, which can be ignored. Therefore, in the solution of this embodiment, all the eigenvalues smaller than the theoretical maximum eigenvalue are deleted from the diagonal matrix of eigenvalues.
  • the eigenvalues also include those that do not conform to MP's law and are smaller than the theoretical minimum eigenvalue.
  • step S40 may include the following thinning steps: calculating a theoretical maximum eigenvalue of the first sample covariance matrix based on MP law; arranging the eigenvalues in ascending order, Generate a eigenvalue diagonal array; delete the eigenvalues from the eigenvalue diagonal array that are smaller than the theoretical maximum eigenvalue to perform denoising processing on the eigenvalue diagonal array.
  • the covariance matrix is recalculated according to the eigenvalue decomposition formula to obtain the second sample covariance matrix, which has eliminated the influence of the white noise data:
  • U is a matrix composed of the feature vector
  • U -1 is an inverse matrix of the matrix composed of the feature vector
  • ⁇ filtered is a diagonal matrix of eigenvalues after denoising processing.
  • the denoised sample covariance matrix is substituted into the Markowitz mean variance model, the investment proportion of each constituent stock is solved, and the constituent stocks are combined according to the calculated investment proportion to generate an investment portfolio.
  • the sample covariance matrix after denoising is used to calculate in the Markowitz mean variance model, so that the calculated portfolio is optimized and the risk of the portfolio is reduced.
  • the investment portfolio generation method proposed in this embodiment determines the target market index, and generates a sample matrix based on the transaction data of the constituent stocks of the target market index over multiple consecutive historical trading days; and calculates the first component constituents of the target market index based on the sample matrix.
  • a sample covariance matrix calculate the eigenvalues of the first sample covariance matrix and the eigenvectors corresponding to the eigenvalues; calculate the theoretical maximum eigenvalue of the first sample covariance matrix based on MP's law, according to the eigenvalues and the theoretical maximum
  • the eigenvalues denoise the diagonal matrix of the eigenvalues of the first sample covariance matrix; calculate the second sample covariance matrix according to the eigenvalue diagonal matrix and the matrix composed of the eigenvectors after denoising;
  • the two-sample covariance matrix and the Markowitz mean variance model calculate the investment proportion of each constituent stock, and generate an investment portfolio based on the investment proportion.
  • This solution is based on MP's law to denoise the sample covariance matrix of the market index and filter out the random data, so that the data in the recalculated second sample covariance matrix is a relatively reliable correlation coefficient, which makes investment
  • the portfolio is optimized to reduce investment risks.
  • the present application also provides an investment portfolio generation device.
  • FIG. 2 a schematic diagram of an internal structure of an investment portfolio generation device according to an embodiment of the present application is shown.
  • the investment portfolio generation device 1 may be a PC (Personal Computer) or a terminal device such as a smart phone, a tablet computer, or a portable computer.
  • the portfolio generating device 1 includes at least a memory 11, a processor 12, a network interface 13, and a communication bus.
  • the memory 11 includes at least one type of readable storage medium.
  • the readable storage medium includes a flash memory, a hard disk, a multimedia card, a card-type memory (for example, SD or DX memory, etc.), a magnetic memory, a magnetic disk, an optical disk, and the like.
  • the memory 11 may be an internal storage unit of the portfolio generation device 1 in some embodiments, such as a hard disk of the portfolio generation device 1.
  • the memory 11 may also be an external storage device of the portfolio generation device 1 in other embodiments, for example, a plug-in hard disk, a Smart Media Card (SMC), and a secure digital (Secure) Digital, SD) card, Flash card, etc.
  • the memory 11 may further include both an internal storage unit of the portfolio generation device 1 and an external storage device.
  • the memory 11 can be used not only to store application software installed in the portfolio generation device 1 and various types of data, such as the code of the portfolio generation program 01, but also to temporarily store data that has been or will be output.
  • the processor 12 may be a central processing unit (CPU), a controller, a microcontroller, a microprocessor, or other data processing chip in some embodiments, and is configured to run program codes or processes stored in the memory 11 Data, such as execution of portfolio creation program 01.
  • CPU central processing unit
  • controller controller
  • microcontroller microcontroller
  • microprocessor or other data processing chip in some embodiments, and is configured to run program codes or processes stored in the memory 11 Data, such as execution of portfolio creation program 01.
  • the network interface 13 may optionally include a standard wired interface, a wireless interface (such as a WI-FI interface), and is generally used to establish a communication connection between the device 1 and other electronic devices.
  • a standard wired interface such as a WI-FI interface
  • the communication bus is used to implement connection communication between these components.
  • the device 1 may further include a user interface.
  • the user interface may include a display, an input unit such as a keyboard, and the optional user interface may further include a standard wired interface and a wireless interface.
  • the display may be an LED display, a liquid crystal display, a touch-type liquid crystal display, an OLED (Organic Light-Emitting Diode, organic light emitting diode) touch device, or the like.
  • the display may also be appropriately referred to as a display screen or a display unit for displaying information processed in the portfolio generating device 1 and a user interface for displaying visualization.
  • FIG. 2 only shows a portfolio generation device 1 having components 11-13 and a portfolio generation program 01.
  • FIG. 1 does not constitute a limitation on the portfolio generation device 1 , Can include fewer or more components than shown, or combine certain components, or different component arrangements.
  • the investment portfolio generation program 01 is stored in the memory 11; when the processor 12 executes the investment portfolio generation program 01 stored in the memory 11, the following steps are implemented:
  • the target market index is determined, and a sample matrix is generated based on the transaction data of the constituent stocks of the target market index over consecutive consecutive historical trading days.
  • a first sample covariance matrix of the constituent stocks of the target market index is calculated according to the sample matrix.
  • the theoretical maximum eigenvalue of the first sample covariance matrix is calculated based on the M-P law, and the eigenvalues of the first sample covariance matrix are denoised to the angular matrix according to the theoretical maximum eigenvalue.
  • the target market index in this application may be a market index such as the Shanghai Composite Index, Shanghai and Shenzhen 300.
  • the method of this application will be described using the Shanghai and Shenzhen 300 as an example.
  • the step of determining a target market index, and generating a sample matrix based on the transaction data of the constituent stocks of the target market index over multiple consecutive historical trading days specifically includes the following detailed steps: determining the target market index, and obtaining the target The transaction data of the constituent stocks of the market index within a plurality of consecutive historical trading days; the acquired transaction data is standardized; and the sample matrix is constructed according to the standardized processed transaction data.
  • the closing price data is used as financial time series data, it has the characteristics of peaks and fat tails.
  • the log closing data of the stock is first processed:
  • the logarithmic rate of return is standardized.
  • the standardized treatment method is as follows:
  • T is the total number of trading days
  • ⁇ i is the standard deviation of the logarithmic yield of stock i.
  • the number of component bonds in the target market index is N.
  • N 300
  • T 300
  • All the logarithmic return data after normalization process form a N ⁇ T matrix.
  • the logarithmic yield of a constituent stock can be regarded as a random variable, and the logarithmic yield of all constituent stocks in T trading days constitutes a sample logarithmic yield matrix.
  • the logarithmic return sequence matrix of all constituent stocks after normalization is as follows:
  • the first sample covariance matrix obtained is an N ⁇ N matrix.
  • Calculating a theoretical maximum eigenvalue of the first sample covariance matrix based on the MP law, and performing a step of denoising the angular matrix on the eigenvalues of the first sample covariance matrix according to the theoretical maximum eigenvalue may include: The detailed steps are as follows: the theoretical maximum eigenvalue of the first sample covariance matrix is calculated based on MP law; the eigenvalues are arranged in order from small to large to generate a diagonal matrix of eigenvalues; from the first sample The eigenvalues of the covariance matrix that are greater than the theoretical maximum eigenvalue and whose previous eigenvalue is less than the theoretical maximum eigenvalue are found as the intercept point eigenvalues; delete the eigenvalues that are less than A feature value of the intercept point feature value to perform a denoising process on the feature matrix to the angular matrix.
  • the eigenvalues ⁇ (i) of the first sample covariance matrix are solved, and the eigenvalues are sorted in ascending order of the eigenvalues ⁇ (1) ⁇ (2) ⁇ ... ⁇ (N) .
  • the values form the eigenvalue diagonal matrix ⁇ :
  • u (i) is a feature vector corresponding to ⁇ (i)
  • the feature vector is a column vector
  • the intercept point eigenvalues are found. Specifically, the eigenvalues ⁇ (1) , ⁇ (2) , ... are arranged in ascending order. In ⁇ (N) , the k-th largest eigenvalue ⁇ (k) is found so that it meets the following conditions:
  • ⁇ (k-1) is the eigenvalue ranked one ahead of ⁇ (k) .
  • ⁇ (k) be the eigenvalue of the intercept point, and replace all eigenvalues whose eigenvalues in the eigenvalue diagonal matrix are smaller than the eigenvalue of the intercept point with 0.
  • the theoretical maximum eigenvalues are consistent with If the eigenvalues calculated based on actual data are greater than the theoretical maximum eigenvalues, it means that some elements in the matrix are not independent and identically distributed, but have a certain correlation.
  • the eigenvalues that conform to MP's law are deleted, and the second covariance matrix recalculated from the diagonal matrix based on the new eigenvalues excludes random data. The remaining data is relatively reliable related data.
  • the theoretical minimum eigenvalue of the first sample covariance matrix can also be calculated according to MP's law, and for eigenvalues smaller than the theoretical characteristic minimum, the absolute value is generally close to 0 and can be ignored Neglect, and the smaller the eigenvalue, the lower its importance, which can be ignored. Therefore, in the solution of this embodiment, all the eigenvalues smaller than the theoretical maximum eigenvalue are deleted from the diagonal matrix of eigenvalues.
  • the eigenvalues also include those that do not conform to MP's law and are smaller than the theoretical minimum eigenvalue.
  • a theoretical maximum eigenvalue of the first sample covariance matrix is calculated based on MP law, and a diagonal matrix of eigenvalues of the first sample covariance matrix is calculated based on the theoretical maximum eigenvalue.
  • the step of performing the denoising processing may include the following thinning steps: calculating a theoretical maximum eigenvalue of the first sample covariance matrix based on MP law; arranging the eigenvalues in order from small to large to generate eigenvalue pairs An angular matrix; deleting the eigenvalues of the eigenvalue diagonal matrix that are smaller than the theoretical maximum eigenvalue to perform a denoising process on the eigenvalues of the angular matrix.
  • the covariance matrix is recalculated according to the eigenvalue decomposition formula to obtain the second sample covariance matrix, which has eliminated the influence of the white noise data:
  • U is a matrix composed of the feature vector
  • U -1 is an inverse matrix of the matrix composed of the feature vector
  • ⁇ filtered is a diagonal matrix of eigenvalues after denoising processing.
  • the denoised sample covariance matrix is substituted into the Markowitz mean variance model, the investment proportion of each constituent stock is solved, and the constituent stocks are combined according to the calculated investment proportion to generate an investment portfolio.
  • the sample covariance matrix after denoising is used to calculate in the Markowitz mean variance model, so that the calculated portfolio is optimized and the risk of the portfolio is reduced.
  • the investment portfolio generation device proposed in this embodiment determines a target market index, and generates a sample matrix based on the transaction data of the component stocks of the target market index over multiple consecutive historical trading days; and calculates the first component constituents of the target market index based on the sample matrix.
  • a sample covariance matrix calculate the eigenvalues of the first sample covariance matrix and the eigenvectors corresponding to the eigenvalues; calculate the theoretical maximum eigenvalue of the first sample covariance matrix based on MP's law, according to the eigenvalues and the theoretical maximum
  • the eigenvalues denoise the diagonal matrix of the eigenvalues of the first sample covariance matrix; calculate the second sample covariance matrix according to the eigenvalue diagonal matrix and the matrix composed of the eigenvectors after denoising;
  • the two-sample covariance matrix and the Markowitz mean variance model calculate the investment proportion of each constituent stock, and generate an investment portfolio based on the investment proportion.
  • This solution is based on MP's law to denoise the sample covariance matrix of the market index and filter out the random data, so that the data in the recalculated second sample covariance matrix is a relatively reliable correlation coefficient, which makes investment
  • the portfolio is optimized to reduce investment risks.
  • the investment portfolio generation program may also be divided into one or more modules, and the one or more modules are stored in the memory 11 and implemented by one or more processors (this embodiment It is executed by the processor 12) to complete the present application.
  • the module referred to in the present application refers to a series of computer program instruction segments capable of performing specific functions, and is used to describe the execution process of the investment portfolio generation program in the investment portfolio generation device.
  • FIG. 3 a schematic diagram of a program module of a portfolio generation program in an embodiment of the portfolio generation device of the present application.
  • the portfolio generation program can be divided into a sample generation module 10 and a covariance calculation.
  • the module 20, the feature calculation module 30, the matrix denoising module 40, and the combination generation module 50 for example:
  • the sample generation module 10 is configured to determine a target market index, and generate a sample matrix according to the transaction data of the constituent stocks of the target market index over multiple consecutive historical trading days;
  • the covariance calculation module 20 is configured to calculate a first sample covariance matrix of the constituent stocks of the target market index according to the sample matrix;
  • the feature calculation module 30 is configured to calculate a feature value of the first sample covariance matrix and a feature vector corresponding to the feature value;
  • the matrix denoising module 40 is configured to calculate a theoretical maximum eigenvalue of the first sample covariance matrix based on the MP law, and diagonally compare the eigenvalues of the first sample covariance matrix based on the theoretical maximum eigenvalue. Denoising
  • the covariance calculation module 20 is further configured to calculate a second sample covariance matrix according to the eigenvalue diagonal matrix and the matrix formed by the feature vector after the denoising process;
  • the combination generation module 50 is configured to calculate an investment ratio of each component stock according to the second sample covariance matrix and the Markowitz mean variance model, and generate an investment portfolio according to the investment ratio.
  • an embodiment of the present application further provides a computer-readable storage medium, where the computer-readable storage medium stores a portfolio generation program, and the portfolio generation program can be executed by one or more processors to achieve the following: operating:

Landscapes

  • Engineering & Computer Science (AREA)
  • Business, Economics & Management (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Human Resources & Organizations (AREA)
  • Theoretical Computer Science (AREA)
  • Strategic Management (AREA)
  • Mathematical Physics (AREA)
  • Economics (AREA)
  • Mathematical Optimization (AREA)
  • Data Mining & Analysis (AREA)
  • Pure & Applied Mathematics (AREA)
  • Marketing (AREA)
  • Computational Mathematics (AREA)
  • General Business, Economics & Management (AREA)
  • Entrepreneurship & Innovation (AREA)
  • Development Economics (AREA)
  • Accounting & Taxation (AREA)
  • Finance (AREA)
  • Mathematical Analysis (AREA)
  • Educational Administration (AREA)
  • Computing Systems (AREA)
  • Technology Law (AREA)
  • Game Theory and Decision Science (AREA)
  • Tourism & Hospitality (AREA)
  • Quality & Reliability (AREA)
  • Algebra (AREA)
  • Operations Research (AREA)
  • Databases & Information Systems (AREA)
  • Software Systems (AREA)
  • General Engineering & Computer Science (AREA)
  • Financial Or Insurance-Related Operations Such As Payment And Settlement (AREA)

Abstract

Provided are an investment portfolio generation method and apparatus, and a computer-readable storage medium. The method comprises: generating a sample matrix according to transaction data of constituent stocks of a target market index in a plurality of consecutive historical trading days (S10); calculating a first sample covariance matrix according to the sample matrix (S20); calculating an eigenvalue of the first sample covariance matrix and an eigenvector corresponding to the eigenvalue (S30); calculating the theoretical maximum eigenvalue of the first sample covariance matrix based on the M-P law, and denoising an eigenvalue diagonal matrix of the first sample covariance matrix according to the theoretical maximum eigenvalue (S40); calculating a second sample covariance matrix according to the denoised eigenvalue diagonal matrix and a matrix composed of eigenvectors (S50); and calculating the investment proportion of each constituent stock according to the second sample covariance matrix, and generating an investment portfolio (S60). By means of the method, the denoising processing of a sample covariance matrix is realized, and the risk of an investment portfolio is reduced.

Description

投资组合生成方法、装置及计算机可读存储介质Method, device and computer-readable storage medium for generating portfolio
本申请基于巴黎公约申明享有2018年06月29日递交的申请号为201810697668.4、名称为“投资组合生成方法、装置及计算机可读存储介质”的中国专利申请的优先权,该中国专利申请的整体内容以参考的方式结合在本申请中。This application is based on the Paris Convention claiming the priority of a Chinese patent application filed on June 29, 2018 with the application number 201810697668.4 and the name "Portfolio generation method, device and computer-readable storage medium", the entire Chinese patent application The contents are incorporated herein by reference.
技术领域Technical field
本申请涉及信息处理技术领域,尤其涉及一种投资组合生成方法、装置及计算机可读存储介质。The present application relates to the field of information processing technology, and in particular, to a method, a device, and a computer-readable storage medium for generating a portfolio.
背景技术Background technique
马科维茨的投资组合边界理论开创了现代数理金融学的领域,第一次把数学工具引入到金融分析中,使得投资理论有了比较可靠的数学分析基础。在实务中,投资者对资产间的相关性的描述,使用的是经验协方差矩阵代替理论上的协方差矩阵,也就是使用历史数据计算资产间的协方差,用样本协方差代替总体协方差。但是由于中国股市的弱有效性,导致获取到的收益数据中存在大量的白噪音数据,白噪音的存在使得样本协方差矩阵是理论协方差矩阵的有偏估计,而股票之间的样本协方差矩阵是资产配置最优组合的计算中的一个重要参数,高维数据的白噪音会严重的扭曲样本协方差矩阵,使得最优投资组合的计算失真,进而导致创建的资产组合的投资风险较高。Markowitz's portfolio boundary theory has opened up the field of modern mathematical finance. For the first time, mathematical tools have been introduced to financial analysis, which has provided a more reliable mathematical analysis foundation for investment theory. In practice, investors describe the correlation between assets using an empirical covariance matrix instead of a theoretical covariance matrix, that is, using historical data to calculate the covariance between assets, and using sample covariance instead of the overall covariance. . However, due to the weak effectiveness of the Chinese stock market, there is a large amount of white noise data in the obtained earnings data. The existence of white noise makes the sample covariance matrix a biased estimate of the theoretical covariance matrix, and the sample covariance between stocks. The matrix is an important parameter in the calculation of the optimal portfolio of asset allocation. The white noise of high-dimensional data will seriously distort the sample covariance matrix, which will distort the calculation of the optimal portfolio and lead to a higher investment risk in the created asset portfolio. .
发明内容Summary of the invention
本申请提供一种投资组合生成方法、装置及计算机可读存储介质,其主要目的在于实现对样本协方差矩阵进行去噪处理,降低投资组合的风险。This application provides a method, device, and computer-readable storage medium for generating a portfolio, the main purpose of which is to implement denoising processing on the sample covariance matrix and reduce the risk of the portfolio.
为实现上述目的,本申请还提供一种投资组合生成方法,该方法包括:In order to achieve the above purpose, this application also provides a method for generating a portfolio, which method includes:
确定目标市场指数,并根据所述目标市场指数的成分股在连续多个历史交易日中的交易数据生成样本矩阵;Determining a target market index, and generating a sample matrix based on the transaction data of the constituent stocks of the target market index over successive historical trading days;
根据所述样本矩阵计算所述目标市场指数的成分股的第一样本协方差矩阵;Calculating a first sample covariance matrix of the constituent stocks of the target market index according to the sample matrix;
计算所述第一样本协方差矩阵的特征值和与特征值对应的特征向量;Calculating a eigenvalue of the first sample covariance matrix and a eigenvector corresponding to the eigenvalue;
基于M-P定律计算所述第一样本协方差矩阵的理论最大特征值,根据所述理论最大特征值对所述第一样本协方差矩阵的特征值对角阵进行去噪处理;Calculating a theoretical maximum eigenvalue of the first sample covariance matrix based on M-P law, and performing a denoising process on the eigenvalues of the first sample covariance matrix on the angular matrix according to the theoretical maximum eigenvalue
根据去噪处理后的特征值对角阵和由所述特征向量构成的矩阵,计算第二样本协方差矩阵;Calculate a second sample covariance matrix according to the eigenvalue diagonal matrix and the matrix formed by the eigenvectors after the denoising process;
根据所述第二样本协方差矩阵和马科维茨均值方差模型中计算各成分股的投资比例,并根据所述投资比例生成投资组合。Calculate the investment ratio of each constituent stock according to the second sample covariance matrix and the Markowitz mean variance model, and generate an investment portfolio according to the investment ratio.
此外,为实现上述目的,本申请还提供一种投资组合生成装置,该装置包括存储器和处理器,所述存储器中存储有可在所述处理器上运行的投资组合生成程序,所述投资组合生成程序被所述处理器执行时实现如下步骤:In addition, in order to achieve the above object, the present application further provides an investment portfolio generation device, which includes a memory and a processor, where the memory stores an investment portfolio generation program that can be run on the processor, and the investment portfolio When the generated program is executed by the processor, the following steps are implemented:
确定目标市场指数,并根据所述目标市场指数的成分股在连续多个历史交易日中的交易数据生成样本矩阵;Determining a target market index, and generating a sample matrix based on the transaction data of the constituent stocks of the target market index over successive historical trading days;
根据所述样本矩阵计算所述目标市场指数的成分股的第一样本协方差矩阵;Calculating a first sample covariance matrix of the constituent stocks of the target market index according to the sample matrix;
计算所述第一样本协方差矩阵的特征值和与特征值对应的特征向量;Calculating a eigenvalue of the first sample covariance matrix and a eigenvector corresponding to the eigenvalue;
基于M-P定律计算所述第一样本协方差矩阵的理论最大特征值,根据所述理论最大特征值对所述第一样本协方差矩阵的特征值对角阵进行去噪处理;Calculating a theoretical maximum eigenvalue of the first sample covariance matrix based on the M-P law, and performing denoising processing on the eigenvalues of the first sample covariance matrix on the angular matrix according to the theoretical maximum eigenvalue;
根据去噪处理后的特征值对角阵和由所述特征向量构成的矩阵,计算第二样本协方差矩阵;Calculate a second sample covariance matrix according to the eigenvalue diagonal matrix and the matrix formed by the eigenvectors after the denoising process;
根据所述第二样本协方差矩阵和马科维茨均值方差模型中计算各成分股的投资比例,并根据所述投资比例生成投资组合。Calculate the investment ratio of each constituent stock according to the second sample covariance matrix and the Markowitz mean variance model, and generate an investment portfolio according to the investment ratio.
此外,为实现上述目的,本申请还提供一种计算机可读存储介质,所述计算机可读存储介质上存储有投资组合生成程序,所述投资组合生成程序可被一个或者多个处理器执行,以实现如下步骤:In addition, in order to achieve the above object, the present application further provides a computer-readable storage medium, where the computer-readable storage medium stores a portfolio generation program, and the portfolio generation program can be executed by one or more processors. To achieve the following steps:
确定目标市场指数,并根据所述目标市场指数的成分股在连续多个历史交易日中的交易数据生成样本矩阵;Determining a target market index, and generating a sample matrix based on the transaction data of the constituent stocks of the target market index over successive historical trading days;
根据所述样本矩阵计算所述目标市场指数的成分股的第一样本协方差矩阵;Calculating a first sample covariance matrix of the constituent stocks of the target market index according to the sample matrix;
计算所述第一样本协方差矩阵的特征值和与特征值对应的特征向量;Calculating a eigenvalue of the first sample covariance matrix and a eigenvector corresponding to the eigenvalue;
基于M-P定律计算所述第一样本协方差矩阵的理论最大特征值,根据所 述理论最大特征值对所述第一样本协方差矩阵的特征值对角阵进行去噪处理;Calculating a theoretical maximum eigenvalue of the first sample covariance matrix based on M-P law, and performing denoising processing on the eigenvalues of the first sample covariance matrix on the angular matrix according to the theoretical maximum eigenvalue;
根据去噪处理后的特征值对角阵和由所述特征向量构成的矩阵,计算第二样本协方差矩阵;Calculate a second sample covariance matrix according to the eigenvalue diagonal matrix and the matrix formed by the eigenvectors after the denoising process;
根据所述第二样本协方差矩阵和马科维茨均值方差模型中计算各成分股的投资比例,并根据所述投资比例生成投资组合。Calculate the investment ratio of each constituent stock according to the second sample covariance matrix and the Markowitz mean variance model, and generate an investment portfolio according to the investment ratio.
本申请提出的投资组合生成方法、装置及计算机可读存储介质,确定目标市场指数,并根据目标市场指数的成分股在连续多个历史交易日中的交易数据生成样本矩阵;根据样本矩阵计算目标市场指数的成分股的第一样本协方差矩阵;计算第一样本协方差矩阵的特征值和与特征值对应的特征向量;基于M-P定律计算第一样本协方差矩阵的理论最大特征值,根据特征值和理论最大特征值对第一样本协方差矩阵的特征值对角阵进行去噪处理;根据去噪处理后的特征值对角阵和由特征向量构成的矩阵,计算第二样本协方差矩阵;根据第二样本协方差矩阵和马科维茨均值方差模型中计算各成分股的投资比例,并根据投资比例生成投资组合。该方案基于M-P定律对市场指数的样本协方差矩阵进行去噪处理,过滤掉其中的随机性数据,使得重新计算得到的第二样本协方差矩阵中的数据是比较可靠的相关系数,进而使得投资组合得到优化,降低投资风险。The investment portfolio generation method, device and computer-readable storage medium proposed in this application determine the target market index, and generate a sample matrix based on the transaction data of the constituent stocks of the target market index over multiple consecutive historical trading days; calculate the target based on the sample matrix The first sample covariance matrix of the constituent stocks of the market index; calculates the eigenvalues of the first sample covariance matrix and the eigenvectors corresponding to the eigenvalues; calculates the theoretical maximum eigenvalue of the first sample covariance matrix based on MP's law , Performing a denoising process on the eigenvalues of the first sample covariance matrix based on the eigenvalues and the theoretical maximum eigenvalues; calculating the second based on the eigenvalues diagonal matrix and the matrix composed of eigenvectors after denoising Sample covariance matrix; calculate the investment proportion of each constituent stock based on the second sample covariance matrix and the Markowitz mean variance model, and generate an investment portfolio based on the investment proportion. This solution is based on MP's law to denoise the sample covariance matrix of the market index and filter out the random data, so that the data in the recalculated second sample covariance matrix is a relatively reliable correlation coefficient, which makes investment The portfolio is optimized to reduce investment risks.
附图说明BRIEF DESCRIPTION OF THE DRAWINGS
图1为本申请一实施例提供的投资组合生成方法的流程示意图;FIG. 1 is a schematic flowchart of an investment portfolio generation method according to an embodiment of the present application;
图2为本申请一实施例提供的投资组合生成装置的内部结构示意图;FIG. 2 is a schematic diagram of an internal structure of an investment portfolio generating device according to an embodiment of the present application; FIG.
图3为本申请一实施例提供的投资组合生成装置中投资组合生成程序的模块示意图。FIG. 3 is a schematic diagram of a module of a portfolio generation program in a portfolio generation device provided by an embodiment of the present application.
本申请目的的实现、功能特点及优点将结合实施例,参照附图做进一步说明。The implementation, functional characteristics and advantages of the purpose of this application will be further described with reference to the embodiments and the drawings.
具体实施方式detailed description
应当理解,此处所描述的具体实施例仅仅用以解释本申请,并不用于限定本申请。It should be understood that the specific embodiments described herein are only used to explain the application, and are not used to limit the application.
本申请提供一种投资组合生成方法。参照图1所示,为本申请一实施例 提供的投资组合生成方法的流程示意图。该方法可以由一个装置执行,该装置可以由软件和/或硬件实现。This application provides a method for generating a portfolio. Referring to FIG. 1, a schematic flowchart of a method for generating a portfolio provided by an embodiment of the present application is shown. The method may be performed by a device, which may be implemented by software and / or hardware.
在本实施例中,投资组合生成方法包括:In this embodiment, the method for generating a portfolio includes:
步骤S10,确定目标市场指数,并根据所述目标市场指数的成分股在连续多个历史交易日中的交易数据生成样本矩阵。In step S10, a target market index is determined, and a sample matrix is generated according to the transaction data of the constituent stocks of the target market index over multiple consecutive historical trading days.
步骤S20,根据所述样本矩阵计算所述目标市场指数的成分股的第一样本协方差矩阵。Step S20: Calculate a first sample covariance matrix of the constituent stocks of the target market index according to the sample matrix.
本申请中的目标市场指数可以是上证综指、沪深300等市场指数,以下实施例中,以沪深300为例对本申请方法进行说明。从数据库中获取沪深300中的300只成分股在过去十年内每一个交易日的收盘价数据。其中,步骤S10具体地包括如下细化步骤:The target market index in this application may be a market index such as the Shanghai Composite Index, Shanghai and Shenzhen 300. In the following embodiments, the method of this application will be described using the Shanghai and Shenzhen 300 as an example. Obtain the closing price data of the 300 constituent stocks in the CSI 300 from the database for each trading day in the past ten years. Specifically, step S10 includes the following detailed steps:
确定目标市场指数,获取所述目标市场指数的成分股在连续多个历史交易日内的交易数据;对获取的交易数据进行标准化处理;根据标准化处理后的交易数据构建所述样本矩阵。The target market index is determined, and transaction data of constituent stocks of the target market index within multiple consecutive historical trading days is obtained; the acquired transaction data is standardized; and the sample matrix is constructed according to the standardized processed transaction data.
此外,由于收盘价数据作为金融时序数据,具备尖峰肥尾的特征,为了消除这种特征,先对股票收盘价数据进行对数化处理:In addition, because the closing price data is used as financial time series data, it has the characteristics of peaks and fat tails. In order to eliminate this feature, the log closing data of the stock is first processed:
Figure PCTCN2018107502-appb-000001
Figure PCTCN2018107502-appb-000001
其中,
Figure PCTCN2018107502-appb-000002
是股票i在第t期末的对数收益率,
Figure PCTCN2018107502-appb-000003
是股票i在第t期末的收盘价。假设过去十年内共有T个交易日的收盘价数据,则第t期末的对数收益率为连续T个交易日中的第t个交易日的收盘价数据。
among them,
Figure PCTCN2018107502-appb-000002
Is the logarithmic yield of stock i at the end of period t,
Figure PCTCN2018107502-appb-000003
Is the closing price of stock i at the end of period t. Assuming that there have been data of closing prices for T trading days in the past ten years, the logarithmic return at the end of period t is the closing price data for the tth trading day in T consecutive trading days.
此外,为了消除量纲的影响,对对数收益率进行标准化处理,对成分股i来说,其标准化处理方式如下:In addition, in order to eliminate the influence of the dimension, the logarithmic rate of return is standardized. For the component stock i, the standardized treatment method is as follows:
Figure PCTCN2018107502-appb-000004
Figure PCTCN2018107502-appb-000004
其中,
Figure PCTCN2018107502-appb-000005
T为交易日的总数量,
Figure PCTCN2018107502-appb-000006
δ i为股票i的对数收益率的标准差。
among them,
Figure PCTCN2018107502-appb-000005
T is the total number of trading days,
Figure PCTCN2018107502-appb-000006
δ i is the standard deviation of the logarithmic yield of stock i.
目标市场指数中成分券的数量为N,对于沪深300来说,N=300,交易日的数量为T,则经过标准化处理后的全部对数收益率数据构成一个N×T的矩阵,每一个成分股的对数收益率可以视为一个随机变量,T个交易日的全部成分股的对数收益率构成一个样本对数收益率矩阵。所有成分股经过标准化处理后的对数收益率序列矩阵如下所示:The number of component bonds in the target market index is N. For Shanghai and Shenzhen 300, N = 300, and the number of trading days is T. All the logarithmic return data after normalization process form a N × T matrix. The logarithmic yield of a constituent stock can be regarded as a random variable, and the logarithmic yield of all constituent stocks in T trading days constitutes a sample logarithmic yield matrix. The logarithmic return sequence matrix of all constituent stocks after normalization is as follows:
Figure PCTCN2018107502-appb-000007
Figure PCTCN2018107502-appb-000007
根据如下公式,得到第一样本协方差矩阵:
Figure PCTCN2018107502-appb-000008
由于计算的是随机变量之间的协方差,因此得到的第一样本协方差矩阵为N×N的矩阵。
Get the first sample covariance matrix according to the following formula:
Figure PCTCN2018107502-appb-000008
Since the covariance between the random variables is calculated, the first sample covariance matrix obtained is an N × N matrix.
步骤S30,计算所述第一样本协方差矩阵的特征值和与特征值对应的特征向量。Step S30: Calculate a feature value of the first sample covariance matrix and a feature vector corresponding to the feature value.
步骤S40,基于M-P定律计算所述第一样本协方差矩阵的理论最大特征值,根据所述理论最大特征值对所述第一样本协方差矩阵的特征值对角阵进行去噪处理。Step S40: Calculate the theoretical maximum eigenvalue of the first sample covariance matrix based on the M-P law, and perform denoising processing on the angular matrix of the eigenvalues of the first sample covariance matrix based on the theoretical maximum eigenvalue.
步骤S50,根据去噪处理后的特征值对角阵和由所述特征向量构成的矩阵,计算第二样本协方差矩阵。Step S50: Calculate a second sample covariance matrix according to the eigenvalue diagonal matrix and the matrix composed of the eigenvectors after the denoising process.
步骤S60,根据所述第二样本协方差矩阵和马科维茨均值方差模型中计算各成分股的投资比例,并根据所述投资比例生成投资组合。Step S60: Calculate the investment ratio of each constituent stock according to the second sample covariance matrix and the Markowitz mean variance model, and generate an investment portfolio according to the investment ratio.
步骤S40可以包括如下细化步骤:基于M-P定律计算所述第一样本协方差矩阵的理论最大特征值;将所述特征值按照由小到大的顺序排列,生成特征值对角阵;从第一样本协方差矩阵的特征值中查找到大于所述理论最大特征值、且其前一个特征值小于所述理论最大特征值的特征值,作为截点特征值;删除所述特征值对角阵中小于所述截点特征值的特征值,以对所述特征值对角阵进行去噪处理。Step S40 may include the following detailed steps: calculating a theoretical maximum eigenvalue of the first sample covariance matrix based on MP law; arranging the eigenvalues in ascending order to generate a diagonal matrix of eigenvalues; from The eigenvalues of the first sample covariance matrix that are greater than the theoretical maximum eigenvalue and whose previous eigenvalue is less than the theoretical maximum eigenvalue are found as the intercept point eigenvalues; the eigenvalue pairs are deleted Eigenvalues in the angular matrix that are smaller than the eigenvalues of the intercept points are used to denoise the angular matrix on the characteristic values.
具体地,求解第一样本协方差矩阵的特征值λ (i),并按照特征值从小到大的顺序对特征值排序λ (1)(2)<…λ (N),这些特征值形成特征值对角阵Λ: Specifically, the eigenvalues λ (i) of the first sample covariance matrix are solved, and the eigenvalues are sorted in ascending order of the eigenvalues λ (1)(2) <... λ (N) . These characteristics The values form the eigenvalue diagonal matrix Λ:
Figure PCTCN2018107502-appb-000009
Figure PCTCN2018107502-appb-000009
计算特征值对应的特征向量。Calculate the eigenvector corresponding to the eigenvalue.
u (i)为λ (i)对应的特征向量,特征向量为列向量,全部的特征向量构成矩阵U=(u (1),u (2),…,u (N))。 u (i) is a feature vector corresponding to λ (i) , the feature vector is a column vector, and all the feature vectors form a matrix U = (u (1) , u (2) , ..., u (N) ).
Figure PCTCN2018107502-appb-000010
则根据M-P定律(Marchenko-Pastur LAW,马尔琴科-帕斯图尔定律,简称M-P定律),如果矩阵中的元素是独立同分布的,则该矩阵的理论最大特征值可以根据Q计算得到,具体计算公式如下:
Remember
Figure PCTCN2018107502-appb-000010
Then according to the MP law (Marchenko-Pastur LAW, referred to as MP law), if the elements in the matrix are independent and identically distributed, the theoretical maximum eigenvalue of the matrix can be calculated according to Q, The specific calculation formula is as follows:
Figure PCTCN2018107502-appb-000011
Figure PCTCN2018107502-appb-000011
根据M-P定律计算出第一样本协方差矩阵的理论最大特征值后,找到截点特征值,具体地,从按照从小到大的顺序排列的特征值λ (1)、λ (2)、…λ (N)中, 查找到排序为第k大的特征值λ (k),使其满足如下条件: After calculating the theoretical maximum eigenvalue of the first sample covariance matrix according to MP's law, the intercept point eigenvalues are found. Specifically, the eigenvalues λ (1) , λ (2) , ... are arranged in ascending order. In λ (N) , the k-th largest eigenvalue λ (k) is found so that it meets the following conditions:
λ (k)max≥λ (k-1) λ (k) > λ max ≥λ (k-1)
λ (k-1)为排在λ (k)的前面一个的特征值。将λ (k)作为截点特征值,将特征值对角阵中特征值小于该截点特征值的特征值均替换为0。 λ (k-1) is the eigenvalue ranked one ahead of λ (k) . Let λ (k) be the eigenvalue of the intercept point, and replace all eigenvalues whose eigenvalues in the eigenvalue diagonal matrix are smaller than the eigenvalue of the intercept point with 0.
由于M-P定律的前提假设是矩阵中的元素是独立同分布的,即假设第一样本协方差矩阵中的元素是独立同分布的情况下,其理论最大特征值符合
Figure PCTCN2018107502-appb-000012
若根据实际数据计算得到特征值大于上述理论最大特征值,则说明矩阵中的一些元素并非是独立同分布的,而是具有一定的相关性。删除掉那些符合M-P定律的特征值,根据新的特征值对角阵重新计算得到的第二协方差矩阵排除掉了随机性数据,剩下的的数据就是比较可靠的相关数据。
Because the premise of MP law assumes that the elements in the matrix are independent and identically distributed, that is, assuming that the elements in the first sample covariance matrix are independent and identically distributed, the theoretical maximum eigenvalues are consistent with
Figure PCTCN2018107502-appb-000012
If the eigenvalues calculated based on actual data are greater than the theoretical maximum eigenvalues, it means that some elements in the matrix are not independent and identically distributed, but have a certain correlation. The eigenvalues that conform to MP's law are deleted, and the second covariance matrix recalculated from the diagonal matrix based on the new eigenvalues excludes random data, and the remaining data is relatively reliable related data.
此处需要说明的是,根据M-P定律也能够计算出第一样本协方差矩阵的理论最小特征值,而对于小于理论特征最小值的特征值来说,其绝对值一般接近于0,可以忽略不计,并且特征值越小,说明其重要程度越低,可以忽略不计,因此,本实施例的方案中将小于理论最大特征值的特征值从特征值对角阵中全部删除掉,被删除的特征值中也包含了那些不符合M-P定律的、小于理论最小特征值的特征值。What needs to be explained here is that the theoretical minimum eigenvalue of the first sample covariance matrix can also be calculated according to MP's law, and for eigenvalues smaller than the theoretical characteristic minimum, the absolute value is generally close to 0 and can be ignored Neglect, and the smaller the eigenvalue, the lower its importance, which can be ignored. Therefore, in the solution of this embodiment, all the eigenvalues smaller than the theoretical maximum eigenvalue are deleted from the diagonal matrix of eigenvalues. The eigenvalues also include those that do not conform to MP's law and are smaller than the theoretical minimum eigenvalue.
或者,在其他实施例中,步骤S40可以包括如下细化步骤:基于M-P定律计算所述第一样本协方差矩阵的理论最大特征值;将所述特征值按照由小到大的顺序排列,生成特征值对角阵;删除所述特征值对角阵中小于所述理论最大特征值的特征值,以对所述特征值对角阵进行去噪处理。Alternatively, in other embodiments, step S40 may include the following thinning steps: calculating a theoretical maximum eigenvalue of the first sample covariance matrix based on MP law; arranging the eigenvalues in ascending order, Generate a eigenvalue diagonal array; delete the eigenvalues from the eigenvalue diagonal array that are smaller than the theoretical maximum eigenvalue to perform denoising processing on the eigenvalue diagonal array.
经过去噪处理后的特征值对角阵如下:The diagonal matrix of eigenvalues after denoising is as follows:
Figure PCTCN2018107502-appb-000013
Figure PCTCN2018107502-appb-000013
根据经过降噪处理后的特征值对角阵Λ filtered,按照特征值分解公式重新计算协方差矩阵,得到第二样本协方差矩阵,该协方差矩阵已经消除了白噪音数据的影响: According to the eigenvalue diagonal matrix Λ filtered after the noise reduction process, the covariance matrix is recalculated according to the eigenvalue decomposition formula to obtain the second sample covariance matrix, which has eliminated the influence of the white noise data:
Σ filtered=UΛ filteredU -1 Σ filtered = UΛ filtered U -1
其中,U为由所述特征向量构成的矩阵,U -1为由所述特征向量构成的矩 阵的逆矩阵,Λ filtered为经过去噪处理后的特征值对角阵。 Where U is a matrix composed of the feature vector, U -1 is an inverse matrix of the matrix composed of the feature vector, and Δ filtered is a diagonal matrix of eigenvalues after denoising processing.
将去噪后的样本协方差矩阵代入到马科维茨均值方差模型中,求解各个成分股的投资比例,根据计算得到的投资比例组合所述成分股,生成投资组合。使用经过去噪处理后的样本协方差矩阵代入到马科维茨均值方差模型中计算,使得计算得到的投资组合得到优化,降低投资组合的风险。The denoised sample covariance matrix is substituted into the Markowitz mean variance model, the investment proportion of each constituent stock is solved, and the constituent stocks are combined according to the calculated investment proportion to generate an investment portfolio. The sample covariance matrix after denoising is used to calculate in the Markowitz mean variance model, so that the calculated portfolio is optimized and the risk of the portfolio is reduced.
本实施例提出的投资组合生成方法,确定目标市场指数,并根据目标市场指数的成分股在连续多个历史交易日中的交易数据生成样本矩阵;根据样本矩阵计算目标市场指数的成分股的第一样本协方差矩阵;计算第一样本协方差矩阵的特征值和与特征值对应的特征向量;基于M-P定律计算第一样本协方差矩阵的理论最大特征值,根据特征值和理论最大特征值对第一样本协方差矩阵的特征值对角阵进行去噪处理;根据去噪处理后的特征值对角阵和由特征向量构成的矩阵,计算第二样本协方差矩阵;根据第二样本协方差矩阵和马科维茨均值方差模型中计算各成分股的投资比例,并根据投资比例生成投资组合。该方案基于M-P定律对市场指数的样本协方差矩阵进行去噪处理,过滤掉其中的随机性数据,使得重新计算得到的第二样本协方差矩阵中的数据是比较可靠的相关系数,进而使得投资组合得到优化,降低投资风险。The investment portfolio generation method proposed in this embodiment determines the target market index, and generates a sample matrix based on the transaction data of the constituent stocks of the target market index over multiple consecutive historical trading days; and calculates the first component constituents of the target market index based on the sample matrix. A sample covariance matrix; calculate the eigenvalues of the first sample covariance matrix and the eigenvectors corresponding to the eigenvalues; calculate the theoretical maximum eigenvalue of the first sample covariance matrix based on MP's law, according to the eigenvalues and the theoretical maximum The eigenvalues denoise the diagonal matrix of the eigenvalues of the first sample covariance matrix; calculate the second sample covariance matrix according to the eigenvalue diagonal matrix and the matrix composed of the eigenvectors after denoising; The two-sample covariance matrix and the Markowitz mean variance model calculate the investment proportion of each constituent stock, and generate an investment portfolio based on the investment proportion. This solution is based on MP's law to denoise the sample covariance matrix of the market index and filter out the random data, so that the data in the recalculated second sample covariance matrix is a relatively reliable correlation coefficient, which makes investment The portfolio is optimized to reduce investment risks.
本申请还提供一种投资组合生成装置。参照图2所示,为本申请一实施例提供的投资组合生成装置的内部结构示意图。The present application also provides an investment portfolio generation device. Referring to FIG. 2, a schematic diagram of an internal structure of an investment portfolio generation device according to an embodiment of the present application is shown.
在本实施例中,投资组合生成装置1可以是PC(Personal Computer,个人电脑),也可以是智能手机、平板电脑、便携计算机等终端设备。该投资组合生成装置1至少包括存储器11、处理器12,网络接口13以及通信总线。In this embodiment, the investment portfolio generation device 1 may be a PC (Personal Computer) or a terminal device such as a smart phone, a tablet computer, or a portable computer. The portfolio generating device 1 includes at least a memory 11, a processor 12, a network interface 13, and a communication bus.
其中,存储器11至少包括一种类型的可读存储介质,所述可读存储介质包括闪存、硬盘、多媒体卡、卡型存储器(例如,SD或DX存储器等)、磁性存储器、磁盘、光盘等。存储器11在一些实施例中可以是投资组合生成装置1的内部存储单元,例如该投资组合生成装置1的硬盘。存储器11在另一些实施例中也可以是投资组合生成装置1的外部存储设备,例如投资组合生成装置1上配备的插接式硬盘,智能存储卡(Smart Media Card,SMC),安全数字(Secure Digital,SD)卡,闪存卡(Flash Card)等。进一步地,存储器11还可以既包括投资组合生成装置1的内部存储单元也包括外部存储设备。存储器11不仅可以用于存储安装于投资组合生成装置1的应用软件及各类数 据,例如投资组合生成程序01的代码等,还可以用于暂时地存储已经输出或者将要输出的数据。The memory 11 includes at least one type of readable storage medium. The readable storage medium includes a flash memory, a hard disk, a multimedia card, a card-type memory (for example, SD or DX memory, etc.), a magnetic memory, a magnetic disk, an optical disk, and the like. The memory 11 may be an internal storage unit of the portfolio generation device 1 in some embodiments, such as a hard disk of the portfolio generation device 1. The memory 11 may also be an external storage device of the portfolio generation device 1 in other embodiments, for example, a plug-in hard disk, a Smart Media Card (SMC), and a secure digital (Secure) Digital, SD) card, Flash card, etc. Further, the memory 11 may further include both an internal storage unit of the portfolio generation device 1 and an external storage device. The memory 11 can be used not only to store application software installed in the portfolio generation device 1 and various types of data, such as the code of the portfolio generation program 01, but also to temporarily store data that has been or will be output.
处理器12在一些实施例中可以是一中央处理器(Central Processing Unit,CPU)、控制器、微控制器、微处理器或其他数据处理芯片,用于运行存储器11中存储的程序代码或处理数据,例如执行投资组合生成程序01等。The processor 12 may be a central processing unit (CPU), a controller, a microcontroller, a microprocessor, or other data processing chip in some embodiments, and is configured to run program codes or processes stored in the memory 11 Data, such as execution of portfolio creation program 01.
网络接口13可选的可以包括标准的有线接口、无线接口(如WI-FI接口),通常用于在该装置1与其他电子设备之间建立通信连接。The network interface 13 may optionally include a standard wired interface, a wireless interface (such as a WI-FI interface), and is generally used to establish a communication connection between the device 1 and other electronic devices.
通信总线用于实现这些组件之间的连接通信。The communication bus is used to implement connection communication between these components.
可选地,该装置1还可以包括用户接口,用户接口可以包括显示器(Display)、输入单元比如键盘(Keyboard),可选的用户接口还可以包括标准的有线接口、无线接口。可选地,在一些实施例中,显示器可以是LED显示器、液晶显示器、触控式液晶显示器以及OLED(Organic Light-Emitting Diode,有机发光二极管)触摸器等。其中,显示器也可以适当的称为显示屏或显示单元,用于显示在投资组合生成装置1中处理的信息以及用于显示可视化的用户界面。Optionally, the device 1 may further include a user interface. The user interface may include a display, an input unit such as a keyboard, and the optional user interface may further include a standard wired interface and a wireless interface. Optionally, in some embodiments, the display may be an LED display, a liquid crystal display, a touch-type liquid crystal display, an OLED (Organic Light-Emitting Diode, organic light emitting diode) touch device, or the like. The display may also be appropriately referred to as a display screen or a display unit for displaying information processed in the portfolio generating device 1 and a user interface for displaying visualization.
图2仅示出了具有组件11-13以及投资组合生成程序01的投资组合生成装置1,本领域技术人员可以理解的是,图1示出的结构并不构成对投资组合生成装置1的限定,可以包括比图示更少或者更多的部件,或者组合某些部件,或者不同的部件布置。FIG. 2 only shows a portfolio generation device 1 having components 11-13 and a portfolio generation program 01. Those skilled in the art can understand that the structure shown in FIG. 1 does not constitute a limitation on the portfolio generation device 1 , Can include fewer or more components than shown, or combine certain components, or different component arrangements.
在图2所示的装置1实施例中,存储器11中存储有投资组合生成程序01;处理器12执行存储器11中存储的投资组合生成程序01时实现如下步骤:In the embodiment of the apparatus 1 shown in FIG. 2, the investment portfolio generation program 01 is stored in the memory 11; when the processor 12 executes the investment portfolio generation program 01 stored in the memory 11, the following steps are implemented:
确定目标市场指数,并根据所述目标市场指数的成分股在连续多个历史交易日中的交易数据生成样本矩阵。The target market index is determined, and a sample matrix is generated based on the transaction data of the constituent stocks of the target market index over consecutive consecutive historical trading days.
根据所述样本矩阵计算所述目标市场指数的成分股的第一样本协方差矩阵。A first sample covariance matrix of the constituent stocks of the target market index is calculated according to the sample matrix.
计算所述第一样本协方差矩阵的特征值和与特征值对应的特征向量。Calculate a eigenvalue and a eigenvector corresponding to the eigenvalue of the first sample covariance matrix.
基于M-P定律计算所述第一样本协方差矩阵的理论最大特征值,根据所述理论最大特征值对所述第一样本协方差矩阵的特征值对角阵进行去噪处理。The theoretical maximum eigenvalue of the first sample covariance matrix is calculated based on the M-P law, and the eigenvalues of the first sample covariance matrix are denoised to the angular matrix according to the theoretical maximum eigenvalue.
根据去噪处理后的特征值对角阵和由所述特征向量构成的矩阵,计算第二样本协方差矩阵。Calculate a second sample covariance matrix according to the eigenvalue diagonal matrix and the matrix composed of the eigenvectors after the denoising process.
根据所述第二样本协方差矩阵和马科维茨均值方差模型中计算各成分股的投资比例,并根据所述投资比例生成投资组合。Calculate the investment ratio of each constituent stock according to the second sample covariance matrix and the Markowitz mean variance model, and generate an investment portfolio according to the investment ratio.
本申请中的目标市场指数可以是上证综指、沪深300等市场指数,以下实施例中,以沪深300为例对本申请方法进行说明。从数据库中获取沪深300中的300只成分股在过去十年内每一个交易日的收盘价数据。其中,确定目标市场指数,并根据所述目标市场指数的成分股在连续多个历史交易日中的交易数据生成样本矩阵的步骤具体地包括如下细化步骤:确定目标市场指数,获取所述目标市场指数的成分股在连续多个历史交易日内的交易数据;对获取的交易数据进行标准化处理;根据标准化处理后的交易数据构建所述样本矩阵。The target market index in this application may be a market index such as the Shanghai Composite Index, Shanghai and Shenzhen 300. In the following embodiments, the method of this application will be described using the Shanghai and Shenzhen 300 as an example. Obtain the closing price data of the 300 constituent stocks in the CSI 300 from the database for each trading day in the past ten years. The step of determining a target market index, and generating a sample matrix based on the transaction data of the constituent stocks of the target market index over multiple consecutive historical trading days specifically includes the following detailed steps: determining the target market index, and obtaining the target The transaction data of the constituent stocks of the market index within a plurality of consecutive historical trading days; the acquired transaction data is standardized; and the sample matrix is constructed according to the standardized processed transaction data.
此外,由于收盘价数据作为金融时序数据,具备尖峰肥尾的特征,为了消除这种特征,先对股票收盘价数据进行对数化处理:In addition, because the closing price data is used as financial time series data, it has the characteristics of peaks and fat tails. In order to eliminate this feature, the log closing data of the stock is first processed:
Figure PCTCN2018107502-appb-000014
Figure PCTCN2018107502-appb-000014
其中,
Figure PCTCN2018107502-appb-000015
是股票i在第t期末的对数收益率,
Figure PCTCN2018107502-appb-000016
是股票i在第t期末的收盘价。假设过去十年内共有T个交易日的收盘价数据,则第t期末的对数收益率为连续T个交易日中的第t个交易日的收盘价数据。
among them,
Figure PCTCN2018107502-appb-000015
Is the logarithmic yield of stock i at the end of period t,
Figure PCTCN2018107502-appb-000016
Is the closing price of stock i at the end of period t. Assuming that there have been data of closing prices for T trading days in the past ten years, the logarithmic return at the end of period t is the closing price data for the tth trading day in T consecutive trading days.
此外,为了消除量纲的影响,对对数收益率进行标准化处理,对成分股i来说,其标准化处理方式如下:In addition, in order to eliminate the influence of the dimension, the logarithmic rate of return is standardized. For the component stock i, the standardized treatment method is as follows:
Figure PCTCN2018107502-appb-000017
Figure PCTCN2018107502-appb-000017
其中,
Figure PCTCN2018107502-appb-000018
T为交易日的总数量,
Figure PCTCN2018107502-appb-000019
δ i为股票i的对数收益率的标准差。
among them,
Figure PCTCN2018107502-appb-000018
T is the total number of trading days,
Figure PCTCN2018107502-appb-000019
δ i is the standard deviation of the logarithmic yield of stock i.
目标市场指数中成分券的数量为N,对于沪深300来说,N=300,交易日的数量为T,则经过标准化处理后的全部对数收益率数据构成一个N×T的矩阵,每一个成分股的对数收益率可以视为一个随机变量,T个交易日的全部成分股的对数收益率构成一个样本对数收益率矩阵。所有成分股经过标准化处理后的对数收益率序列矩阵如下所示:The number of component bonds in the target market index is N. For Shanghai and Shenzhen 300, N = 300, and the number of trading days is T. All the logarithmic return data after normalization process form a N × T matrix. The logarithmic yield of a constituent stock can be regarded as a random variable, and the logarithmic yield of all constituent stocks in T trading days constitutes a sample logarithmic yield matrix. The logarithmic return sequence matrix of all constituent stocks after normalization is as follows:
Figure PCTCN2018107502-appb-000020
Figure PCTCN2018107502-appb-000020
根据如下公式,得到第一样本协方差矩阵:
Figure PCTCN2018107502-appb-000021
由于计算的是随机变量之间的协方差,因此得到的第一样本协方差矩阵为N×N的矩阵。
Get the first sample covariance matrix according to the following formula:
Figure PCTCN2018107502-appb-000021
Since the covariance between the random variables is calculated, the first sample covariance matrix obtained is an N × N matrix.
基于M-P定律计算所述第一样本协方差矩阵的理论最大特征值,根据所 述理论最大特征值对所述第一样本协方差矩阵的特征值对角阵进行去噪处理的步骤可以包括如下细化步骤:基于M-P定律计算所述第一样本协方差矩阵的理论最大特征值;将所述特征值按照由小到大的顺序排列,生成特征值对角阵;从第一样本协方差矩阵的特征值中查找到大于所述理论最大特征值、且其前一个特征值小于所述理论最大特征值的特征值,作为截点特征值;删除所述特征值对角阵中小于所述截点特征值的特征值,以对所述特征值对角阵进行去噪处理。Calculating a theoretical maximum eigenvalue of the first sample covariance matrix based on the MP law, and performing a step of denoising the angular matrix on the eigenvalues of the first sample covariance matrix according to the theoretical maximum eigenvalue may include: The detailed steps are as follows: the theoretical maximum eigenvalue of the first sample covariance matrix is calculated based on MP law; the eigenvalues are arranged in order from small to large to generate a diagonal matrix of eigenvalues; from the first sample The eigenvalues of the covariance matrix that are greater than the theoretical maximum eigenvalue and whose previous eigenvalue is less than the theoretical maximum eigenvalue are found as the intercept point eigenvalues; delete the eigenvalues that are less than A feature value of the intercept point feature value to perform a denoising process on the feature matrix to the angular matrix.
具体地,求解第一样本协方差矩阵的特征值λ (i),并按照特征值从小到大的顺序对特征值排序λ (1)(2)<…λ (N),这些特征值形成特征值对角阵Λ: Specifically, the eigenvalues λ (i) of the first sample covariance matrix are solved, and the eigenvalues are sorted in ascending order of the eigenvalues λ (1)(2) <... λ (N) . These characteristics The values form the eigenvalue diagonal matrix Λ:
Figure PCTCN2018107502-appb-000022
Figure PCTCN2018107502-appb-000022
计算特征值对应的特征向量。Calculate the eigenvector corresponding to the eigenvalue.
u (i)为λ (i)对应的特征向量,特征向量为列向量,全部的特征向量构成矩阵U=(u (1),u (2),…,u (N))。 u (i) is a feature vector corresponding to λ (i) , the feature vector is a column vector, and all the feature vectors form a matrix U = (u (1) , u (2) , ..., u (N) ).
Figure PCTCN2018107502-appb-000023
则根据M-P定律(Marchenko-Pastur,马尔琴科-帕斯图尔定律),如果矩阵中的元素是独立同分布的,则该矩阵的理论最大特征值可以根据Q计算得到,具体计算公式如下:
Remember
Figure PCTCN2018107502-appb-000023
According to the MP's law (Marchenko-Pastur's law), if the elements in the matrix are independent and identically distributed, the theoretical maximum eigenvalue of the matrix can be calculated according to Q. The specific calculation formula is as follows:
Figure PCTCN2018107502-appb-000024
Figure PCTCN2018107502-appb-000024
根据M-P定律计算出第一样本协方差矩阵的理论最大特征值后,找到截点特征值,具体地,从按照从小到大的顺序排列的特征值λ (1)、λ (2)、…λ (N)中,查找到排序为第k大的特征值λ (k),使其满足如下条件: After calculating the theoretical maximum eigenvalue of the first sample covariance matrix according to MP's law, the intercept point eigenvalues are found. Specifically, the eigenvalues λ (1) , λ (2) , ... are arranged in ascending order. In λ (N) , the k-th largest eigenvalue λ (k) is found so that it meets the following conditions:
λ (k)max≥λ (k-1) λ (k) > λ max ≥λ (k-1)
λ (k-1)为排在λ (k)的前面一个的特征值。将λ (k)作为截点特征值,将特征值对角阵中特征值小于该截点特征值的特征值均替换为0。 λ (k-1) is the eigenvalue ranked one ahead of λ (k) . Let λ (k) be the eigenvalue of the intercept point, and replace all eigenvalues whose eigenvalues in the eigenvalue diagonal matrix are smaller than the eigenvalue of the intercept point with 0.
由于M-P定律的前提假设是矩阵中的元素是独立同分布的,即假设第一样本协方差矩阵中的元素是独立同分布的情况下,其理论最大特征值符合
Figure PCTCN2018107502-appb-000025
若根据实际数据计算得到特征值大于上述理论最大特征值,则说明矩阵中的一些元素并非是独立同分布的,而是具有一定的相关性。删除掉那些符合M-P定律的特征值,根据新的特征值对角阵重新计算得到的第二协方差矩阵排除掉了随机性数据,剩下的的数据就是比较可靠的相关数据。
Because the premise of MP law assumes that the elements in the matrix are independent and identically distributed, that is, assuming that the elements in the first sample covariance matrix are independent and identically distributed, the theoretical maximum eigenvalues are consistent with
Figure PCTCN2018107502-appb-000025
If the eigenvalues calculated based on actual data are greater than the theoretical maximum eigenvalues, it means that some elements in the matrix are not independent and identically distributed, but have a certain correlation. The eigenvalues that conform to MP's law are deleted, and the second covariance matrix recalculated from the diagonal matrix based on the new eigenvalues excludes random data. The remaining data is relatively reliable related data.
此处需要说明的是,根据M-P定律也能够计算出第一样本协方差矩阵的理论最小特征值,而对于小于理论特征最小值的特征值来说,其绝对值一般接近于0,可以忽略不计,并且特征值越小,说明其重要程度越低,可以忽略不计,因此,本实施例的方案中将小于理论最大特征值的特征值从特征值对角阵中全部删除掉,被删除的特征值中也包含了那些不符合M-P定律的、小于理论最小特征值的特征值。What needs to be explained here is that the theoretical minimum eigenvalue of the first sample covariance matrix can also be calculated according to MP's law, and for eigenvalues smaller than the theoretical characteristic minimum, the absolute value is generally close to 0 and can be ignored Neglect, and the smaller the eigenvalue, the lower its importance, which can be ignored. Therefore, in the solution of this embodiment, all the eigenvalues smaller than the theoretical maximum eigenvalue are deleted from the diagonal matrix of eigenvalues. The eigenvalues also include those that do not conform to MP's law and are smaller than the theoretical minimum eigenvalue.
或者,在其他实施例中,基于M-P定律计算所述第一样本协方差矩阵的理论最大特征值,根据所述理论最大特征值对所述第一样本协方差矩阵的特征值对角阵进行去噪处理的步骤可以包括如下细化步骤:基于M-P定律计算所述第一样本协方差矩阵的理论最大特征值;将所述特征值按照由小到大的顺序排列,生成特征值对角阵;删除所述特征值对角阵中小于所述理论最大特征值的特征值,以对所述特征值对角阵进行去噪处理。Or, in other embodiments, a theoretical maximum eigenvalue of the first sample covariance matrix is calculated based on MP law, and a diagonal matrix of eigenvalues of the first sample covariance matrix is calculated based on the theoretical maximum eigenvalue. The step of performing the denoising processing may include the following thinning steps: calculating a theoretical maximum eigenvalue of the first sample covariance matrix based on MP law; arranging the eigenvalues in order from small to large to generate eigenvalue pairs An angular matrix; deleting the eigenvalues of the eigenvalue diagonal matrix that are smaller than the theoretical maximum eigenvalue to perform a denoising process on the eigenvalues of the angular matrix.
经过去噪处理后的特征值对角阵如下:The diagonal matrix of eigenvalues after denoising is as follows:
Figure PCTCN2018107502-appb-000026
Figure PCTCN2018107502-appb-000026
根据经过降噪处理后的特征值对角阵Λ filtered,按照特征值分解公式重新计算协方差矩阵,得到第二样本协方差矩阵,该协方差矩阵已经消除了白噪音数据的影响: According to the eigenvalue diagonal matrix Λ filtered after the noise reduction process, the covariance matrix is recalculated according to the eigenvalue decomposition formula to obtain the second sample covariance matrix, which has eliminated the influence of the white noise data:
Σ filtered=UΛ filteredU -1 Σ filtered = UΛ filtered U -1
其中,U为由所述特征向量构成的矩阵,U -1为由所述特征向量构成的矩阵的逆矩阵,Λ filtered为经过去噪处理后的特征值对角阵。 Where U is a matrix composed of the feature vector, U -1 is an inverse matrix of the matrix composed of the feature vector, and Δ filtered is a diagonal matrix of eigenvalues after denoising processing.
将去噪后的样本协方差矩阵代入到马科维茨均值方差模型中,求解各个成分股的投资比例,根据计算得到的投资比例组合所述成分股,生成投资组合。使用经过去噪处理后的样本协方差矩阵代入到马科维茨均值方差模型中计算,使得计算得到的投资组合得到优化,降低投资组合的风险。The denoised sample covariance matrix is substituted into the Markowitz mean variance model, the investment proportion of each constituent stock is solved, and the constituent stocks are combined according to the calculated investment proportion to generate an investment portfolio. The sample covariance matrix after denoising is used to calculate in the Markowitz mean variance model, so that the calculated portfolio is optimized and the risk of the portfolio is reduced.
本实施例提出的投资组合生成装置,确定目标市场指数,并根据目标市场指数的成分股在连续多个历史交易日中的交易数据生成样本矩阵;根据样本矩阵计算目标市场指数的成分股的第一样本协方差矩阵;计算第一样本协方差矩阵的特征值和与特征值对应的特征向量;基于M-P定律计算第一样本 协方差矩阵的理论最大特征值,根据特征值和理论最大特征值对第一样本协方差矩阵的特征值对角阵进行去噪处理;根据去噪处理后的特征值对角阵和由特征向量构成的矩阵,计算第二样本协方差矩阵;根据第二样本协方差矩阵和马科维茨均值方差模型中计算各成分股的投资比例,并根据投资比例生成投资组合。该方案基于M-P定律对市场指数的样本协方差矩阵进行去噪处理,过滤掉其中的随机性数据,使得重新计算得到的第二样本协方差矩阵中的数据是比较可靠的相关系数,进而使得投资组合得到优化,降低投资风险。The investment portfolio generation device proposed in this embodiment determines a target market index, and generates a sample matrix based on the transaction data of the component stocks of the target market index over multiple consecutive historical trading days; and calculates the first component constituents of the target market index based on the sample matrix. A sample covariance matrix; calculate the eigenvalues of the first sample covariance matrix and the eigenvectors corresponding to the eigenvalues; calculate the theoretical maximum eigenvalue of the first sample covariance matrix based on MP's law, according to the eigenvalues and the theoretical maximum The eigenvalues denoise the diagonal matrix of the eigenvalues of the first sample covariance matrix; calculate the second sample covariance matrix according to the eigenvalue diagonal matrix and the matrix composed of the eigenvectors after denoising; The two-sample covariance matrix and the Markowitz mean variance model calculate the investment proportion of each constituent stock, and generate an investment portfolio based on the investment proportion. This solution is based on MP's law to denoise the sample covariance matrix of the market index and filter out the random data, so that the data in the recalculated second sample covariance matrix is a relatively reliable correlation coefficient, which makes investment The portfolio is optimized to reduce investment risks.
可选地,在其他的实施例中,投资组合生成程序还可以被分割为一个或者多个模块,一个或者多个模块被存储于存储器11中,并由一个或多个处理器(本实施例为处理器12)所执行以完成本申请,本申请所称的模块是指能够完成特定功能的一系列计算机程序指令段,用于描述投资组合生成程序在投资组合生成装置中的执行过程。Optionally, in other embodiments, the investment portfolio generation program may also be divided into one or more modules, and the one or more modules are stored in the memory 11 and implemented by one or more processors (this embodiment It is executed by the processor 12) to complete the present application. The module referred to in the present application refers to a series of computer program instruction segments capable of performing specific functions, and is used to describe the execution process of the investment portfolio generation program in the investment portfolio generation device.
例如,参照图3所示,为本申请投资组合生成装置一实施例中的投资组合生成程序的程序模块示意图,该实施例中,投资组合生成程序可以被分割为样本生成模块10、协方差计算模块20、特征计算模块30、矩阵去噪模块40和组合生成模块50,示例性地:For example, referring to FIG. 3, a schematic diagram of a program module of a portfolio generation program in an embodiment of the portfolio generation device of the present application. In this embodiment, the portfolio generation program can be divided into a sample generation module 10 and a covariance calculation. The module 20, the feature calculation module 30, the matrix denoising module 40, and the combination generation module 50, for example:
样本生成模块10用于:确定目标市场指数,并根据所述目标市场指数的成分股在连续多个历史交易日中的交易数据生成样本矩阵;The sample generation module 10 is configured to determine a target market index, and generate a sample matrix according to the transaction data of the constituent stocks of the target market index over multiple consecutive historical trading days;
协方差计算模块20用于:根据所述样本矩阵计算所述目标市场指数的成分股的第一样本协方差矩阵;The covariance calculation module 20 is configured to calculate a first sample covariance matrix of the constituent stocks of the target market index according to the sample matrix;
特征计算模块30用于:计算所述第一样本协方差矩阵的特征值和与特征值对应的特征向量;The feature calculation module 30 is configured to calculate a feature value of the first sample covariance matrix and a feature vector corresponding to the feature value;
矩阵去噪模块40用于:基于M-P定律计算所述第一样本协方差矩阵的理论最大特征值,根据所述理论最大特征值对所述第一样本协方差矩阵的特征值对角阵进行去噪处理;The matrix denoising module 40 is configured to calculate a theoretical maximum eigenvalue of the first sample covariance matrix based on the MP law, and diagonally compare the eigenvalues of the first sample covariance matrix based on the theoretical maximum eigenvalue. Denoising
协方差计算模块20还用于:根据去噪处理后的特征值对角阵和由所述特征向量构成的矩阵,计算第二样本协方差矩阵;The covariance calculation module 20 is further configured to calculate a second sample covariance matrix according to the eigenvalue diagonal matrix and the matrix formed by the feature vector after the denoising process;
组合生成模块50用于:根据所述第二样本协方差矩阵和马科维茨均值方差模型中计算各成分股的投资比例,并根据所述投资比例生成投资组合。The combination generation module 50 is configured to calculate an investment ratio of each component stock according to the second sample covariance matrix and the Markowitz mean variance model, and generate an investment portfolio according to the investment ratio.
上述样本生成模块10、协方差计算模块20、特征计算模块30、矩阵去噪 模块40和组合生成模块50等程序模块被执行时所实现的功能或操作步骤与上述实施例大体相同,在此不再赘述。The functions or operation steps implemented when the program modules such as the sample generation module 10, the covariance calculation module 20, the feature calculation module 30, the matrix denoising module 40, and the combination generation module 50 are executed are substantially the same as those in the above embodiments, and are not described here. More details.
此外,本申请实施例还提出一种计算机可读存储介质,所述计算机可读存储介质上存储有投资组合生成程序,所述投资组合生成程序可被一个或多个处理器执行,以实现如下操作:In addition, an embodiment of the present application further provides a computer-readable storage medium, where the computer-readable storage medium stores a portfolio generation program, and the portfolio generation program can be executed by one or more processors to achieve the following: operating:
确定目标市场指数,并根据所述目标市场指数的成分股在连续多个历史交易日中的交易数据生成样本矩阵;Determining a target market index, and generating a sample matrix based on the transaction data of the constituent stocks of the target market index over successive historical trading days;
根据所述样本矩阵计算所述目标市场指数的成分股的第一样本协方差矩阵;Calculating a first sample covariance matrix of the constituent stocks of the target market index according to the sample matrix;
计算所述第一样本协方差矩阵的特征值和与特征值对应的特征向量;Calculating a eigenvalue of the first sample covariance matrix and a eigenvector corresponding to the eigenvalue;
基于M-P定律计算所述第一样本协方差矩阵的理论最大特征值,根据所述理论最大特征值对所述第一样本协方差矩阵的特征值对角阵进行去噪处理;Calculating a theoretical maximum eigenvalue of the first sample covariance matrix based on the M-P law, and performing denoising processing on the eigenvalues of the first sample covariance matrix on the angular matrix according to the theoretical maximum eigenvalue;
根据去噪处理后的特征值对角阵和由所述特征向量构成的矩阵,计算第二样本协方差矩阵;Calculate a second sample covariance matrix according to the eigenvalue diagonal matrix and the matrix formed by the eigenvectors after the denoising process;
根据所述第二样本协方差矩阵和马科维茨均值方差模型中计算各成分股的投资比例,并根据所述投资比例生成投资组合。本申请计算机可读存储介质具体实施方式与上述投资组合生成装置和方法各实施例基本相同,在此不作累述。Calculate the investment ratio of each constituent stock according to the second sample covariance matrix and the Markowitz mean variance model, and generate an investment portfolio according to the investment ratio. The specific implementation manner of the computer-readable storage medium of the present application is basically the same as each embodiment of the above-mentioned portfolio generation device and method, and is not repeated here.
需要说明的是,上述本申请实施例序号仅仅为了描述,不代表实施例的优劣。并且本文中的术语“包括”、“包含”或者其任何其他变体意在涵盖非排他性的包含,从而使得包括一系列要素的过程、装置、物品或者方法不仅包括那些要素,而且还包括没有明确列出的其他要素,或者是还包括为这种过程、装置、物品或者方法所固有的要素。在没有更多限制的情况下,由语句“包括一个……”限定的要素,并不排除在包括该要素的过程、装置、物品或者方法中还存在另外的相同要素。It should be noted that, the serial numbers of the embodiments of the present application are only for description, and do not represent the advantages and disadvantages of the embodiments. And the terms "including," "including," or any other variation thereof, are intended to cover non-exclusive inclusion, such that a process, device, article, or method that includes a series of elements includes not only those elements, but also The other elements listed, or those that are inherent to such a process, device, article, or method. Without more restrictions, an element limited by the sentence "including a ..." does not exclude that there are other identical elements in the process, device, article, or method that includes the element.
通过以上的实施方式的描述,本领域的技术人员可以清楚地了解到上述实施例方法可借助软件加必需的通用硬件平台的方式来实现,当然也可以通过硬件,但很多情况下前者是更佳的实施方式。基于这样的理解,本申请的技术方案本质上或者说对现有技术做出贡献的部分可以以软件产品的形式体现出来,该计算机软件产品存储在如上所述的一个存储介质(如ROM/RAM、 磁碟、光盘)中,包括若干指令用以使得一台终端设备(可以是手机,计算机,服务器,或者网络设备等)执行本申请各个实施例所述的方法。Through the description of the above embodiments, those skilled in the art can clearly understand that the methods in the above embodiments can be implemented by means of software plus a necessary universal hardware platform, and of course, also by hardware, but in many cases the former is better. Implementation. Based on such an understanding, the technical solution of the present application, in essence, or a part that contributes to the existing technology, can be embodied in the form of a software product, which is stored in a storage medium (such as ROM / RAM) as described above. , Magnetic disk, optical disc), including a number of instructions to enable a terminal device (which may be a mobile phone, a computer, a server, or a network device, etc.) to execute the methods described in the embodiments of the present application.
以上仅为本申请的优选实施例,并非因此限制本申请的专利范围,凡是利用本申请说明书及附图内容所作的等效结构或等效流程变换,或直接或间接运用在其他相关的技术领域,均同理包括在本申请的专利保护范围内。The above are only preferred embodiments of the present application, and thus do not limit the patent scope of the present application. Any equivalent structure or equivalent process transformation made using the contents of the description and drawings of the application, or directly or indirectly used in other related technical fields Are included in the scope of patent protection of this application.

Claims (20)

  1. 一种投资组合生成方法,其特征在于,所述方法包括:A method for generating a portfolio, characterized in that the method includes:
    确定目标市场指数,并根据所述目标市场指数的成分股在连续多个历史交易日中的交易数据生成样本矩阵;Determining a target market index, and generating a sample matrix based on the transaction data of the constituent stocks of the target market index over successive historical trading days;
    根据所述样本矩阵计算所述目标市场指数的成分股的第一样本协方差矩阵;Calculating a first sample covariance matrix of the constituent stocks of the target market index according to the sample matrix;
    计算所述第一样本协方差矩阵的特征值和与特征值对应的特征向量;Calculating a eigenvalue of the first sample covariance matrix and a eigenvector corresponding to the eigenvalue;
    基于M-P定律计算所述第一样本协方差矩阵的理论最大特征值,根据所述理论最大特征值对所述第一样本协方差矩阵的特征值对角阵进行去噪处理;Calculating a theoretical maximum eigenvalue of the first sample covariance matrix based on the M-P law, and performing denoising processing on the eigenvalues of the first sample covariance matrix on the angular matrix according to the theoretical maximum eigenvalue;
    根据去噪处理后的特征值对角阵和由所述特征向量构成的矩阵,计算第二样本协方差矩阵;Calculate a second sample covariance matrix according to the eigenvalue diagonal matrix and the matrix formed by the eigenvectors after the denoising process;
    根据所述第二样本协方差矩阵和马科维茨均值方差模型中计算各成分股的投资比例,并根据所述投资比例生成投资组合。Calculate the investment ratio of each constituent stock according to the second sample covariance matrix and the Markowitz mean variance model, and generate an investment portfolio according to the investment ratio.
  2. 如权利要求1所述的投资组合生成方法,其特征在于,所述基于M-P定律计算所述第一样本协方差矩阵的理论最大特征值,根据所述理论最大特征值对所述第一样本协方差矩阵的特征值对角阵进行去噪处理的步骤包括:The method for generating a portfolio according to claim 1, wherein the theoretical maximum eigenvalue of the first sample covariance matrix is calculated based on MP law, and the first The steps of denoising the angular matrix by the eigenvalues of this covariance matrix include:
    基于M-P定律计算所述第一样本协方差矩阵的理论最大特征值;Calculating a theoretical maximum eigenvalue of the first sample covariance matrix based on M-P law;
    将所述特征值按照由小到大的顺序排列,生成特征值对角阵;Arrange the eigenvalues in ascending order to generate a diagonal matrix of eigenvalues;
    从所述特征值中查找到大于所述理论最大特征值、且其前一个特征值小于所述理论最大特征值的特征值,作为截点特征值;Finding a feature value that is greater than the theoretical maximum feature value and whose previous feature value is less than the theoretical maximum feature value from the feature values is used as the intercept point feature value;
    删除所述特征值对角阵中小于所述截点特征值的特征值,以对所述特征值对角阵进行去噪处理。Deleting the eigenvalues smaller than the intercept point eigenvalues in the eigenvalue diagonal matrix to perform denoising processing on the eigenvalues on the angular matrix.
  3. 如权利要求1所述的投资组合生成方法,其特征在于,所述根据去噪处理后的特征值对角阵和由所述特征向量构成的矩阵,计算第二样本协方差矩阵的步骤包括:The method for generating a portfolio according to claim 1, wherein the step of calculating a second sample covariance matrix according to a diagonal matrix of eigenvalues after denoising processing and a matrix composed of the eigenvectors comprises:
    根据如下公式计算第二样本协方差矩阵Σ filteredCalculate the second sample covariance matrix Σ filtered according to the following formula:
    Σ filtered=UΛ filteredU -1 Σ filtered = UΛ filtered U -1
    其中,U为由所述特征向量构成的矩阵,U -1为由所述特征向量构成的矩阵的逆矩阵,Λ filtered为经过去噪处理后的特征值对角阵。 Where U is a matrix composed of the feature vector, U -1 is an inverse matrix of the matrix composed of the feature vector, and Δ filtered is a diagonal matrix of eigenvalues after denoising processing.
  4. 如权利要求1所述的投资组合生成方法,其特征在于,所述确定目标 市场指数,并根据所述目标市场指数的成分股在连续多个历史交易日中的交易数据生成样本矩阵的步骤包括:The method for generating an investment portfolio according to claim 1, wherein the step of determining a target market index and generating a sample matrix based on transaction data of constituent stocks of the target market index over a plurality of consecutive historical trading days includes: :
    确定目标市场指数,获取所述目标市场指数的成分股在连续多个历史交易日内的交易数据;Determining a target market index, and acquiring transaction data of the constituent stocks of the target market index within multiple consecutive historical trading days;
    对获取的交易数据进行标准化处理;Standardize the acquired transaction data;
    根据标准化处理后的交易数据构建所述样本矩阵。The sample matrix is constructed according to the standardized processed transaction data.
  5. 如权利要求2所述的投资组合生成方法,其特征在于,所述确定目标市场指数,并根据所述目标市场指数的成分股在连续多个历史交易日中的交易数据生成样本矩阵的步骤包括:The method for generating a portfolio according to claim 2, wherein the step of determining a target market index and generating a sample matrix based on transaction data of constituent stocks of the target market index over a plurality of consecutive historical trading days includes: :
    确定目标市场指数,获取所述目标市场指数的成分股在连续多个历史交易日内的交易数据;Determining a target market index, and acquiring transaction data of the constituent stocks of the target market index within multiple consecutive historical trading days;
    对获取的交易数据进行标准化处理;Standardize the acquired transaction data;
    根据标准化处理后的交易数据构建所述样本矩阵。The sample matrix is constructed according to the standardized processed transaction data.
  6. 如权利要求3所述的投资组合生成方法,其特征在于,所述确定目标市场指数,并根据所述目标市场指数的成分股在连续多个历史交易日中的交易数据生成样本矩阵的步骤包括:The method for generating a portfolio according to claim 3, wherein the step of determining a target market index and generating a sample matrix based on the transaction data of the constituent stocks of the target market index over a plurality of consecutive historical trading days includes: :
    确定目标市场指数,获取所述目标市场指数的成分股在连续多个历史交易日内的交易数据;Determining a target market index, and acquiring transaction data of the constituent stocks of the target market index within multiple consecutive historical trading days;
    对获取的交易数据进行标准化处理;Standardize the acquired transaction data;
    根据标准化处理后的交易数据构建所述样本矩阵。The sample matrix is constructed according to the standardized processed transaction data.
  7. 如权利要求4所述的投资组合生成方法,其特征在于,所述交易数据为收盘价数据,在所述对获取的交易数据进行标准化处理的步骤之前,该方法还包括步骤:The method for generating a portfolio according to claim 4, wherein the transaction data is closing price data, and before the step of standardizing the acquired transaction data, the method further comprises the steps of:
    将所述收盘价数据转换为对数收益率数据;Converting the closing price data into logarithmic yield data;
    所述根据标准化处理后的交易数据构建所述样本矩阵的步骤包括:The step of constructing the sample matrix based on the standardized processed transaction data includes:
    根据标准化处理后的对数收益率数据构建所述样本矩阵。The sample matrix is constructed according to the logarithmic rate of return data after the normalization process.
  8. 一种投资组合生成装置,其特征在于,所述装置包括存储器和处理器,所述存储器上存储有可在所述处理器上运行的投资组合生成程序,所述投资组合生成程序被所述处理器执行时实现如下步骤:A device for generating a portfolio, characterized in that the device includes a memory and a processor, and the memory stores a portfolio generating program that can be run on the processor, and the portfolio generating program is processed by the processor Implement the following steps when the processor executes:
    确定目标市场指数,并根据所述目标市场指数的成分股在连续多个历史 交易日中的交易数据生成样本矩阵;Determining a target market index, and generating a sample matrix based on the transaction data of the constituent stocks of the target market index over consecutive consecutive historical trading days;
    根据所述样本矩阵计算所述目标市场指数的成分股的第一样本协方差矩阵;Calculating a first sample covariance matrix of the constituent stocks of the target market index according to the sample matrix;
    计算所述第一样本协方差矩阵的特征值和与特征值对应的特征向量;Calculating a eigenvalue of the first sample covariance matrix and a eigenvector corresponding to the eigenvalue;
    基于M-P定律计算所述第一样本协方差矩阵的理论最大特征值,根据所述理论最大特征值对所述第一样本协方差矩阵的特征值对角阵进行去噪处理;Calculating a theoretical maximum eigenvalue of the first sample covariance matrix based on the M-P law, and performing denoising processing on the eigenvalues of the first sample covariance matrix on the angular matrix according to the theoretical maximum eigenvalue;
    根据去噪处理后的特征值对角阵和由所述特征向量构成的矩阵,计算第二样本协方差矩阵;Calculate a second sample covariance matrix according to the eigenvalue diagonal matrix and the matrix formed by the eigenvectors after the denoising process;
    根据所述第二样本协方差矩阵和马科维茨均值方差模型中计算各成分股的投资比例,并根据所述投资比例生成投资组合。Calculate the investment ratio of each constituent stock according to the second sample covariance matrix and the Markowitz mean variance model, and generate an investment portfolio according to the investment ratio.
  9. 如权利要求8所述的投资组合生成装置,其特征在于,所述基于M-P定律计算所述第一样本协方差矩阵的理论最大特征值,根据所述理论最大特征值对所述第一样本协方差矩阵的特征值对角阵进行去噪处理的步骤包括:The investment portfolio generating device according to claim 8, wherein the theoretical maximum eigenvalue of the first sample covariance matrix is calculated based on MP law, and the first The steps of denoising the angular matrix by the eigenvalues of this covariance matrix include:
    基于M-P定律计算所述第一样本协方差矩阵的理论最大特征值;Calculating a theoretical maximum eigenvalue of the first sample covariance matrix based on M-P law;
    将所述特征值按照由小到大的顺序排列,生成特征值对角阵;Arrange the eigenvalues in ascending order to generate a diagonal matrix of eigenvalues;
    从所述特征值中查找到大于所述理论最大特征值、且其前一个特征值小于所述理论最大特征值的特征值,作为截点特征值;Finding a feature value that is greater than the theoretical maximum feature value and whose previous feature value is less than the theoretical maximum feature value from the feature values is used as the intercept point feature value;
    删除所述特征值对角阵中小于所述截点特征值的特征值,以对所述特征值对角阵进行去噪处理。Deleting the eigenvalues smaller than the intercept point eigenvalues in the eigenvalue diagonal matrix to perform denoising processing on the eigenvalues on the angular matrix.
  10. 如权利要求8所述的投资组合生成装置,其特征在于,所述根据去噪处理后的特征值对角阵和由所述特征向量构成的矩阵,计算第二样本协方差矩阵的步骤包括:The device for generating a portfolio according to claim 8, wherein the step of calculating a second sample covariance matrix according to a diagonal matrix of eigenvalues after denoising processing and a matrix composed of the eigenvectors comprises:
    根据如下公式计算第二样本协方差矩阵Σ filteredCalculate the second sample covariance matrix Σ filtered according to the following formula:
    Σ filtered=UΛ filteredU -1 Σ filtered = UΛ filtered U -1
    其中,U为由所述特征向量构成的矩阵,U -1为由所述特征向量构成的矩阵的逆矩阵,Λ filtered为经过去噪处理后的特征值对角阵。 Where U is a matrix composed of the feature vector, U -1 is an inverse matrix of the matrix composed of the feature vector, and Δ filtered is a diagonal matrix of eigenvalues after denoising processing.
  11. 如权利要求8所述的投资组合生成装置,其特征在于,所述确定目标市场指数,并根据所述目标市场指数的成分股在连续多个历史交易日中的交易数据生成样本矩阵的步骤包括:The device for generating a portfolio according to claim 8, wherein the step of determining a target market index and generating a sample matrix based on transaction data of constituent stocks of the target market index over a plurality of consecutive historical trading days comprises: :
    确定目标市场指数,获取所述目标市场指数的成分股在连续多个历史交 易日内的交易数据;Determining a target market index, and acquiring transaction data of the constituent stocks of the target market index within multiple consecutive historical trading days;
    对获取的交易数据进行标准化处理;Standardize the acquired transaction data;
    根据标准化处理后的交易数据构建所述样本矩阵。The sample matrix is constructed according to the standardized processed transaction data.
  12. 如权利要求9所述的投资组合生成装置,其特征在于,所述确定目标市场指数,并根据所述目标市场指数的成分股在连续多个历史交易日中的交易数据生成样本矩阵的步骤包括:The investment portfolio generation device according to claim 9, wherein the step of determining a target market index and generating a sample matrix based on transaction data of constituent stocks of the target market index over a plurality of consecutive historical trading days includes :
    确定目标市场指数,获取所述目标市场指数的成分股在连续多个历史交易日内的交易数据;Determining a target market index, and acquiring transaction data of the constituent stocks of the target market index within multiple consecutive historical trading days;
    对获取的交易数据进行标准化处理;Standardize the acquired transaction data;
    根据标准化处理后的交易数据构建所述样本矩阵。The sample matrix is constructed according to the standardized processed transaction data.
  13. 如权利要求10所述的投资组合生成装置,其特征在于,所述确定目标市场指数,并根据所述目标市场指数的成分股在连续多个历史交易日中的交易数据生成样本矩阵的步骤包括:The device for generating a portfolio according to claim 10, wherein the step of determining a target market index and generating a sample matrix based on the transaction data of the constituent stocks of the target market index over a plurality of consecutive historical trading days comprises: :
    确定目标市场指数,获取所述目标市场指数的成分股在连续多个历史交易日内的交易数据;Determining a target market index, and acquiring transaction data of the constituent stocks of the target market index within multiple consecutive historical trading days;
    对获取的交易数据进行标准化处理;Standardize the acquired transaction data;
    根据标准化处理后的交易数据构建所述样本矩阵。The sample matrix is constructed according to the standardized processed transaction data.
  14. 如权利要求11所述的投资组合生成装置,其特征在于,投资组合生成程序还可被所述处理器执行,以在所述交易数据为收盘价数据,在所述对获取的交易数据进行标准化处理的步骤之前,还实现如下步骤:The investment portfolio generation device according to claim 11, wherein the investment portfolio generation program is further executable by the processor, so that the transaction data is closing price data, and the acquired transaction data is standardized. Before the processing steps, the following steps are also implemented:
    将所述收盘价数据转换为对数收益率数据;Converting the closing price data into logarithmic yield data;
    所述根据标准化处理后的交易数据构建所述样本矩阵的步骤包括:The step of constructing the sample matrix based on the standardized processed transaction data includes:
    根据标准化处理后的对数收益率数据构建所述样本矩阵。The sample matrix is constructed according to the logarithmic rate of return data after the normalization process.
  15. 一种计算机可读存储介质,其特征在于,所述计算机可读存储介质上存储有投资组合生成程序,所述投资组合生成程序可被一个或者多个处理器执行,以实现如下步骤:A computer-readable storage medium is characterized in that the computer-readable storage medium stores a portfolio generation program, and the portfolio generation program can be executed by one or more processors to implement the following steps:
    确定目标市场指数,并根据所述目标市场指数的成分股在连续多个历史交易日中的交易数据生成样本矩阵;Determining a target market index, and generating a sample matrix based on the transaction data of the constituent stocks of the target market index over successive historical trading days;
    根据所述样本矩阵计算所述目标市场指数的成分股的第一样本协方差矩阵;Calculating a first sample covariance matrix of the constituent stocks of the target market index according to the sample matrix;
    计算所述第一样本协方差矩阵的特征值和与特征值对应的特征向量;Calculating a eigenvalue of the first sample covariance matrix and a eigenvector corresponding to the eigenvalue;
    基于M-P定律计算所述第一样本协方差矩阵的理论最大特征值,根据所述理论最大特征值对所述第一样本协方差矩阵的特征值对角阵进行去噪处理;Calculating a theoretical maximum eigenvalue of the first sample covariance matrix based on the M-P law, and performing denoising processing on the eigenvalues of the first sample covariance matrix on the angular matrix according to the theoretical maximum eigenvalue;
    根据去噪处理后的特征值对角阵和由所述特征向量构成的矩阵,计算第二样本协方差矩阵;Calculate a second sample covariance matrix according to the eigenvalue diagonal matrix and the matrix formed by the eigenvectors after the denoising process;
    根据所述第二样本协方差矩阵和马科维茨均值方差模型中计算各成分股的投资比例,并根据所述投资比例生成投资组合。Calculate the investment ratio of each constituent stock according to the second sample covariance matrix and the Markowitz mean variance model, and generate an investment portfolio according to the investment ratio.
  16. 如权利要求15所述的计算机可读存储介质,其特征在于,所述基于M-P定律计算所述第一样本协方差矩阵的理论最大特征值,根据所述理论最大特征值对所述第一样本协方差矩阵的特征值对角阵进行去噪处理的步骤包括:The computer-readable storage medium of claim 15, wherein the theoretical maximum eigenvalue of the first sample covariance matrix is calculated based on MP law, and the first maximum eigenvalue of the first sample covariance matrix is calculated based on the theoretical maximum eigenvalue. The steps of denoising the angular matrix by the eigenvalues of the sample covariance matrix include:
    基于M-P定律计算所述第一样本协方差矩阵的理论最大特征值;Calculating a theoretical maximum eigenvalue of the first sample covariance matrix based on M-P law;
    将所述特征值按照由小到大的顺序排列,生成特征值对角阵;Arrange the eigenvalues in ascending order to generate a diagonal matrix of eigenvalues;
    从所述特征值中查找到大于所述理论最大特征值、且其前一个特征值小于所述理论最大特征值的特征值,作为截点特征值;Finding a feature value that is greater than the theoretical maximum feature value and whose previous feature value is less than the theoretical maximum feature value from the feature values is used as the intercept point feature value;
    删除所述特征值对角阵中小于所述截点特征值的特征值,以对所述特征值对角阵进行去噪处理。Deleting the eigenvalues smaller than the intercept point eigenvalues in the eigenvalue diagonal matrix to perform denoising processing on the eigenvalues on the angular matrix.
  17. 如权利要求15所述的计算机可读存储介质,其特征在于,所述根据去噪处理后的特征值对角阵和由所述特征向量构成的矩阵,计算第二样本协方差矩阵的步骤包括:The computer-readable storage medium of claim 15, wherein the step of calculating a second sample covariance matrix according to a diagonal matrix of eigenvalues after denoising processing and a matrix composed of the eigenvectors comprises :
    根据如下公式计算第二样本协方差矩阵Σ filteredCalculate the second sample covariance matrix Σ filtered according to the following formula:
    Σ filtered=UΛ filteredU -1 Σ filtered = UΛ filtered U -1
    其中,U为由所述特征向量构成的矩阵,U -1为由所述特征向量构成的矩阵的逆矩阵,Λ filtered为经过去噪处理后的特征值对角阵。 Where U is a matrix composed of the feature vector, U -1 is an inverse matrix of the matrix composed of the feature vector, and Δ filtered is a diagonal matrix of eigenvalues after denoising processing.
  18. 如权利要求15所述的计算机可读存储介质,其特征在于,所述确定目标市场指数,并根据所述目标市场指数的成分股在连续多个历史交易日中的交易数据生成样本矩阵的步骤包括:The computer-readable storage medium of claim 15, wherein the step of determining a target market index, and generating a sample matrix based on transaction data of constituent stocks of the target market index over multiple consecutive historical trading days include:
    确定目标市场指数,获取所述目标市场指数的成分股在连续多个历史交易日内的交易数据;Determining a target market index, and acquiring transaction data of the constituent stocks of the target market index within multiple consecutive historical trading days;
    对获取的交易数据进行标准化处理;Standardize the acquired transaction data;
    根据标准化处理后的交易数据构建所述样本矩阵。The sample matrix is constructed according to the standardized processed transaction data.
  19. 如权利要求16所述的计算机可读存储介质,其特征在于,所述确定目标市场指数,并根据所述目标市场指数的成分股在连续多个历史交易日中的交易数据生成样本矩阵的步骤包括:The computer-readable storage medium of claim 16, wherein the step of determining a target market index, and generating a sample matrix based on transaction data of constituent stocks of the target market index over a plurality of consecutive historical trading days include:
    确定目标市场指数,获取所述目标市场指数的成分股在连续多个历史交易日内的交易数据;Determining a target market index, and acquiring transaction data of the constituent stocks of the target market index within multiple consecutive historical trading days;
    对获取的交易数据进行标准化处理;Standardize the acquired transaction data;
    根据标准化处理后的交易数据构建所述样本矩阵。The sample matrix is constructed according to the standardized processed transaction data.
  20. 如权利要求15所述的计算机可读存储介质,其特征在于,投资组合生成程序还可被所述处理器执行,以在所述交易数据为收盘价数据,在所述对获取的交易数据进行标准化处理的步骤之前,还实现如下步骤:The computer-readable storage medium of claim 15, wherein the investment portfolio generation program is further executable by the processor to perform the transaction data as closing price data, and perform the pairing of the acquired transaction data. Before the steps of the standardization process, the following steps are also implemented:
    将所述收盘价数据转换为对数收益率数据;Converting the closing price data into logarithmic yield data;
    所述根据标准化处理后的交易数据构建所述样本矩阵的步骤包括:The step of constructing the sample matrix based on the standardized processed transaction data includes:
    根据标准化处理后的对数收益率数据构建所述样本矩阵。The sample matrix is constructed according to the logarithmic rate of return data after the normalization process.
PCT/CN2018/107502 2018-06-29 2018-09-26 Investment portfolio generation method and apparatus, and computer-readable storage medium WO2020000718A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201810697668.4A CN109034542A (en) 2018-06-29 2018-06-29 Investment combination generation method, device and computer readable storage medium
CN201810697668.4 2018-06-29

Publications (1)

Publication Number Publication Date
WO2020000718A1 true WO2020000718A1 (en) 2020-01-02

Family

ID=65521864

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2018/107502 WO2020000718A1 (en) 2018-06-29 2018-09-26 Investment portfolio generation method and apparatus, and computer-readable storage medium

Country Status (2)

Country Link
CN (1) CN109034542A (en)
WO (1) WO2020000718A1 (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111898970A (en) * 2020-06-30 2020-11-06 深圳前海微众银行股份有限公司 Authentication method and device for product application qualification
CN111861711B (en) * 2020-07-22 2024-06-07 重庆百盐投资(集团)有限公司 Resource allocation method and related product

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103455943A (en) * 2013-09-02 2013-12-18 深圳市国泰安信息技术有限公司 Stock or stock investment portfolio volatility prediction method and device
CN105321113A (en) * 2014-08-04 2016-02-10 同济大学 Macroscopic factor based pressure test client
US20170316507A1 (en) * 2016-04-27 2017-11-02 Anish R. Shah Uncertain utility to improve portfolio selection
CN108090837A (en) * 2018-02-08 2018-05-29 上海译会信息科技有限公司 One kind of multiple portfolio investment tactics methods of risk assessment

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103455943A (en) * 2013-09-02 2013-12-18 深圳市国泰安信息技术有限公司 Stock or stock investment portfolio volatility prediction method and device
CN105321113A (en) * 2014-08-04 2016-02-10 同济大学 Macroscopic factor based pressure test client
US20170316507A1 (en) * 2016-04-27 2017-11-02 Anish R. Shah Uncertain utility to improve portfolio selection
CN108090837A (en) * 2018-02-08 2018-05-29 上海译会信息科技有限公司 One kind of multiple portfolio investment tactics methods of risk assessment

Also Published As

Publication number Publication date
CN109034542A (en) 2018-12-18

Similar Documents

Publication Publication Date Title
US11677811B2 (en) Method and system for securely identifying users
CN110502516B (en) Table data analysis method and device, computer equipment and storage medium
WO2019061994A1 (en) Electronic device, insurance product recommendation method and system, and computer readable storage medium
WO2019061976A1 (en) Fund product recommendation method and apparatus, terminal device, and storage medium
JP6573418B2 (en) Business customization apparatus, method, system and storage medium based on data source
US8774471B1 (en) Technique for recognizing personal objects and accessing associated information
WO2019192132A1 (en) Stock trend prediction device and method, and readable storage medium
CN111881158A (en) Management report data processing method and device, computer system and readable storage medium
CN108985501B (en) Index feature extraction-based stock index prediction method, server and storage medium
US20230004979A1 (en) Abnormal behavior detection method and apparatus, electronic device, and computer-readable storage medium
WO2020140681A1 (en) Numerical value calculation method and apparatus, computer device, and storage medium
WO2020000718A1 (en) Investment portfolio generation method and apparatus, and computer-readable storage medium
WO2020164204A1 (en) Text template recognition method and apparatus, and computer readable storage medium
CN113436725B (en) Data processing method, system, computer device and computer readable storage medium
CN111383732A (en) Medicine auditing method, device, computer system and readable storage medium based on mutual exclusion identification
WO2019095569A1 (en) Financial analysis method based on financial and economic event on microblog, application server, and computer readable storage medium
CN109544348B (en) Asset security screening method, device and computer readable storage medium
CN112241433A (en) Product demonstration method and device, computer equipment and storage medium
WO2019242143A1 (en) Stocks selling early-warning method and apparatus, and computer-readable storage medium
WO2020199483A1 (en) Image processing method and apparatus for financial data, and device and computer-readable storage medium
US11321332B2 (en) Automatic frequency recommendation for time series data
CN114495137A (en) Bill abnormity detection model generation method and bill abnormity detection method
CN111221917B (en) Intelligent partition storage method, intelligent partition storage device and computer readable storage medium
US20150106883A1 (en) System and method for researching and accessing documents online
CN111723210A (en) Method and device for storing data table, computer equipment and readable storage medium

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 18924147

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 18924147

Country of ref document: EP

Kind code of ref document: A1