Looking at the signals sent by Michael:
Signals:
The obvious observations:
- Signal 1 is a sinosodial signal
- Signal 2 is an monotonously decreasing function. The first hunch is "a root function"
- Signal 3 looks smooth, has many minima and maxima and zeros to be a simple polinomial function (perhaps order 40-50 range)
Secondary observations:
Do a simple x(k+n) to x(k) corellation map (x axis is x(k) and y axis is x(k+n):
Signal 1:
Original Signal:
| n=1 | n=2 | n=3 | n=4 | n=5 |
|
|
|
|
|
|
Signal2:
Original Signal:
| n=1 | n=2 | n=410 |
|
|
|
|
Signal3:
Original Signal:
| n=1 | n=2 | n=4 | n=10 |
|
|
|
|
|
Based on this graphs for this signal my predictions can be represented
on the x(k+1) vs x(k) diagram (the first attractor is zoomed).
My next point predictions would be:
| Points | Value |
| 1001 | -15.3 |
| 1002 | -14.4 |
| 1003 | -13.5 |
| 1004 | -12.6 |
| 1005 | -11.6 |
| 1006 | -10.7 |
| 1007 | -9.8 |
| 1008 | -9 |
| 1009 | -8.4 |
| 1010 | -7.8 |
| 1011 | -7.4 |
| 1012 | -7 |
| 1013 | -6.5 |
| 1014 | -6.7 |
Further Ideas:
- Signal 3 has a strange attractor (actually 2 attractor
basins). Is seems to be a result of a set of ODEs or a nonlinear
system. - Signal 1 is a sinusodial signal with varying amplitude or sampled at irregular points.
- Signal 2 looks like to have constant slope but it does not hold at longer correlation distances.
Check the derivatives:
In a time series the derivative can easily be defined as:
First derivative (forward derivative):
d(k) = x(k+1) – x(k)
Second derivative:
dd = d(k+1) – d(k)
= x(k+2) – x(k+1) – x(k+1) + x(k)
= x(k+2) – 2x(k+1) + x(k)
The only interesting derivative information comes from the third signal:
1st derivative:
2nd derivative:
The relationship between devc1(k+1) and devc1(k) is similar to c(k+1)
and c(k). There are strange attractors shaping the relationship. The
second derivative also displays a similar behaviour.
Now check another derivative behaviour:
How does the derivative change from one point to another?
d(k)=c(k+1)-c(k)
d(k+1)=c(k+2)-c(k+1)
r(k)=d(k+1)/d(k)
r behaves as follows:
Spikes come up at locations where the d(k) comes close to 0. Plotting
r(k+1) vs r(k) and zooming around origin reveals that most point share
similar asymptotic behaviour:
Trend Analysis
Using the first and the second derivatives one create the following notation (this is similar to the Elliot Wave Theory ):
| First Derivative | Second Derivative | Letter |
| + | + | A |
| + | - | B |
| - | - | C |
| - | + | D |
| + | 0 | E |
| - | 0 | F |
| 0 | 0 | G |
Now based on this transition the signal can be represented as:
Signal 1:
|
column 1 to 34
!C D D A B B C D D A B B C D D A B B C D D D A B B C D D A B B C D D ! column 35 to 68 !A B B C D D A B B B C D D A B B C D D A B B C D D A B B C D D D A B ! column 69 to 102 !B C D D A B B C D D A B B C D D A B B B C D D A B B C D D A B B C D ! column 103 to 136 !D A B B C D D D A B B C D D A B B C D D A B B C D D A B B B C D D A ! column 137 to 170 !B B C D D A B B C ……… |
As one can see there are 3 types of frames that are repeated in the signal.
| # | Signal | Length |
| 1 | A B B C D D | 6 |
| 2 | A B B C D D D | 7 |
| 3 | A B B B C D D | 7 |
Signal 2
|
column 1 to 34
!C D D D D D D D D D D D D D D D D D D D D D D D D D D D D D D D D D ! column 35 to 68 !D D D D D D D D D D D D D D D D D D D D D D D D D D D D D D D D D D ……… |
Signal 2 is a simple monotonically decreasing function. There is only one frame, it is 1 character long and
is D.
Signal 3
|
column 1 to 34
!A A A A A A A A A A A A A A A A A A A A A A A A A A A A A A A A A B ! column 35 to 68 !B B B C C C C C D D D D D D D D A A A A B B B B B B B B B B B B C C ! column 69 to 102 !C C C D D D D D D D D D D A A A A A A A A A A A A A A A B B B B B B ! column 103 to 136 !B C C C C C C C D D D D D D D D D D D D D D D D D A A A A A A A A A ! column 137 to 170 !A A A A A A A A A A A A A A A A A B B B B B C C C C C D D D D D D D ! column 171 to 204 !D D D D D D A A A A A A B B B B B B B B B B B C C C C C C C C C C C ! column 205 to 238 !C C C C D D D D D D D A A A A A A A B B B B B B B B B B B B B B B B ! column 239 to 272 !B B B B B C C C C C C C C C C C C C C C C C C C C C C C C C C C C C ! column 273 to 306 !C C C C C D D D D D A A A A B B B B B B B B B B C C C C C C D D D D ……… |
Now this one is difficult to guess. There are some patterns but no clear repetitions.
Counting the frequency of shapes along the time line:
|
column 1 to 31 !A B C D A B C D A B C D A B C D A B C D A B C D A B C D C D A ! ! ! !33 4 5 8 4 12 5 10 15 7 7 17 26 5 5 13 6 11 15 7 7 21 34 5 4 10 6 15 19 6 6 ! column 32 to 62 !B A B C D A B C D A B C D A B C D A B C D A B A B C D C D A B ! !16 3 11 8 11 14 7 7 15 20 6 5 30 8 11 13 8 7 13 18 6 6 14 14 6 7 16 20 5 6 27 ! column 63 to 90 !C D A B C D A B C D A B C D C D A B A B C D A B C D C D ! ! ! !9 11 11 9 8 11 13 8 7 13 16 6 7 14 18 6 6 14 10 7 8 13 20 6 5 15 8 8 ! |
There are at least 3 types of frames at varying lengths.
Multiscale Analysis
If we take the 3rd signal and apply multiscale analysis then we get the following diagram:
Here the top diagram is the original signal (scale 1)
The second diagram is scale 2 and each data point represents 2 points.
The nth diagram is scale n and each data point corresponds to 2n datapoint of the original signal.
Trend analysis of Scale 5 results in:
|
column 1 to 36 !B D B D B D B C D B D B C D B D C D B D A B D B D B D A B D B D B D B D ! ! ! !1 1 1 1 1 2 1 1 1 1 1 2 1 1 1 1 1 1 2 1 1 1 1 2 2 1 1 1 1 1 3 3 2 1 1 1 ! column 37 to 46 !A B D B C D B C D B ! ! ! !1 1 1 1 2 1 2 1 1 1 ! |
Lastly: Regression in the form of autoregression
Model the system as x(k)=sumi(a(i)x(k-i))
Algorithm:
(1) Model the system using i=2,3,4,5,6,7,8,9 and 10
(2) Estimate the next 5 points using these 9 models
(3) Check the variance for each point (for each 5 future point there
will be 9 values each coming from the 9 autoregressive models)
(4) Check the fit for each of these predictions (5 estimated points – real 5 values)T*(5 estimated points – real 5 values)
The results are as follows:
Variations vs the signal. There are certain zones in the signal where a
prediction is not feasible. The autoregressive models generate very
distinct results.
This graphs depicts the (a) volatility (defined as the variance in the
estimates for each future point), (b) fit (defined as (5 estimated
points – real 5 values)T*(5 estimated points – real 5 values) ), (c) the first derivative of the signal and (d) the second derivative of the signal.
As one can see the the volatility and fit match very nicely. Meaning if
the volatility is large the fit is bad as well. Since volatility
calculations require only existing values it can be used as a good
indicator for buy or sell decisions.
Here is the first resulting Trading Strategy:
Algorithm (MARSI: Moving AutoRegression for System Identification):
- Use a window of 4 times the length of the number of
parameters to determine the model parameters for the autoregression
(AR) models. I.e. use 8 pints into the past to calculate the 2
parameters of the 2nd order AR (x(k+1)=a2*x(k)+a1*x(k-1)) - Using the AR models with 2-10 parameters (determined in step 1) calculate the next 5 unknown future points.
- Calculate the variance of these 9 models for each of the 5 future points.
-
If the variance is less then epsilon then check delta=x(L+1)-x(L) where
L is the last known point, If variance is more than epsilon than WAIT. - If delta > 0 then BUY, and if delta < 0 then SELL