You are on page 1of 6

Time series te

hni al analysis via new fast


estimation methods: a preliminary study in
mathemati al nan e

arXiv:0811.1561v2 [stat.AP] 16 Nov 2008

Mi hel FLIESS ,

Cdri JOIN ,

INRIA-ALIEN
LIX (CNRS, UMR 7161), ole polyte hnique
91128 Palaiseau, Fran e
Mi hel.Fliesspolyte hnique.edu

CRAN (CNRS, UMR 7039), Nan y-Universit


BP 239, 54506 Vanduvre-ls-Nan y, Fran e
Cedri .Join ran.uhp-nan y.fr

Abstra t: New fast estimation methods stemming from ontrol theory lead to a fresh look at
time series, whi h bears some resemblan e to te hni al analysis. The results are applied to
a typi al obje t of nan ial engineering, namely the fore ast of foreign ex hange rates, via a
model-free setting,

i.e., via repeated identi ations of low order linear dieren e equations on

sliding short time windows. Several onvin ing omputer simulations, in luding the predi tion
of the position and of the volatility with respe t to the fore asted trendline, are provided.

Z-

transform and dierential algebra are the main mathemati al tools.

Keywords:

Time series, identi ation, estimation, trends, noises, model-free fore asting,

mathemati al nan e, te hni al analysis, heteros edasti ity, volatility, foreign ex hange rates,
linear dieren e equations,

Z -transform,

algebra.

analysis,

1. INTRODUCTION

or

harting

(see,

e.g.,

(Aronson, 2007; B hu,

Bertrand & Nebenzahl, 2008; Kaufman, 2005; Kirkpatri k

1.1 Motivations

& Dahlquist, 2006; Murphy, 1999) and the referen es

Re ent advan es in estimation and identi ation (see,

therein), whi h is widely used among traders and nan ial


1
professionals.

2004; Fliess, Join & Sira-Ramrez, 2004; Fliess & Sira-

1.2 Linear dieren e equations

e.g., (Fliess & Sira-Ramrez, 2003; Fliess & Sira-Ramrez,

Ramrez, 2008; Fliess, Join & Sira-Ramrez, 2008) and the


referen es therein) stemming from mathemati al ontrol
theory may be summarized by the two following fa ts:

Their algebrai nature permits to derive exa t nonasymptoti formulae for obtaining the unknown quantities in real time.

There is no need to know the statisti al properties of


the orrupting noises.

Those te hniques have already been applied in many


on rete situations, in luding signal pro essing (see the

Consider the univariate time series

familiar ARMA and ARIMA models but is supposed to


satisfy approximatively a linear dieren e equation

where

x(t) = xtrendline(t) + (t)


xtrendline(t)

Fu hshumer, S hberl, S hla her & Sira-Ramrez, 2008)

and ontrol theory is well do umented (see,

e.g.,

to the existing literature.

Remark 1.2.

The title of this ommuni ation is due to

its obvious onne tion with some aspe ts of

te hni al

is the

trendline 2

whi h satises Eq. (1)

the additive noise

(t) is

the mismat h between the

Thus

x(t + n) a1 x(t + n 1) an x(t) = (t)

(3)

where

Hamilton, 1994) and the referen es therein). Our viewpoint seems nevertheless to be quite new when ompared

(2)

real data and the trendline.

