2017-12-15

Blueprint of Building Robo-Advisors with a Structured Knowledge Processing Network, by Mark Hsia

National Computer Symposium 2017 (NCS 2017), 14-15 December 2017, National DongHwa University, Hualien, Taiwan


Blueprint of Building Robo-Advisors
with a Structured Knowledge Processing Network


Chao-Yih Hsia ( 夏肇毅 )
Taipei,Taiwan



ABSTRACT


This paper presents a blueprint to build a robo-advisor based on a structured knowledge processing network. The idea comes from the conceptual model of  human brain operations. Knowledge Processing Units (KPU) connect each other through a message queue (MQ) system. Each KPU attached a sticker which keeps a piece of knowledge to process. The hierarchical arrangement of knowledge stickers allows human experiences  to be executed to manage the portfolios of clients properly.


Keywords: Robo-Advisor, AI, Artificial Intelligence, Knowledge Processors Network


  1. Introduction
Robo-Advisor [1] is a platform which manages client portfolio of assets automatically with much lower rates than normal advisors. It uses portfolio allocation software to decide how a client should invest his money to which financial instruments based on client’s favor. The client information is collected in a KYC (Know Your Customers) procedure. This is a necessary procedure when a new client applies for the wealth management service.

An online survey collects client’s financial situation and their requirements on money management. Especially the lever of risk they can bear.


A Robo-Advisor invests client’s money to different ETFs based on average and variance of return. The percentages  of stocks, bonds and money  decide the risk and return of the investment. A Robo-Advisor needs to diversify the assets and rebalance them periodically.


Usually we code algorithms of asset management directly to build a Robo-Advisor.  Programs perform selected rules on the platform.


In this paper, we are planning a knowledge based Robo-Advisor which receives information all the time. It’ll process incoming data, store information and make decision based on its internal knowledge structure.


Usually the AI machine learning algorithms like neural network use numeric models to train machines by adjusting weights. Our robo-advisor is based on a knowledge network. It stores existing human knowledge and processes information based on the knowledge it has learned.



  1. Brain Knowledge Sticker Model
In Hsia 2017 article “Replicate Brain Knowledge Sticker Model to build a Fintech AI Tower” [2] The author assumed that when eyes and ears receive outside signals, they transmit them to all other neurons immediately thru the neural network. There should be some lower layer neurons handling vowels, consonants and letters. And these neurons connect to the higher layer neurons, which are in charge of recognizing words and sentences.


figure 1: conceptual neural knowledge network


Neurons receive signal and will generate signals again if necessary.  The author conceptually mapped the brain neurons to small stickers and called this as a “Brain Sticker Model”. The lower layers of stickers  keep sounds, words, phrases or sentences. All the way up, the upper layers of stickers keep formulas, theorems, procedures or methods. All stickers work parallelly. When one sticker detects that the input signal is same as its content, it will send its signal out to the connected stickers above it. Therefore, when we hear sounds, we can convert them to words, phrases and then sentences. When we see letters, we can link them together to words and sentences. This is a process of recognizing.


A psychology article "The magical number seven, plus or minus two: Some limits on our capacity for processing information" [3]  mentioned the human’s working memory size to hold objects is seven, plus or minus two. This means even many signals are received by  neurons, but only seven of them will be processed at a single moment. Others will be ignored. This also avoids infinite chained reaction of signals.


In order to emulate the Brain Sticker Model, first we need many knowledge processors to perform the functions of stickers in the brain. A sticker is like a cheat sheet which records a piece of knowledge. Then we need a network to link all stickers. Each sticker will receive messages, process messages and then send message out as their response. The response will trigger other stickers again and keep the process going.


  1. Use a Message Queue System as a Neural Network
Popular MQ (Message Queue) system like JMS, ZMQ and RabbitMQ have been widely used in enterprise systems to exchange messages between units. MQ can be configured to queue, worker, rpc or publish/subscribe mode, as follows:


Queue mode: A queue connects a producer and a consumer. A producer sends messages to the queue and a consumer receives messages from that queue.


figure 2: MQ queue mode


Worker mode: A queue connects a producer and multiple consumers. A producer sends messages to the queue and each message will be received by only one of consumers. This is used to dispatch tasks to multiple workers.


figure 3: MQ worker  mode


RPC mode: A queue connects a producer and a consumer to send the request and a call back queue connects the consumer to the producer to send the response back. This is used for the remote procedure call (rpc).


figure 4: MQ RPC mode


Pub/Sub mode: Publishers send messages with different topics and the consumers who subscribed those topics will receive them automatically.





figure 5: MQ Pub/Sub mode



  1. Knowledge Processing Unit
To establish our Robo-Advisor AI system, a computer MQ (Message Queue) system is suitable to emulate the conceptual signal passing model in the neural network.


Each neuron can be simulated with a Knowledge Processing Unit (KPU) which includes an MQ subscribe input and an MQ publish output. Messages can be broadcasted to all KPUs.

figure 6: Knowledge Processing Unit(KPU)


By subscribing some topics of message, a KPU can receive some specific messages it would like to handle. It contains a sticker which describes the algorithm, it should perform. The result of the processing will be published to other KPUs thru MQ output.


In order to avoid triggering the infinite loop of message, we also need to implement the “Seven plus or minus two” rule. We should stop broadcasting messages once the working memory has already received seven messages. Let the working memory simply process seven messages on hand to see what conclusion we can get from them. This will keep thinking process easier.

