230 Mmmm Drog

4
Copyright (c) Technical Analysis Inc. Stocks & Commodities V. 23:11 (44-48): Singular Spectrum Analysis: Part II by Sergiy Drogobetskii NEW TECHNIQUES Further Analysis Of Nonlinear Wave Patterns Here’s another look at applying singular spectrum analysis to the foreign exchange markets. by Sergiy Drogobetskii Singular Spectrum Analysis: Part II In my last article, I discussed some of the variables that make up single spectrum analysis (SSA), an analytical method that has been applied to various branches of scientific study. It has proved useful for compressing information, smoothing initial data and, in certain cases, predicting time series data prices. Last time, I showed how SSA could be applied to forex market prices. This time, I will continue in that direction and show how you can apply SSA to forecast prices. In reconstructing the initial time series, one important consequence of the singular value decomposition (SVD) of a trajectory matrix (built from the time series of prices) is that it is possible to completely recon- struct the decomposed initial trajec- tory matrix by using empirical or- thogonal functions (EOFs) contained in the right matrix V: X = XV i V i T Σ i =1 m SSA Singular spectrum analysis SVD Singular value decomposition EPB Elementary patterns of behavior EOF Empirical orthogonal functions RC Reconstructed components PC Principal components FOR YOUR REFERENCE matrix with constant elements on skew diagonals—that is, the second element in the first column of trajectory matrix is equal to the first element in the second column, and so on. To get a one-dimensional representation of the calculated EPB, you need to average the elements in this matrix accord- ing to the skew diagonals. So the initial series is the sum of the initial matrix X will contain n rows and m columns. According to formula (1), a reconstructed matrix is the sum of separate matrixes reconstructed by some specific EOF. Each reconstructed matrix represents an elementary pattern of behavior (EPB) in a multidimensional space, so you need to reduce them back to a one-dimensional space. If you look at the result of the trajectory matrix, you’ll see that it’s a It’s not necessary to use all EOFs from matrix V to recon- struct the trajectory matrix. Only l corresponds to the leading singular values. By using l EOFs, you can reconstruct the trajectory matrix using formula (1) and replace m with l. The

description

n/a

Transcript of 230 Mmmm Drog

Page 1: 230 Mmmm Drog

Copyright (c) Technical Analysis Inc.

Stocks & Commodities V. 23:11 (44-48): Singular Spectrum Analysis: Part II by Sergiy Drogobetskii

NEW TECHNIQUES

Further Analysis Of Nonlinear Wave Patterns

Here’s another look at applyingsingular spectrum analysis to theforeign exchange markets.

by Sergiy Drogobetskii

Singular Spectrum Analysis:Part II

Inmy last article, Idiscussed some of thevariables that make upsingle spectrum analysis(SSA), an analyticalmethod that has been

applied to various branches ofscientific study. It has proved usefulfor compressing information,smoothing initial data and, in certaincases, predicting time series dataprices. Last time, I showed how SSA

could be applied to forex marketprices. This time, I will continue inthat direction and show how you canapply SSA to forecast prices.

In reconstructing the initial timeseries, one important consequenceof the singular value decomposition(SVD) of a trajectory matrix (builtfrom the time series of prices) is thatit is possible to completely recon-struct the decomposed initial trajec-tory matrix by using empirical or-thogonal functions (EOFs) containedin the right matrix V:

X = XViViTΣ

i = 1

m

SSA Singular spectrum analysisSVD Singular value decompositionEPB Elementary patterns of behaviorEOF Empirical orthogonal functionsRC Reconstructed componentsPC Principal components

FOR YOUR REFERENCE

matrix with constant elements on skew diagonals—that is,the second element in the first column of trajectory matrix isequal to the first element in the second column, and so on.

To get a one-dimensional representation of the calculatedEPB, you need to average the elements in this matrix accord-ing to the skew diagonals. So the initial series is the sum of the

