College of Computer and Information Science, Northeastern University July 3, 2022 1 Multifractal analysis and multiagent simulation for market crash prediction V. Romanov, V.Slepov, M. Badrina, A. Federyakov Russian Plekhanov Russian Plekhanov Academy of Economics Academy of Economics Computational Finance 2008 27 – 29 May 2008 Cadiz, Spain
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
College of Computer and Information Science, Northeastern UniversityApril 13, 2023 1
Multifractal analysis and multiagent simulation for market crash prediction
V. Romanov, V.Slepov, M. Badrina, A. Federyakov
Russian PlekhanovRussian Plekhanov Academy of EconomicsAcademy of Economics
Computational Finance 200827 – 29 May 2008
Cadiz, Spain
College of Computer and Information Science, Northeastern UniversityApril 13, 2023 2
PREDICTION DIFFICULTIES
It is well known, that financial markets are essentially non-linear systems and financial time series are fractals.
That’s why prediction of crash situations at finance market is a very difficult task. It doesn’t allow us to use effectively such well-known methods as ARIMA or MACD in view of their sluggishness.
Multifractal and wavelets analysis methods are providing more deep insight into the nature of phenomena. Multiagent simulation makes it possible to explicate dynamic properties of the system.
College of Computer and Information Science, Northeastern UniversityApril 13, 2023 3
Examples of outputs market model
Non-linear oscillation The strange attractor
This output looks like head and shoulder pattern Artificial time series generation
College of Computer and Information Science, Northeastern UniversityApril 13, 2023 4
The Aims and Methodology
• As soon as our aim is predicting Crash situations we are trying at first to find out the best indicator which uses Multifractal analysis and wavelet analysis methodology.
• With this aim in mind we are testing different pre-processing kinds of original time series to discover the best indicator.
College of Computer and Information Science, Northeastern UniversityApril 13, 2023 5
Fractals
The term fractal was coined in 1975 by Benoît Mandelbrot, from the Latin fractus, meaning "broken" or "fractured".
(colloquial) a shape that is recursively constructed or self-similar, that is, a shape that appears similar at all scales of magnification.
(mathematics) a geometric object that has a Hausdorff dimension greater than its topological dimension.
College of Computer and Information Science, Northeastern UniversityApril 13, 2023 6
Mandelbrot Set
Mandelbrotset, rendered with Evercat's program.
College of Computer and Information Science, Northeastern UniversityApril 13, 2023 7
Dynamic systems fractals
College of Computer and Information Science, Northeastern UniversityApril 13, 2023 8
Dimension
What is fractal dimension?• There are different kinds:• Hausdorff dimension… how does the number of balls it
takes to cover the fractal scale with the size of the balls?• Box-counting dimension… how does the number of
boxes it takes to cover the fractal scale with the size of the boxes?
• Information dimension… how does the average information needed to identify an occupied box scale?
• Correlation dimension… calculated from the number of points used to generate the picture, and the number of pairs of points within a distance ε of each other.
• This list is not exhaustive!
College of Computer and Information Science, Northeastern UniversityApril 13, 2023 9
Hurst exponent
• In prediction financial market behavior a special role belongs to the study of Hurst exponent. The exponent Hurst evaluation and its changing gives an opportunity predict trend replacement in critical points. The Hurst exponent H is statistical measure used to classify time series.
• The larger this value is the stronger trend. Time series with large Hurst exponent can be predicted more accurately than those series with value close to 0.50. The Hurst exponent provides a measure for long term memory and fractality of time series.
College of Computer and Information Science, Northeastern UniversityApril 13, 2023 10
Hurst exponent for monofractals
Ttzzx ttt ,...,1,lnln 1
• Depending on the value of Heurst exponent the properties of the process are distinguished as follows:
• When H = 0.5, there is a process of random walks, which confirms the hypothesis EMH.
•When H > 0.5, the process has long-term memory and is persistent, that is it has a positive correlation for different time scales.
• When H < 0.5, time-series is anti-persistent with average switching from time to time.
•
11
1,),(
t
t
uu xxxxtx
),(min),(max)(11
txtxRtt
1
21)(
uu xxS
log)(
)(log SR
H
College of Computer and Information Science, Northeastern UniversityApril 13, 2023 11
Multifractal time series (1)
1))(()|)()((| qq tqctxttxE
,, ,, realQBQqBt
q
The process is multifractal if:
where c(q) – predictor, E – expectation operator,
scaling function, which expresses mutifractality properties of time series
In case of monofractal
1HqqFor scaling function estimation we will construct partition function
,,
/int
01
qtT
ititit zzqz
1/int,
qt tqctTqzE
College of Computer and Information Science, Northeastern UniversityApril 13, 2023 12
Multifractal time series (2)
College of Computer and Information Science, Northeastern UniversityApril 13, 2023 13
Time series partitioning
• Time series: {xt}; t [0, T].
• Compute: Z={zt}, zt= lnxt+1-lnxt; t [0,T];
• Divide interval [0, T] into N subintervals, 1 ≤ N ≤ Nmax.
• Each subinterval contains int (T/N)=A values Z;
• For each subinterval K; 1 ≤ K ≤ N current reading number lK; 1 ≤ lK ≤ A; t = (K-1) А+ lK
• As soon as we are looking for the best indicator of a coming default, we will use several variants of a preliminary processing.
College of Computer and Information Science, Northeastern UniversityApril 13, 2023 14
Time series preprocessing
• 1. The original time series itself: Z={zt};
• 2. Preprocessed time series Z1={ }, K=1,2,…N, where
• 3. Preprocessed time series where
• 4. Preprocessed time series Z3={ }
KlAK ZZK
10
A
lKlK
K
KZZ
AS
1
2
0
1
A
llK
K
Kz
AZ
10
1KZ
K
KlAK
S
ZZZ K
10
2
College of Computer and Information Science, Northeastern UniversityApril 13, 2023 15
Partition functions
N
K
q
AKKAN ZTZqZ1
)1(0)(00 |)(|),(
N
K
qKKN ZTZqZ
11
1 |)(|),(
N
K
qAKN ZKAZqZ
1
)1(222 |)(|),(
For each preprocessed time series compute partition function for different N and q values :
N
K
q
AKKAN ZZqZ1
)1(3)(33 ||),(
College of Computer and Information Science, Northeastern UniversityApril 13, 2023 16
Scaling functions (see main fractal property)
A
NAqZq
NN log
loglog),(log)(
00
A
NAqZq
NN log
loglog),(log)(
11
A
NAqZq
NN log
loglog),(log)(
22
A
NAqZq
NN log
loglog),(log)(
33
College of Computer and Information Science, Northeastern UniversityApril 13, 2023 17
Fractal dimension spectrum estimation
)])()([min(arg)]([minarg)( qqqqqf iiq
iq
I
1. Lipshitz – Hoelder exponent estimation:
, where i = 1, 2, 3, 4.
2. Fractal dimension spectrum estimation by Legendre transform:
qqqqqdq
d iiii
i
/)(/))1()((
College of Computer and Information Science, Northeastern UniversityApril 13, 2023 18
Fractal dimension spectrum width as crash indicator
• Multifractal may be composed of two or infinite number of monofractals with continuous varying α values. Width of α spectrum may be estimated as difference between maximum and minimum values of α:
• By carrying out Legendre transform we are trying using our program
by estimating Δ to find differences in its values before and after crash.
• Roughly speaking f() gives us number of time moments, for which degree of polynomial, needed for approximation f() equals (according to Lipshitz condition).
minmax
College of Computer and Information Science, Northeastern UniversityApril 13, 2023 19
Experimental results (multifractal analysis)
The method of multifractal analyses, described above, has been applied also for October 1987 USA financial crises, using Dow Jones index Fig. 1.
0,00000
500,00000
1000,00000
1500,00000
2000,00000
2500,00000
3000,00000
0 100 200 300 400 500 600 700 800
Figure 1: Dow Jones industrial average data for period 01.02.1985 – 31.12.87. Axis X contains serial numbers of readings.
College of Computer and Information Science, Northeastern UniversityApril 13, 2023 20
Fractal spectrum estimation
Figure 2: Fractal dimension spectrum F2 () for DJ
industrial average series for period 10.10.85-19.10.87.
Fractal dimension spectrum for 18.11.96-30.11.98 time
period (Russian default currency exchanging data)
Fractal dimension spectrum for 09.07.96-21.07.98 time period
(Russian default currency exchanging data)
College of Computer and Information Science, Northeastern UniversityApril 13, 2023 21
Multifractal spectrum width before and after crisis
F1
0
0,5
1
1,5
2
2,5
3
3,5
4
4,5
date
fra
cta
l s
pe
ctr
um
wid
th (
de
lta
)
level 0
level 0,6
level 0,8
Figure 3: Fractal dimension spectrum width F1 () changing before and after crises.
College of Computer and Information Science, Northeastern UniversityApril 13, 2023 22
Multifractal spectrum width before and after crisis (continued)
F2
0
0,5
1
1,5
2
2,5
3
date
fra
cta
l s
pe
ctr
um
wid
th (
de
lta
)
level 0
level 0,6
level 0,8
Figure 4: Fractal dimension spectrum width F2 () changing before and after crises.
College of Computer and Information Science, Northeastern UniversityApril 13, 2023 23
Wavelet analysis
• Wavelet A small wave
• Wavelet Transforms Convert a signal into a series of wavelets Provide a way for analyzing waveforms, bounded in both frequency
and duration An alternative approach to the short time Fourier transform to
overcome the resolution problem Similar to STFT: signal is multiplied with a function
• Multiresolution Analysis Analyze the signal at different frequencies with different resolutions Good time resolution and poor frequency resolution at high
frequencies Good frequency resolution and poor time resolution at low
frequencies More suitable for short duration of higher frequency; and longer
duration of lower frequency components
Constituent wavelets of different scales
College of Computer and Information Science, Northeastern UniversityApril 13, 2023 24
Wavelet analysis of multifractal time series
)(1
)(
tt
where ,(t)– function with zero
mean centered around zero with time scale and time
horizon .
Family of wavelet vectors is created from mother
function by displacement and scaling
,)()(),( , dtttxW
College of Computer and Information Science, Northeastern UniversityApril 13, 2023 25
Time series f(t) representation as linear combination of wavelet
functions
),()()( ,,,
0
00tttf kj
kkj
jjkj
kj
dtttf kjkj )()( ,, 00
dtttf kjkj )()( ,,
where jo – a constant, representing the highest level of resolution for which the most acute details are extracted .
College of Computer and Information Science, Northeastern UniversityApril 13, 2023 26
Experimental results (wavelet analysis)
14700
14720
14740
14760
14780
14800
14820
14840
14860
14880
14900
Figure 5: The plot of changing maximum values detail coefficients Daubichies -12 expansion.
-25
-20
-15
-10
-5
0
5
10
15
20
25
Figure 6: The plot of maximum differences.
College of Computer and Information Science, Northeastern UniversityApril 13, 2023 27
Financial market model FIMASIM
The main functional modules are:• FMSWorld, which contains virtual world classes and relationships,• FMSStandardRoles, which contains financial market classes, and
others.
Standard classes of the system are:• Trader (TFMTrader) • Broker (TFMSBroker) • Company (TFMCompany) • Market, stock exchange (TFMSMarket) • Strategy (TFMSStrategy) • Plan (TFMSPlan) • Order, transaction request (TFMSShareTransactionRequest) • Transaction (TFMSShareTransactiont)
College of Computer and Information Science, Northeastern UniversityApril 13, 2023 28
Virtual market program interface
College of Computer and Information Science, Northeastern UniversityApril 13, 2023 29
The experiments were made with aim to find out at which values of parameters the market instability arises.