(Box,

Jenkins & Reinsel, 1994; Gouriroux & Monfort, 1995;

signal

exa tly;

has prompted us to study their relevan e to nan ial time


The relationship between time series analysis

(1)

where

extension to dis rete-time linear ontrol systems (Fliess,

Remark 1.1.

x(t + n) a1 x(t + n 1) an x(t) = 0


a1 , . . . , an R. Introdu e as in digital

pro essing the additive de omposition

referen es in (Fliess, 2008)). Their re ent and su essful

series.

{x(t) | t N}: x(t)

is not regarded here as a sto hasti pro ess like in the

(t) = (t + n) a1 (t + n 1) an (t)

(4)

Te hni al analysis is often severely riti ized in the a ademi


world and among the pra titioners of mathemati al nan e (see, e.g.,
(Paulos, 2003)).
2 Compare, e.g., with (Durlauf & Philips, 1988).
1

We only assume that the ergodi mean of

(t)

is

0,

i.e.,

(0) + (1) + + (N )
=0
(5)
N +1
It means that, t N, the moving average
(t) + (t + 1) + + (t + N )
(6)
MA,N (t) =
N +1
is lose to 0 if N is large enough. It follows from Eq. (4)
that (t) also satises the properties (5) and (6). Most of
lim

N +

the sto hasti pro esses, like nite linear ombinations of


i.i.d. zero-mean pro esses, whi h are asso iated to time

2. PARAMETER IDENTIFICATION

2.1 Rational generating fun tions


satises

z n [X x(0) x(1)z 1 x(n 1)z (n1) ]


an1 z[X x(0)] an X = 0

(7)

e.g., (Doets h, 1967; Jury, 1964))

It shows that
of

x,

X,

whi h is alled the

series modeling, do satisfy almost surely su h a weak

does not make any dieren e between non-stationary

in lude the seasonalities, if they exist).

1.3 A model-free setting

(8)

P (z) = b0 z n1 + b1 z n2 + + bn1 R[z]


Q(z) = z n an1 z an R[z]

does not need the often tedious and umbersome


