Chapter 6 — Hybrid Applications
6.2. Design and Implementation of the Profit Trend Analysis Application
application was used to test the operation o f the ORBERON environment. Secondly, the design and implementation details o f a real-world Cargo Consignment problem from British Airways is examined. The results o f this hybrid Cargo Consignment application are also detailed.
6.1. Introduction
To demonstrate the effectiveness of object-oriented integration and of adopting a hybrid approach, two real-world applications have been implemented using the Or ber o n
environment. The first was a small proof of concept application in the financial domain of Profit Trend analysis and the second, was a large real-world application from British Airways, for Cargo Consignment.
6.2. Design and Implementation of the Profit Trend Analysis
Application
The aim of the profit trend analysis hybrid application was to aid investment analysts in deciding whether to increase, decrease, or maintain investment interest in a particular company. This was achieved by analysing the trends in the company’s past performance and in the personal profit for an investor in that company. The application was designed to monitor investment of an initial sum and advise on the best course of action depending on the current risk involved with this investment. The decision process is based on a simple risk scoring system [12], that calculates levels of risk according to pre defined factors such as those identified by an expert, and the analysis by two neural networks of the movement trends in personal profit for the previous two weeks and the company’s quarterly share index.
Chapter 6 Hybrid Applications 86
The decision support and analysis sub-systems were implemented via a CLIPS expert system rulebase. Appendix C gives the full listing of the Profit Trend Analysis application rulebase. The rulebase consists of approximately 60 rules to analyse the results of the two neural networks that were used to classify movement trends (increasing, decreasing or remaining stable) for personal profit over the previous 10 working days and the company’s share indices for the last quarter. This pattern recognition task is particularly difficult with conventional symbolic methods due to the erratic movements of shares and profits. Within the application, the expert system provided the control and high level decision making on the low level pattern classification provided by the back- propagation networks.
Figure 6.1 shows the operation of the Profit Analysis application, where the main expert system (long window on the right) was used as the main point of user interaction and application control. When the application rulebase is loaded into the expert system, it automatically starts the Profit Trend Analysis (PTA) and Quarterly Share Index (QSI) neural networks.
Ijletero^eneoujÈnvj^^
I II e“i<
Pniflt Trend Awalyrit Window
f Neural Network Shell
f
Expert S ystem S w U Editor (vi) PTA P R O F I T T R E N D A N A L A Y S I S C O N S U L T A T I O N SYSTEM INTERROGATE T Æ NETWORK network fro* ffwther Paredig* INTERROGATION IfWT - fro* th# another Peredlpi[ 0.400000 0.500000 0 500000 0.300000 0.200000 0.400000 0.800000 0.400000 0.300000 0.14000 INTERROGATION OUTPUT - TO another Paradip»
C 0.014504 I
INTERROGATE TNE « T M R K Interrelating network fro* Another Paradig* INTERROGATION IlfUT - fro* the another Paradigm
( 0.400000 0.600000 0,700000 0.600000 0.800000 0.300000 0.200000 0.300000 0.600000 0.60000 INTERROGATION OUTPUT - TO another Paradipa
[ 0.074576 I
II INITIAL SUM INVESTED I % 246.00 I NUMKR OF SHARES INVESTED IN I 100 I YESTERDAYS SHARE PRICE I $ 2.46 I TOTAL PROFIT TO DATE I S 0.00 I □ÜRENT RISK LEVEL I 1.00 I
:n te r th e D.^ ( le Hon, Tue Hod e tc > ; Non Enter th e Month (J a r Feb Mar e tc ) : Sop
Enter the CIo»ln9 P rice fo r th e Invested Company : 2.60 Enter th e Loss Limit fo r your Investment : 50 » > = » > In terro g atln y Neural Network to obtain P ro fit » > = » > Trend fo r th e l e s t two weeks ...
'arsenal P r o f it Trend Is Decreasing
» = » > Interro g atin g Neural Network to obtain Share » > = » > Index Trend fo r the l a s t q u a r t e r ... k a r t l y Share Index i s Decreasing
R£c0mMM«™hS
TOTAL PROFIT TO DATE = S 14.00 CURRENT RISK LEVEL = 1.25 *e From th e Information Supplied and the ourrent ** tren d In p r o f it movement. I t would be •e rec ommended th a t you m aintain th e c u rren t
level of Investment.
Do you want to continue with the c o n s u lta tio n (ip'n)
Chapter 6____________________________ Hybrid Applications___________________________________ ^
These neural networks are pre-trained to classify the direction of movement of trends and are opened as icons, which means that they are used in the background as black box processing elements. These iconised windows have been opened (shown on the left) in Figure 6.1 to show the communication which occurs between controlling expert system and the neural networks.
The flow of control and operation of the application begins by initialising and displaying the default setting for the initial sum of money available for investment, the number of shares brought, yesterdays share price, total profit to date and the current risk level in the investment. The system then prompts for the day (Monday, Tuesday etc.) and the month. This information is important because there is inherent risk on certain days of the week (e.g. Monday or Friday) and in certain months (e.g. January or December) due to the fluctuation in stock prices at the opening and closing of markets. The system then prompts for the closing share price of the company and the loss limit (the amount that you are prepared to lose from your investment).
The system then processes this information and interrogates firstly, the PTA neural network with the previous two weeks data concerning profits from trades (an initial set of previous two weeks data is set up at the start). Secondly, the QSI neural network is interrogated with the last quarter’s share index for the company.
The PTA and QSI networks were trained with different patterns that represented different movement trends. Figure 6.2 represents the training data for the PTA and QSI. Both the networks have been trained to output values between 0 and 1. These values represent whether the general trend of the input pattern is decreasing, denoted by values close to zero, remaining stable denoted by values around 0.5 and increasing denoted by values close to one.
Once the networks have been interrogated their trend values are returned to the expert system which then performs some post-processing to interpret the numeric values into linguistic categories (decreasing, stable or decreasing). This post processing is important because it allows the expert system to represent numeric information from neural networks in a form that can be understood and incorporated into the explicit rules of the expert system (i.e. via a fact). The results of both interrogations are shown on main system window.
The system then calculates the current risk, using factors such as the current profit trend, yesterdays profit trend, the current share index trend, the loss limit, today’s profit, the day and the current month. Depending on this calculated risk and the accumulated total profit the system evaluates the position that the investor should take, that is, whether the
Chapter 6 Hybrid Applications 88
investor should increase, maintain, be cautious or withdraw his investment (and other variations of these). The system then displays the total profit to date and the current risk level. This is followed by some text recommending that the investor adopt the position which was calculated using the current risk and profit.
N eural Network T raining D ata for D e c re a sin g Profit T re n d s
N eural Network Training D a ta for D e cre a sin g Quarterly S h are Index T ren d s
0.8 -0.2 - 0 4 -0.6 -0.8 -0.2 -0.4 -0.6 0.8 0.6 0 . 4 0.2 0 -02 -0 . 4 -0.6 -08
N eural Network D ata for S ta b le Profit T ren d s
T 8---- g— TO
N eural Network Training D ata for S tab le Q uarterly S h a re Index
T ren d s 0.8 0.6 04 0.2 0 -0.2 -0 . 4 -0.6 -0.8 2 3 4 5 6 7 9 1 0 11 1 2
N eural Network T raining D ata For In creasin g Q uarterly S h a re Index N eural Training D ata for
In creasin g Profit T re n d s 0.2 1---- 40 -0.2 -0 . 4 -0.6 -0.8 -0.2 -0.4 -0.6
Chapter 6____________________________ Hybrid Applications___________________________________ ^
If this system was to be used in a real-world scenario then all the required inputs could be automated, the day and month could be retrieved from the host system, the closing price from a data feed and the loss limit calculated as a proportion of the profit to date. This would allow the system to be active and available for interrogation by an investment analyst. An important point about this relatively simple application is the fact that the domain expert who was consulted when constructing the knowledge base, had attempted (about five years ago) to construct a real-world version of this application with purely an expert system approach and had failed due to the difficulty in performing the pattern classification tasks via an expert system.
The object-oriented interface and communication methods of the Or b e r o n
environment, performed efficiently during the implementation of this proof of concept application. This application served its purpose by vahdating the flexibility and extendibihty of the Or b e r o n environment and showing that it allows the design,
communication and execution requirements for building hybrid systems.