initial matrix X will contain n rows and m columns.According to formula (1), a reconstructed matrix is the sum

of separate matrixes reconstructed by some specific EOF.Each reconstructed matrix represents an elementary patternof behavior (EPB) in a multidimensional space, so you needto reduce them back to a one-dimensional space. If you lookat the result of the trajectory matrix, you’ll see that it’s a

It’s not necessary to use all EOFs from matrix V to recon-struct the trajectory matrix. Only l corresponds to the leadingsingular values. By using l EOFs, you can reconstruct thetrajectory matrix using formula (1) and replace m with l. The

Page 2: 230 Mmmm Drog

Copyright (c) Technical Analysis Inc.

Stocks & Commodities V. 23:11 (44-48): Singular Spectrum Analysis: Part II by Sergiy Drogobetskii

reconstructed components (RCs), andeach represents the EPB plus residualsor noise:

1.22901.22801.22701.22601.22501.22401.22301.22201.22101.22001.21901.21801.21701.21601.21501.21401.21301.21201.21101.2100

20 40 60 80 100 120 140 160 180 200Initial1 RC

1-3 RCs1-20 RCs

Initial & Reconstructed Series EUR 60 min

0.0060

0.0040

0.0020

0.0000

-0.0020

-0.0040

-0.0060

0.00200.00150.00100.00050.0000

-0.0005-0.0010-0.0015

0 50 100 150 200

0 50 100 150 200

2-3 RCsZero

2-3 RCs

5-6 RCs5-6 RCsZero

FIGURE 1: RECONSTRUCTION OF THE INITIAL TIME SERIES OF PRICES USING EOF 1, EOF (1-3) AND EOF(1-20). The first RC corresponds the nonlinear trend, RCs (1-3) add to this trend oscillating components, and RCs(1-20) almost reconstruct the initial series.

FIGURE 2: GROUPING RCs. The upper chart displays the grouped RCs 2,3. The lower chart represents groupedRCs 5,6.

CH

ARTS

BY

SER

GEI

DR

OG

OBE

TSKI

I

F(t) = fi(t) + resΣF(t) is the initial series and f

i(t) is the

i-th RC.RCs have an advantage over princi-

pal components (PCs), since they havea length of (N-m+1) points and do notcontain direct information aboutphases, amplitudes, and frequenciesof the time series. RCs are projectionsof PCs onto the same EOFs that wereused in calculating the PCs.

The reconstruction of initial timeseries is said to be an SSA-smoothingby the leading l components. Figure 1represents the reconstructed time se-ries of prices using EOF 1, EOF (1-3),and EOF (1-20). The first singularvalue, with its EOF, corresponds to thenonlinear trend, with an accuracy ofapproximately 99%. When you addthe remaining EOFs, you’ll see thatthey approach the reconstructed se-ries of the initial price series.

GROUPING RCSYou can reconstruct part of the timeseries using formula (1) either with singleor multiple EOFs. Since the reconstructedseries is represented as a sum of an EPB,you can group RCs to find regular oscil-lations, amplitudes, and frequencies ofthese oscillations. Each such group willcontain a sum of RCs calculated usingthe set of EOFs. The RCs are grouped toaccount for the high amplitude of oscil-lations or determine constant frequen-cies of oscillations.

Oscillations in RCs can be found byvisually analyzing one- or two-dimen-sional plots of grouped RCs. You canalso apply other types of analysis togroups of RCs. In Figure 2 you see twogroups of RCs: (2,3) and (5,6). Bothhave a cyclic structure and relativelyhigh amplitude of price movement.Thus, you can reconstruct the series byEOFs 1,5-6, by EOFs 1-3,5,6, or anyother component of matrix V.

By grouping separated EPBs and re-constructing them by time series ofprices, you can extract information

Price interval

Page 3: 230 Mmmm Drog

Copyright (c) Technical Analysis Inc.

Stocks & Commodities V. 23:11 (44-48): Singular Spectrum Analysis: Part II by Sergiy Drogobetskii

