MME09-LukasL Fullpaper
MME09-LukasL Fullpaper
MME09-LukasL Fullpaper
Abstract
Paper presents graphical and encryption algorithms implemented to visual recurrence analysis of
simulated FX rate. The simulation models constructed by CA technique provide versatile
generators of time series, which are further processed by VRA algorithms. The proposed
procedure implements various measures of time series variations to build VRA specific color
images. Public available encryption algorithm is applied on VRA images in order to enable their
safe transfer via electronic networks. The paper is focused on algorithmic and numerical aspects of
elaborated VRA of simulated FX rate time series.
Keywords
Foreign exchange rate, visual recurrence analysis, numerical simulation, graphical algotithms.
JEL: C15, C51, C63, G15.
1 Introduction
The foreign exchange (FX) money markets attract lasting interest of both academic and applied
finance families. Standard analysis of FX rate examines economic fundamentals to explain FX rate
movements, but, in many cases, the fundamentals-based models fail to explain the past adequately, or
predict the future reliably. On the contrary, a lot of FX money market practitioners apply various
forms of technical analyses either in short or longer period quite successfully. There is well-known
that technical trend signals can affect traders and price behaviour, generating excess market reactions
without any fundamental reason. Hence, the instant processing of market messages plays specific role,
thus leading to permanent interactions among traders. Since an empirical evidence of trading volumes
in spot FX money markets shows that the overwhelming part of the turnover is merely due to short-
term speculative trading transactions, one usually accepts neglecting of volumes due to an
international trade transactions.
Following the classical ideas, there are typical two kinds of traders applying different trading rules
based upon either technical analyses or fundamental ones. The technical analysis concerns with
identifications of both trends and trend reverses using more or less sofisticated procedures to predict
future price movements from those of the recent past. The fundamental analysis searches and looks for
various reasons and/or events thus explaining market actions in order to set up future expectations.
Basically, these two different concepts are used for building various problem-oriented computer-
based agent interaction models. The basic idea of such models is rather simple - in mathematical form
to allow a self-development of FX money market under driving forces caused by interactions among
computer agents which are designed to model traders’, i.e. chartists’ and fundamentalists’, behaviour.
Since these models are formulated in abstract forms, their main issues are usually, rather than
prediction of actual foreign exchange market movements, studying complex dynamic effects on the
base of non-linear simulation models, and investigation of possible quantitative and/or qualitative
responses upon various modes of control.
1
For more details, the interested readers are referred to the book [1] as regards the financial market
theory, and to the papers [2]-[5],[9],[10] as to both various aspects of technical and fundamental
analyses and influences of central bank, in particular. The paper [6] gives the motivation and details of
color image encryption. Finally, the papers [7],[8] present the author’s contributions to the topic.
The paper is composed in following way. In Section 2 we briefly summarize dynamic equilibrium FX
rate simulation models with special attention to modelling CB’s influences. In Section 3 we provide
details of generalization VRA (Visual Recurrence Analysis) procedure, which will enable more
detailed and flexible detection and investigation of patters hidden in FX rate time series. In Section 4,
there are given some details regarding encryption schemes of VRA images. The final Section gives
conclusions and topics of further research.
The demands dC(t), dF(t), dB(t) are formulated in particular as a mix of systematic and unsystematic
components as follows
d C(t) = aC,1ϕ (.) + aC,2ω (.), (2)
where aC,1, aC,2 > 0 represent corresponding reaction coefficients levering both modes. The general
form is
d C(t) = aC,1( ∑(i) α i log(S(t-i)/S(t-i-1)) ) + aC,2δ (t-1),
(3)
where δ (t-1) ~ N(0,σ C2) is a typical noise with zero mean and time invariant finite variance σ C2,
index i identifies truncated history of past rates {S(t-i), i = 1,...,nC+1}, with nC given.
The demand excess of fundamentalists dF(t) within the period t is
dF(t) = aF,1( EFt [S(t+1)] - S(t)) / S(t), (4)
where E t [S(t+1)] expresses the expected future FX rate made by fundamentalist agent at t, and a > 0
F F,1
is reaction coefficient coping with relative distance between expected future FX rate and the spot rate.
Rather general way of forming that expectation, sometimes called an anchoring heuristics, is following
E Ft [S(t+1)] = γ SF(t-1) + (1-γ ) (∑(j) βj S(t-j)),
(5) where βj ≥ 0 are weights of S(t-j), j = 1,...,nF , such that ∑(j) βj = 1, with nF given, and SF(t-1) denotes
the last fundamental value. Development of SF(t) is quite natural to assume that due to rate-related
news it behaves like a discrete random walk
logSF(t) = logSF(t-1) + aF,2ε (t), (6)
where a is coefficient representing probability of news shock hitting FX money market, 0 < aF,2 < 1,
F,2
and ε (t) ~ N(0,σ F2) is a typical noise with zero mean and time invariant finite variance σ F2, again.
2
r(t) = (SF(t-1) - S(t-1))/S(t-1). (9)
Hence, m(t) can be calculated form set of past observations {S(t-i), SF(t-j), i, j = 1,...} known.
Finally, the dB(t) may be expressed as convex combination of both basic CB strategies, i.e reversing
and targeting one
dB(t) = η dB,1(t) + (1- η) dB,2(t), (10)
where η gives a leverage between both intervention strategies, η∈[0,1] given. It holds for reversing
strategy
dB,1(t) = aB,1 (logS(t-2) - logS(t-1)),
whereas for targeting strategy
dB,2(t) = aB,2 (SF(t-1) - S(t-1))/S(t-1) = aB,2 r(t),
B,1 B,2
with a , a > 0, given reaction coefficients of the corresponding strategies.
Substituting all given expressions dC(t), dF(t), dB(t) into (1) and solving for S(t) we get
S(t) = EFt [S(t+1)]/{1-(m(t) dC(t) + dB(t))/(aF,1(1 - m(t)))}, (11)
which is the desired dynamic stochastic simulation model of FX rate respecting various CB’s
influence effects, and also a time series generator for next VRA procedure and numerical experiments.
3. Expand an 1-d time series sample {xi}, i = 0,...,K into a 2-d image I(RGB).
Well known motivating idea of VRA is to convert numerical values into some graphical
information. In particular, it creates a color of each image pixel (i,j), i,j = 0,…, K in
correspondence with numerical values of a couple (xi,xj).
3
Let M denote a mapping generating the RGB image I(RGB)
M : (xi,xj) → c(i,j), i,j = 0,...,K (12)
where c(i,j) denotes RGB color of pixel (i,j).
Traditional approach – a color c(i,j) is represented by 24 bits, with 8 bits for each RGB color,
and it is set c(i,j) ~ |xi – xj| using selected color palette (with 2563 = 16 777 216 different colors, in
general) and a proper time series state space discretization.
Proposed approach – a color c(i,j) is tackled as 3-d vector c(i,j) = (r(i,j), g(i,j), b(i,j))T, with RGB
color components denoted r(i,j), g(i,j), b(i,j) ranging [0,255], respectively, i.e. with 256 different
levels each. Such individual acceptance of basic color components gives us larger flexibility to
express and investigate various relations between selected cue values xi, xj. However in such case,
the finest discretization is restricted to 256 levels, which is much coarser than about 16 million of
ones provided by traditional approach, but we hope it is still acceptable for various VRA
applications in finance.
Let us introduce three color mapping functions
r(i,j) = φ(xi, xj) , g(i,j) = χ(xi, xj), b(i,j) = ψ(xi, xj), (13)
hence, we able to define a 3-d mapping M as follows
M : (xi,xj) → c(i,j) = (φ(xi,xj), χ(xi, xj), ψ(xi, xj))T, i,j = 0,...,K. (14)
There is evident we may either build any permutation of RGB color components, and/or to
combine any different distances in order to construct a new suitable mapping M.
Note, another interesting possibility will occur if we substitute local values xi and xj by some local
averages at xi and xj, but that topic will not be discuss in this paper.
Concluding, an advantage of the proposed approach is evident – it provides a lot of various ways how
to define a color c(i,j) at the pixel (i,j), and how to produce an image I(RGB), since any RGB color
component may represent either the first or the second cue value of the time series, i.e. xi, xj, their
average (xi+xj)/2, an absolute distance |xi – xj|, an Euclidean distance ((xi)2+(xj)2)1/2, etc. Such flexibility
gives a new opportunity to use VRA for deeper understanding of time series.
4 Encryption scheme
Motivation for image encryption stems from fact that generated VRA images, in particular, such ones
containing CB’s influences upon FX rate, may be declared confidential. Hence, cryptographic
solutions should be used to ensure privacy and confidentiality when such VRA images are to be
transmitted over un-trusted or public networks.
We adopt the encryption scheme proposed in the paper [6] to produce VRA image encryption,
which is well-adapted for implementation and cost-effective. The basic idea of this encryption scheme
stems from well-known principles of human perception of color images.
Any pixel color image I(RGB), e.g. VRA image, is given by pixel mapping π: (Z+)2 → (Z+)3
π: (i,j) → c(i,j) = (r(i,j), g(i,j), b(i,j))T , i,j = 0,..,K.
4
Hence, we may summarize the encryption/decryption procedure as follows:
1. Extract magnitude and orientation of color vector c(i,j) at the pixel (i,j), which correspond to
luminance and chromaticity in human perception of colors, respectively –
Luminance ~ color vector magnitude is given by
G(i,j) = ║c(i,j)║ = ((r(i,j))2 + (g(i,j))2 + (b(i,j))2)1/2 , (15)
2. Extract bit-level components in order to alter both luminance and chromaticity simultaneously –
Let redefine the color vector c(i,j) = (r(i,j), g(i,j), b(i,j)) component-wise
c(i,j) = (r(i,j), g(i,j), b(i,j)) = (c1(i,j), c2(i,j), c3(i,j)), each cn(i,j), n = 1,2,3 ranges [0, 255],
we may express the bit-level representation of pixel color as follows
B
c(i,j) ~ ∑ b
c(i,j) (2)B-b (17)
b=1
where
b
c(i,j) = (bc1(i,j), bc2(i,j), bc3(i,j)) = (br(i,j), bg(i,j), bb(i,j)) ∈ {0,1} ,
3
is a b-th bit-level binary vector composed from corresponding RGB bit-level components bcn(i,j),
n = 1,2,3, b = 1,..,B , taking B = 8, as usual in 24-bit color representation.
5 Conclusions
1. Various FX rate stochastic simulation models were presented. The dynamic money market clearing
conditions were used for derivation of such models and special focused upon modelling of CB’s
influence.
2. Generalization of VRA procedure was proposed. There were discussed various possibilities how to
construct color mapping functions more suitable for subtle investigation of a time series sample. We
hope the proposed variety of functions gives more flexibility for deeper understanding of correlations
patterns hidden in time series.
3. Encryption scheme applied to VRA images in particular was given in details. Such procedure is to
provide safe transmit of case sensitive VRA images over public network.
5
Work on progress and field of further research
a. Development of sw package implementing VRA with encryption on the Java 2D platform
implementing the java.ai purpose-oriented package for advanced image processing.
b. Identification and calibration of model constitutive parameters included in presented FX rate
models using various estimation procedures. Accumulate and evaluate empirical evidence of
real FX rate time series.
c. Further development of VRA procedure, which represents an interesting and challenging
instrument for both detection and investigation of various patterns caused by endogenous
nonlinear effects already observed and reported in the field of time-dependent FX rate
development.
Acknowledgement: This research work was supported both by the grant No. 402/09/1536 of the
Grant Agency of Czech Republic and by funds of the project LC06075 of the Ministry of
Education of Czech Republic.
References
[1] Blake, D.: Financial Market Analysis. (Analýza finančních trhů), Grada
Publishing, Praha, 1995
[2] Fiess, N.M. – MacDonald, R.: Towards the fundamentals of technical analysis:
analysing the information content of High, Low and Close prices. Economic
Modelling, 19 (2002), 353-374
[3] LeBaron B.: Technical trading rule profitability and foreign exchange
intervention. J.Int. Economics, 49 (1999), 125-143
[4] LeBaron B.: Agent-based computational finance: Suggested readings and early
research. J.Econ. Dynamics and Control, 24 (2000), 679-7002
[5] Lui, Y.H. – Mole, D.: The use of fundamental and technical analyses by foreign
exchange dealers: Hong Kong evidence. J.Int. Money and Finance, 17 (1998), 535-
545
[6] Lukac, R. – Plataniotis, K.N.: A cost-effectie encryption scheme for color images. Real-
Time Imaging 11 (2005) 454-464, Elsevier
[7] Lukáš, L.: Market clearing conditions used in FX rate simulation models.
Proceedings 22-th Int.Conf. Mathematical Methods in Economics, Masaryk
University Brno, 2004, ISBN 80-210-3496-3, 184-188
[8] Lukáš, L.: Variety of Agent-based Models for Computer Simulation of FX Rate. 9-
th Annual Conf. Computing in Economics and Finance, July 11-13, 2003, Seattle,
Washington, USA
[9] Saacke, P.: Technical analysis and the effectiveness of central bank intervention.
J.Int. Money and Finance, 21 (2002), 459-479
[10] Westerhoff, F.H.: Central bank intervention and feedback traders. Int. Fin.
Markets, Inst. and Money, 13 (2003), 419-427