An ideal Robo-Advisor can understand the economic news and provide advices for the changes. Therefore, it should understand the principal financial market rules to interpret the changes of world to financial response actions.


To build a Robo-Advisor, we need to set up lots of keyword KPUs to handle the necessary domain knowledge, such as USD, JPY, OIL, Interest Rate,... etc. When a KPU is tagged as USD, it will detect the USD keyword input and publish all information related to USD. Similarly, a KPU with an OIL tag should detect the OIL keyword and send out the latest OIL knowledge.


Our Robo-Advisor should include the following types of KPUs:


Language KPUs:
Verb KPUs, Noun KPUs, Adj/Adv KPUs, Phases KPUs, Short sentences KPUs, Grammar KPUs.


Formula KPUs:
Financial Formulas like Black Scholes model, Kelly formula,..etc.

Method KPUs:
Such as solving linear equation.



  1. Robo-Advisor Knowledge Processing Network
Let’s see how to handle an incoming Forex financial news:


”The safe-haven yen and Swiss franc were higher, with USD/JPY sliding 0.41% to 112.01, just off the previous session's two-month peak of 112.72, while USD/CHF fell 0.21% to trade at 0.9687.Elsewhere, EUR/USD gained 0.20% to trade at 1.1965, while GBP/USD edged down 0.10% to 1.3569, off Monday's 15-month highs of 1.3620.”


Checked the sentences of this news, we found these keywords and phrases:
  • number and percentage
  • USD/JPY, USD/CHF, EUR/USD, GBP/USD
  • and, higher, sliding to, off peak of, fell to, gained to, edged down to, off highs of
figure 7: Financial knowledge stickers structure


Therefore, we should build various KPUs to handle numbers, symbols of Forex instruments and phrases of their movements. The first layer of KPUs handles words, the second layer of KPUs combines words to phrases and the last layers of KPUs processes the meaning of the sentences.


When a KPU finds the price of an forex instrument in the sentence, it should store this last price, change and date in memory and then computes all technical analysis indicators like Moving Average, Variance, RSI, MACD, Bollinger Band indicator,.. etc. Also, the KPUs can process correlation coefficients between various financial instruments.


The KPUs in charge of Robo-Advisor strategies should check the movements of the financial instruments to see how will they affect others and how much. Based on these predictions the final judgement of buying or selling financial instruments will be generated.

Also, the following rules should be defined:
- If the instrument A is up or down, then we should buy or sell what financial instruments and how many?
- What are mean-variances of all financial instruments?
- What are buying and selling points of all financial instruments?
- What is the optimal leverage ratio?

  1. Financial Calculation Algorithms
Basic financial calculation algorithms like what I’ve implemented in the wealth management calculators website CubicPower.idv.tw [4] covering various aspects should also be included. Such as:



Time Value of Money:



Compounding
Discounting



Money generates interest in a saving account. So the money of the present time will be worth more than the same amount of money in the future. To interchange the values of two periods, compounding is used to convert present value to the future value of money and discounting is to convert the future money to present value.



Assets Allocation:

Capital Allocation Line(CAL)
Asset Allocation with Stocks and Bonds
Asset Allocation with Minimum Variance
Asset Allocation Optimal Risky Portfolio
Expected Return Scenario Analysis

figure 8: Risk and return of three asset classes combination



We can use the above tools to calculate the risks and rewards of different combination ratios of three asset classes - equities, fixed income and cash equivalents. A Robo-Advisor is in charge of portfolio management of these assets. The idea of efficient frontier should also be built into it.



Annuity:


Annuity Future Value
Annuity Present Value
Period Investment
PVOA
Investment Return Rate


An annuity is a group of fixed amount of  cash flows within a period of time.  We can discount each individual flow into its present value and add them up to get the present value of the annuity. This is the  way to evaluate the annuity. We can calculate the present and future values of the annuity easily with these tools.


Stocks/Bonds:


Stock Evaluation Dividend Discounting
Current Bond Price
Coupon Bond Price
Coupon Bond Yield
Zero Coupon Bond Price
Bondholders receive a fixed amount of interest in every period. Therefore, bond prices will change when interest rates changed. When the interest rate goes down, bonds become more valuable, so their prices will go up.



Futures/Options:

Stock Index Futures Hedge
Futures Long Hedge
Futures Short Hedge
European Stock Options
European Future Options



  1. Steps to Design Our Robot Advisor
  • Structure Knowledge Stickers
We have to organize above mentioned financial knowledge to build a sticker structure. Lowest   layer keeps keywords, the middle layer keeps phrases, and the top layer keeps sentences of algorithms.


  • Process incoming messages
Incoming messages will be detected by the lowest layer sticks and trigger top-level algorithms eventually.


  • Perform Periodical back tasks
We also need to do periodical tasks such as rebalancing.



Conclusion


In this paper, we've proposed a different approach to build robo-advisors. The main idea of this approach is to keep the human structure knowledge in the ‘brain’ of a robo-advisor. We also hope that it will learn more knowledge while processing incoming messages and become smarter.
      
References:



  1. Chao-Yih Hsia,“Replicate Brain Knowledge Sticker Model to Build the Fintech AI Tower”,2017 The Storm Media http://www.storm.mg/article/289062
  2. Miller, G. A. (1956). "The magical number seven, plus or minus two: Some limits on our capacity for processing information". Psychological Review.
  3. Chao-Yih Hsia,”CubicPower Money Management”. http://www.cubicpower.idv.tw

沒有留言:

張貼留言