about pure signals from initial series. The difference betweeninitial and reconstructed series represents the noise in the system.Noise is the reaction of the market to random news. We mustkeep in mind, however, that with this the noise must be white.

FORECASTINGWhen it comes to forecasting time series, you will be inter-ested in at least two questions. First, where will price be aftera specified period of time, and second, where do you placepending orders?

If you use the moving average crossover system as atrading system, you’ll never enter the market too early, sincemoving averages are lagging indicators. You will alwaysenter during prominent trends, which minimizes your risk.Take a look at the hourly chart of the euro in Figure 1 and seethe crossovers of RC 1 and RCs 1-3. Although part of themovement happened prior to the crossover, you could stillplace an order in the prevailing direction of the trend. You candetermine this by using reconstructed components.

When looking at the chart, you are probably tempted toextend the moving averages severalpoints forward to the next crossover.Forecasting price movement has a lotto do with prior experience in analyz-ing the price dynamics, plus youshould have a model for a predictabletrading system. Up to this point, Ihave determined the mathematicalmodel of the time series of prices. Thenext step is to develop the mathemati-cal model for constructing the predic-tor. Since development of models re-quires knowledge in matrix algebra, Ihave only represented the idea of fore-casting here.

The method I have used is a linearrecurrent continuation. This is becausethe value of N+1 points of the fore-casted series is a linear combinationof its previous states with weight co-efficients. In the example here, thecurrent value of the reconstructed se-ries depends on previous m-1 priceswith some weight coefficients, wherem is the number of delays. I use weightcoefficients determined by EOFs toreconstruct time series of prices. I ar-

ranged them in some matrix P that I call the predictor. Thenumber of coefficients in the predictor is equal to m-1. There-fore, you need the same number of states from the selectedseries as a base for the forecast. The formula for recurrentcontinuation is:

x(N+1)=PQ

1.23401.23201.23001.22801.22601.22401.22201.22001.21801.21601.21401.21201.21001.20801.20601.20401.20201.2000

450 500 550 600 650 700

WholeInitial

1 RCs1-3 RCs

Forec. 1 RCsForec. 1-3 RCs

Forecasting EUR 60 min

Crossover

Order wasexecuted

FIGURE 3: RECURRENT CONTINUATION OF THE RECONSTRUCTED SERIES BY RC 1 AND RCS 1-3. Here yousee how you can apply RCs to placing trades. The sell-stop order was placed at 1.2245, where a crossover offorecasted series occurred. The trade was executed one and a half days later.

When it comes to forecasting time series,you will be interested in at least twoquestions. First, where will price be aftera specified period of time, and second,where do you place pending orders?

If you can find the first forecasting value formally, thenyou can extend that procedure to predict farther out into thefuture. All you have to do is replace the last matrix elementof matrix Q by the predicted ones. The recurrent continuationwill be impossible if the sum of the squares of elements in thelast row of matrix V equals one or tends toward one.

You can use any combination of RCs in formula (1) as thebase of your forecast. For example, on the hourly chart of theeuro in Figure 3, let’s follow the two reconstructed series, RC1 and RCs 1-3, to the point of the crossover of the forecastedseries. The crossover takes place at 1.2245. Sticking with themoving average crossover method, since the RC (1-3) crossedbelow RC (1), you want to place a sell-stop order at the pointof their crossing. This took place at 12:01 on June 7, 2004. Atthis point the price was at 1.2327. The order was executed at3:01 June 9, 2004, a day and a half later. If price were to dropdown to 1.2000, you would end up making a profit that is

where:

P is the predictor, andQ is the matrix that contains elements of the forecast base.

Price interval

5/25/04

Page 4: 230 Mmmm Drog

Copyright (c) Technical Analysis Inc.

Stocks & Commodities V. 23:11 (44-48): Singular Spectrum Analysis: Part II by Sergiy Drogobetskii

equal to almost 200 points.By using the model of recurrent continuation, you can