trend and seasonality de omposition (our trendlines

generating fun tion

z , i.e., X R(z):
P (z)
X=
Q(z)

where

and stationary time series,

of

is a rational fun tion of

assumption. Our analysis

Z -transform X

Consider again Eq. (1). The


(see,

Hen e

Proposition 2.1. x(t), t 0,

satises a linear dieren e

equation (1) if, and only if, its generating fun tion

is a

rational fun tion.


It should be lear that

a on rete time series annot be well approximated


in general by a solution of a parsimonious Eq. (1),

i.e., a linear dieren e equation of low order;

the use of large order linear dieren e equations, or

Remark 2.2.

tational burden for their identi ations without any


lear- ut fore asting benet.

(Fliess & Join, 2008) where the ontrol of  omplex systems is a hieved without trying a global identi ation but
thanks to elementary models whi h are only valid during
3
a short time interval and are ontinuously updated.
We
4
utilize here low order dieren e equations.
Then the
window size for the moving average (6) does not need to

to

Consider the inhomogeneous linear dieren e

equation

of nonlinear ones, might lead to a formidable ompu-

We adopt therefore the quite promising viewpoint of

P and Q permits
x(0), . . . , x(n 1).

It is obvious that the knowledge of


determine the initial onditions

x(tX
+ n) a1 x(t +
n 1) an x(t)
X
t
=
(t) +
(t) sin(t + )
nite

nite

(t), (t) R[t], , , R. Then the Z transform X R(z) of x(t) is again rational. It is equivalent saying that x(t), t 0, still satises a homogeneous
where

dieren e equation.

2.2 Parameter identiability

be large.

Generalities

1.4 Content

K = Q (a1 , . . . , an , b0 , . . . , bn1 )
be the eld generated over the eld Q of rational numbers by a1 , . . . , an , b0 , . . . , bn1 , whi h are onsidered as

Se t. 2, whi h onsiders the identiability of unknown


parameters, extends to the dis rete-time ase a result in
(Fliess, 2008). The onvin ing omputer simulations in

Let

unknown parameters and therefore in our algebrai setting


as independent indeterminates (Fliess & Sira-Ramrez,

Se t. 3 are based on the ex hange rates between US Dollars

2003; Fliess, Join & Sira-Ramrez, 2004; Fliess & Sira-

and

Ramrez, 2008). Write

uros. Besides fore asting the trendline, we predi t

the position of the future rate w.r.t. the fore asted


trendline,

the standard deviation w.r.t. the fore asted trendline.

Those results might lead to a new understanding of volatil5


Se t. 4 on ludes with a short
ity and risk management.
dis ussion on the notion of

trend.

See the numerous examples and the referen es in (Fliess & Join,
2008) for on rete illustrations.
4 Compare with (Markovsky, Willems, van Huel, de Moor &
Pintelon, 2005).
5 See (Taleb, 1997) for a riti al appraisal of the existing literature
on this subje t, whi h is of utmost importan e in nan ial engineering. (Extreme) risks are dis ussed in (Bou haud & Potters, 1997; Da orogna, Genay, Mller, Olsen & Pi tet, 2001; Mandelbrot & Hudson, 2004; Sornette, 2003) from quite dierent perspe tives. It is the
trendline whi h would exhibit abrupt hanges in our setting ( ompare
with the probabilisti standpoint; see, e.g., (Wilmott, 2006) and the
3

the algebrai losure of

(see,

,
e.g., (Lang, 2002; Chambert-Loir, 2005)). Then X K(z)

i.e., X is a rational fun tion over K . Moreover K(z)


is a
dierential eld (see, e.g., (Chambert-Loir, 2005)) with
d
respe t to the derivation
dz . Its subeld of onstants is
the algebrai ally losed eld

.
K

Introdu e the square Wronskian matrix M of order 2n + 1


th
(Chambert-Loir, 2005) where its -row, 0 2n, is

d n
d
d
d
z X, . . . , X, z n1 , . . . , 1
(9)

dz
dz
dz
dz
It follows from Eq. (7) that the rank of M is 2n if, and
only if, x does not satisfy a linear dieren e relation of
order stri tly less than n. Hen e
referen es therein). Our estimation te hniques permit an e ient
hange-point dete tion (Mboup, Join & Fliess, 2008), whi h needs
to be extended, if possible, to some kind of fore asting.

Theorem 2.3.

If

does not satisfy a linear dieren e

n, then
a1 , . . . , an , b0 , . . . , bn1

equation of order stri tly less than

are

the parameters
1.8

linearly identiable. 6

1.7
1.6

Identiability of the dynami s


nami s, i.e., a1 , . . . , an , without

For identifying the dy-

1.5

having to determine the

1.4

(n + 1) (n + 1) Wronskian
0 n + 1, is
dn+ n
dn+
z X, . . . , n+ X
n+
dz
dz
by taking the X -dependent entries in the

initial onditions onsider the


th
matrix N , where its -row,

It is obtained

n+1

last rows of type (9),

i.e., in disregarding the entries

depending on b0 , . . . , bn1 . The rank of

Corollary 2.4. a1 , . . . , an

is again

n. Hen e

1.2
1.1
1.0
0.9
0.8
0

are linearly identiable.

500

1000

1500

2000

2500

Samples

Identiability of the numerator

Assume now that the

dynami s is known but not the numerator

in Eq. (8).

b0 , . . . , bn1 from the rst n rows (9). Hen e


2.5. b0, . . . , bn1 are linearly identiable.

We obtain

Corollary

1.3

Figure 1. Ex hange rates (blue ), ltered signal (bla k -), fore asted signal (5 days ahead) (red )

2.3 Some hints on the omputer implementation


We pro eed as in (Fliess & Sira-Ramrez, 2003; Fliess &
Sira-Ramrez, 2008) and in (Fliess, Fu hshumer, S hberl,
S hla her & Sira-Ramrez, 2008). The unknown linearly

identiable parameters are solutions of a matrix linear


equation, the oe ients of whi h depend on
us emphasize that we substitute to

x.

Let

its ltered value

thanks to a dis rete-time version of (Mboup, Join &


7
Fliess, 2009).

3. EXAMPLE: FORECASTING 5 DAYS AHEAD THE


$ -

 EXCHANGE RATES

3
0

500

1000

1500

2000

2500

Samples

We are utilizing data from the European Central Bank,


depi ted by the blue lines in the Figures 1 and 2, whi h
summarize the

2400 last daily

US Dollars and the

uros. 8

ex hange rates between the

a1 (red .),
days ahead)

Figure 3. Parameter estimations

and

a3

(bla k

) (5

a2

(blue

3.2 Above or under the predi ted trendline?

3.1 Fore asting the trendline

Consider again the error

In order to fore ast the ex hange rate

average MA,N (t) in Eq. (6). Fore asting MA,N (t) as in


Se t. 3.1 tells us an expe ted position with respe t to the

days ahead we

apply the rules sket hed in Se t. 2.3 and we utilize a linear


dieren e equation (1) of order

3 (the ltered values of the

ex hange rates are given by the bla k lines in the Figures 1,


2). Fig. 3 provides the estimated values of the oe ients
of the dieren e equation. The results on the fore asted
values of the ex hange rates are depi ted by the red lines in
the Figures 1 and 2, whi h should be viewed as a predi ted
trendline.
6 It means following the terminology of (Fliess & Sira-Ramrez,
2003; Fliess & Sira-Ramrez, 2008) that a1 , . . . , an , b0 , . . . , bn1
are uniquely determined by a system
of 2n linear equations, the
d
d
m
oe ients of whi h depend on dz
X and dz z , 0 m n 1.
7 See, e.g., (Genay, Seluk & Hafner, 2002) for an ex ellent presentation of various ltering te hniques in e onomi s and nan e.
8 The authors are perfe tly aware that only omputations dealing
with high frequen y data might be of pra ti al value. This type of
results will be presented elsewhere.

(t)

in Eq. (2) and its moving

fore asted trendline. The blue line of Fig. 4 displays the


result for the window size

N = 100.

indi ators and is lear.

The meaning of the

Table 1 ompares for various window sizes the signs of the


predi ted values of MA,N (t), whi h tells us if one should
expe t to be above or under the trendline, with the true
positions of

x(t)

with respe t to the trendline. The results

are expressed via per entages.

3.3 Predi ted volatility w.r.t. the trendline


Introdu e the

moving standard deviation

MSTD
,N (t) =
s
PN
=0

((t + ) MA,N (t N + ))2


N +1

1.35
1.30
1.25
1.20
1.15
1.10
1.05
1.00
1050

1100

1150

1200

1250

1300

1350

1400

1450

Samples
Figure 2. Zoom of Figure 1

Conden e intervals
mean-3std,mean+3std
mean-2std,mean+2std
mean-std,mean+std

0.03

Predi tion

Real

99%
95%
68%

98.7%
92.2%
64.4%

Table 2. Conden e interval validations (5 days

0.02

ahead)
0.01

0.00
0.20
0.01

0.15
0.10

0.02

0.05
0.03
0

500

1000

1500

2000

2500

Samples

Figure 4. Predi ted position w.r.t. the trendline (5 days


ahead) 

above,

under

0.05
0.10

Window's size

Per entage

50
100
200
300

65.6%
88.3%
62.3%
67.1%

0.15
0.20
0

500

1000

1500

2000

Figure 5. Conden e interval (95%) (5 days ahead)

predi ted value of MA,N (t) and the true posi-

3.4 For asting 10 days ahead

x(t) w.r.t. the trendline (5 days ahead).

and fore ast it as in Se t. 3.2. The results, whi h are


displayed for a window size

N = 100

5 via the familiar onden e intervals,


dependen e of the varian e,

in Table 2 and Fig.


9
onrm the time-

i.e., the heteros edasti ity.

There is of ourse no need for the underlying statisti s to be


Gaussian. La k of spa e prevents us from exhibiting fore asts of

2500

Samples

Table 1. Comparison between the sign of the


tion of

0.00

Figures 6, 7, 8, 9 display the same type of results as


in Se tions 3.1, 3.2, 3.3 via similar omputations for a
fore asting

10

days ahead. The quality of the omputer

simulations only slightly deteriorates.

quantities like skewness and kurtosis, whi h would be obtained by


similar al ulations. This will be done in some future publi ations.

1.35
1.30
1.25
1.20
1.15
1.10
1.05
1.00
1050

1100

1150

1200

1250

1300

1350

1400

1450

Samples
Figure 7. Zoom of Figure 6

1.8

0.03

1.7
0.02

1.6
1.5

0.01

1.4
1.3

0.00

1.2
0.01

1.1
1.0

0.02

0.9
0.8
0

500

1000

1500

2000

0.03
0

2500

500

1000

Samples

Figure 6. Ex hange rates (blue ), ltered signal (bla k -

trends, whi h is

above,

under

10

a ademi mathemati al nan e, where the paradigm


is prevalent (see,

will bring as a byprodu t easily implementable real-time


13
omputer programs.

quite foreign, to the best of our knowledge, to the

random walks

ahead) 

is fundamental in our approa h. A theoreti al justi ation


11
We hope it will
12
lead to a sound foundation of te hni al analysis,
whi h

the key assumption in te hni al analysis,

of

2500

will appear soon (Fliess & Join, 2009).

4. CONCLUSION

2000

Figure 8. Predi ted position w.r.t. the trendline (10 days

-), fore asted signal (red ) (10 days ahead)

The existen e of

1500
Samples

e.g.,

(Wilmott,

2006)),

10 Trends in te hni al analysis should not be onfused with what are


alled trends in the time series literature (see, e.g., (Gouriroux &
Monfort, 1995; Hamilton, 1994)).

The existen e of trends does not ne essarily ontradi t a random


hara ter (see (Fliess & Join, 2009) for details).
12 See also (Da orogna, Genay, Mller, Olsen & Pi tet, 2001) for a
most ex iting study whi h employs high frequen y data. There are
also other types of attempts to put te hni al analysis on a rm basis
(see, e.g., (Lo, Mamaysky & Wang, 2000)). See (Blan het-S alliet,
Diop, Gibson, Talay & Tanr, 2007) for a omparison between
te hni al analysis and model-based approa hes with parametri
un ertainties.
13 Our te hni s already lead to su h omputer programs in automati
ontrol and in signal pro essing.
11

Systems Theory: Modelling, Analysis and Control.


Fes, Maro o. Soon online
0.20

http://hal.inria.fr/INRIA.

Fliess M., Join C., Sira-Ramrez H. (2004). Robust residual


generation for linear fault diagnosis: an algebrai

0.15

setting with examples.

Int. J. Control, 77, 12231242.

Fliess M., Join C., Sira-Ramrez H. (2008). Non-linear es-

0.10

timation is easy.

trol, 4, 1227.

0.05

Int. J. Modelling Identi ation Con-

Fliess M., Sira-Ramrez H. (2003). An algebrai framework

0.00

ESAIM Control Optimiz. Cal ulus Variat., 9, 151168.


for linear identi ation.

0.05

Fliess,

0.10

M.,

d'tat.

Sira-Ramrez,

H.

(2004).

Re onstru teurs

C.R. A ad. S i. Paris Ser. I, 338, 9196.

Fliess M., Sira-Ramrez H. (2008). Closed-loop parametri

0.15

identi ation for ontinuous-time linear systems via


0.20
0

500

1000

1500

2000

2500

Samples

Figure 9. Conden e interval (95%) (10 days ahead)

A knowledgement. The authors wish to thank G. Daval-Le ler q

(So it Gnrale - Corporate & Investment Banking) for helpful


dis ussions and omments.
REFERENCES
Aronson D. (2007).

Eviden e-Based Te hni al Analysis.

Wiley.
B hu T., Bertrand E., Nebenzahl J. (2008).
e
(6 d.). E onomi a.

te hnique

L'analyse

Blan het-S alliet C., Diop A., Gibson R., Talay D., Tanr
E. (2007). Te hni al analysis ompared to mathemati al models based methods under parameters mis-

J. Banking Finan e, 31, 13511373.


Thorie des risques nan iers. Eyrolles. English translation (2000): Theory
of Finan ial Risks. Cambridge University Press.
Box G.E.P., Jenkins G.M., Reinsel, G. (1994). Time Series
Analysis: Fore asting and Control (3rd ed.). Prenti e
spe i ation.

Bou haud J.-P., Potters M. (1997).

Hall.
Chambert-Loir A. (2005).

Algbre orporelle.

dit. ole

Polyte hnique. English translation (2005):

Guide to Algebra. Springer.

A Field

(Eds): Identi ation of Continuous-time Models from


Sampled Data, pp. 363391, Springer.
Genay R., Seluk F., Whit her B. (2002). An Introdu tion
to Wavelets and Other Filtering Methods in Finan e
and E onomi s. A ademi Press.
Gouriroux C., Monfort A. (1995). Sries temporelles
et modles dynamiques (2e d.). E onomi a. English
translation (1996): Time Series and Dynami Models.
Cambridge University Press.
Hamilton J.D. (1994).
University Press.
Kaufman P.J. (2005).
th
(4
ed.). Wiley.

Time Series Analysis.

Prin eton

New Trading Systems and Methods

E.I. (1964). Theory and Appli ation of the z Transform Method. Wiley.
Kirkpatri k C.D., Dahlquist J.R. (2006). Te hni al Analysis: The Complete Resour e for Finan ial Market
Te hni ians. FT Press.
rd
rev. ed.). Springer.
Lang S. (2002). Algebra (3
Jury

Lo A.W., Mamaysky H., Wang J. (2000). Foundations of


te hni al analysis: omputational algorithms, statisti al inferen e, and empiri al implementation.

nan e, 55, 1705-1765.

Mandelbrot B.B., Hudson R.L. (2004).

ior of Markets. Basi Books.

J. Fi-

The (Mis) Behav-

Markovsky I., Willems J.C., van Huel S., de Moor B.,

Da orogna M.M., Genay R., Mller U., Olsen R.B.,


Pi tet O.V. (2001).

new algebrai te hniques. In H. Garnier, L. Wang

An Introdu tion to High Frequen y

Finan e. A ademi Press.

Pintelon R. (2005). Appli ation of stru tured total


least squares for system identi ation and model redu tion.

Doets h G. (1967). Funktionaltransformationen. In R.

IEEE Trans. Automat. Control, 50,

1490-

1500.

Sauer, L. Szab (Eds): Mathematis he Hilfsmittel des


Ingenieurs, 1. Teil, pp. 232484. Springer.

Mboup M., Join C., Fliess M. (2008). A delay estimath


tion approa h to hange-point dete tion.

Durlauf S.N., Philips P.C.B. (1988). Trends versus random

Aja io. Online

walks in time series analysis.

E onometri a, 56, 1333

1354.
ommuni ations numriques.

ARIMA, to appear. On-

http://hal.inria.fr/inria-00311719/en/.

Fliess M., Fu hshumer S., S hberl M., S hla her K.,


Sira-Ramrez H. (2008). An introdu tion to algebrai
dis rete-time linear parametri identi ation with a
on rete appli ation.

J. europ. syst. automat., 42,

211232.
Fliess M., Join C. (2008). Commande sans modle et
ommande

Pro . 16

http://hal.inria.fr/inria-00179775/en/.
Mboup M., Join C., Fliess M. (2009). Numeri al dierenti-

Fliess M. (2008). Critique du rapport signal bruit en


line

Medit. Conf. Control Automation,

modle

restreint,

e-STA, 5.

Online

http://hal.inria.fr/inria-00288107/en/.

Fliess M., Join C. (2009). A mathemati al proof of the


existen e of trends in nan ial time series.

Int. Conf.

Numer.
Algor., DOI: 10.1007/s11075-008-9236-1.
Murphy J.J. (1999). Te hni al Analysis of the Finan ial
Markets (3rd rev. ed.). New York Institute of Finan e.
Paulos J.A. (2003). A Mathemati ian Plays the Sto k
Market. Basi Books.
Sornette D. (2003). Why Sto k Markets Crash: Criti al
Events in Complex Finan ial Systems. Prin eton Uniation with annihilators in noisy environment.

versity Press.
Taleb N. (1997).

Dynami Hedging. Wiley.


Paul Wilmott on Quantitative Finan e

Wilmott P. (2006).
nd
(2
ed., 3 volumes). Wiley.

You might also like