forecast the initial time series of prices instead of the recon-structed ones. Bear in mind there is no way to predictdownward price movement in the frame of this model. Canyou figure out why? I will explain this in more depth later inthis article, but because the series has an upward tendency atthat time, linear continuation of reconstructed time series willonly be upward. One point of continued series will be a linearcombination of upward time series (initial or reconstructed)and predictors’ coefficients, which were calculated fromEOFs of the initial time series. So if the initial time series hasonly downward price movement, you can’t predict upwardmovement.

DATA AND PARAMETER SELECTIONThis method was developed for stationary time series, buttime series of prices is not stationary. So before applyingsingular value decomposition (SVD) to the trajectory matrix,you can reduce the matrix to zero and the standard deviationto one by extracting the average and normalizing the standarddeviation calculated over columns of the trajectory matrix.You can either select one of these procedures or none.

By extracting averages from the elements of the matrix, theaverage elementary orthogonal function will occur in linewith other EOFs estimated after the SVD procedure. You canreduce standard deviation and the mean trend to zero and 1,respectively, before constructing the trajectory matrix. So inthe reconstruction stage you must renormalize and add themean trend back to the reconstructed series.

What is essential for SSA is selecting the main parameters:series length and number of delays. Although there aren’t anyspecific recommendations of what these parameters shouldbe, several aspects have been taken into consideration. Theyexceed the limits of this article.

Nevertheless, there are some shortcomings of the recurrentcontinuation model you should be aware of. First of all, the partthat has been selected from the entire time series represented inFigure 1 has an upward tendency. Reconstructed elementarypatterns of behavior cannot make a downward contribution tothe reconstructed series. As a result, the initial series of pricesshould have approximately equal initial and final points.

The value of window length m depends on your objective.If your objective is to smooth the initial time series of prices,

then the number m should be as large as possible. If it is tofind hidden periods after performing the SVD procedure andselecting l leading components, then when performing theSVD secondary, the value of m should be shortened and couldbe equal to l. For the best separation of periodic but notnecessarily harmonic fluctuations with known periods, thevalue of m should be a multiple of the period and the lengthof series N should be equal to it.

OSCILLATIONS AND WHITE NOISEIt’s difficult to draw all the details of the method presentedwithin the scope of two articles. Because of this, I had torestrict the analysis to finding oscillations against whitenoise null-hypotheses. You can’t use this method for allnoise models, white or otherwise, without further study.

We collected all stages of this analysis in our dynamiclibrary, as a start. You can perform independent research byusing EasyLanguage files or by visiting the Analysis FXwebsite (www.analysisfx.com), which represents the resultsof analysis applied to the currencies traded in foreign ex-change. In addition, you can find other types of analysis thatwould be helpful for you to make your profit.

Sergiy Drogobetskii has a master’s degree in theoreticalphysics from Odessa National University. He is interested innew techniques in nonlinear dynamics and chaos theory.

SUGGESTED READINGBroomhead, D.S., and G.P. King [1986]. “Extracting Quali-

tative Dynamics From Experimental Data,” Phys. D 20.Drogobetskii, Sergiy [2005]. “Singular Spectrum Analysis

Of Price Movement In Forex,” Technical Analysis ofSTOCKS & COMMODITIES, Volume 23: October.

Satchwell, C.J. Forecasting, Theory And Practice, Techni-cal Forecasts.

Sergeeva, L.N. [2002]. Modelirovanie PovedeniyaEconomicheskih, Ukraine, Zaporoz’e.

Vautard, R., and M. Ghil [1989]. “Singular Spectrum Analy-sis In Nonlinear Dynamics, With Applications To Paleo-climatic Time Series,” Phys. D 35.

Wu, Amy [2002]. “Fast Fourier Transform,” TechnicalAnalysis of STOCKS & COMMODITIES, Volume 20: July.

• www.analysisfx.comS&C†See Traders’ Glossary for definition