From: John Conover <john@email.johncon.com>
Subject: A cute equity exchange simulation
Date: 9 Jun 2003 01:46:10 -0000
Suppose there is an equity exchange that is in the doldrums. Suppose
that the Shannon probability of all equity time series is p =
0.50706713781, and the deviation of the marginal increments of all
equity time series is rms = 0.0283-there is no clear advantage of any
stock over any other. (The median values, measured over the last
century for the daily closes of all equities in the US equity markets
was about p = 0.51, and rms = 0.02, giving an average of the marginal
increments of 0.0004, which is optimal.) Note that all that was done
was to increase the rms, over the empiricals from the last century, by
about sqrt (2) = 1.414, (which, by the way, is were the rms has been
running on the US exchanges since mid 2000.)
Note that the average daily gain is positive, (0.0004,) and p > 0.5,
(0.50706713781). Does that mean that the equities in the exchange will
increase in gain?
Its counter intuitive, but the answer is no. In point of fact, the
gain for each equity is 0.999999501, (which is as close to unity as I
could get it; its from the G = ((1 + rms)^p) * ((1 - rms)^(1 - p))
equation.)
If you make a 300 record file, (call it toy):
0, p = 0.50706713781, f = 0.0283
1, p = 0.50706713781, f = 0.0283
2, p = 0.50706713781, f = 0.0283
3, p = 0.50706713781, f = 0.0283
.
.
.
297, p = 0.50706713781, f = 0.0283
298, p = 0.50706713781, f = 0.0283
299, p = 0.50706713781, f = 0.0283
and then do the following simulation command:
tsinvestsim toy 100000 | tsinvest -i -t -j -D 0.99
the output file will look like:
0 1.00 1000.00
1 1.00 1000.00
2 1.00 1000.00
3 1.00 1014.15
4 1.00 1023.91
5 1.00 1026.23
6 1.00 1031.45
7 1.00 1032.04
8 1.00 1026.20
9 1.00 1047.69
10 1.00 1055.99
.
.
.
99990 445812853.71 1121509574374138624.00
99991 452932492.58 1118970476697741568.00
99992 457366276.37 1125937186885675392.00
99993 457902652.40 1140594637184596480.00
99994 433244855.97 1136721177796702592.00
99995 428366633.48 1132217488490292480.00
99996 429892231.06 1144393355361525248.00
99997 435642002.06 1143745628722392448.00
99998 419691487.07 1139214108541371904.00
99999 419799293.93 1159847554475297280.00
meaning that if you invested one thousand dollars in the exchange's
index, at the end of about four centuries, (100,000 trading days is
about 395 calendar years,) you would have 419799293.93 * 1000 =
419,799,293,930.00 dollars. However, if you let tsinvest shuffle its
money around in its portfolio of ten stocks, you would have
1,159,847,554,475,297,280.00 dollars!!!
The distribution of the values of the 300 equities in time interval
99999 is, (zing down to the last one):
0.000000
0.000000
0.000000
0.000000
0.000000
0.000000
0.000000
0.000000
0.000000
0.000000
0.000000
0.000000
0.000000
0.000000
0.000000
0.000000
0.000000
0.000000
0.000001
0.000001
0.000001
0.000001
0.000003
0.000003
0.000003
0.000006
0.000006
0.000006
0.000011
0.000012
0.000014
0.000017
0.000019
0.000026
0.000026
0.000030
0.000036
0.000041
0.000045
0.000057
0.000058
0.000060
0.000072
0.000076
0.000093
0.000102
0.000124
0.000127
0.000142
0.000144
0.000148
0.000152
0.000193
0.000205
0.000295
0.000320
0.000336
0.000340
0.000342
0.000361
0.000367
0.000402
0.000461
0.000489
0.000619
0.000687
0.000807
0.000931
0.001119
0.001231
0.001288
0.001371
0.001516
0.001802
0.002110
0.003314
0.003575
0.003593
0.004199
0.004334
0.004350
0.004485
0.004563
0.004706
0.004773
0.004897
0.005345
0.005708
0.006866
0.007152
0.007812
0.009876
0.010641
0.010881
0.011418
0.011860
0.012532
0.015791
0.015962
0.016219
0.016625
0.017535
0.018039
0.022152
0.022467
0.023279
0.023627
0.025395
0.026039
0.031708
0.033075
0.037987
0.038692
0.041970
0.045991
0.046345
0.048287
0.061647
0.069352
0.074653
0.076090
0.078894
0.102207
0.107705
0.109604
0.133914
0.138558
0.143377
0.149093
0.162783
0.172695
0.197362
0.199488
0.215071
0.234364
0.274556
0.276983
0.283503
0.287825
0.320333
0.357794
0.376475
0.449699
0.503194
0.507238
0.604762
0.619065
0.658060
0.743598
0.866489
0.971548
1.034036
1.061962
1.158218
1.184615
1.231090
1.528714
1.680228
1.967346
2.054743
2.179320
2.303673
2.614281
2.858407
3.106997
3.240102
3.305816
3.465036
3.985862
4.046277
4.116390
4.908092
5.090732
5.451927
5.866275
6.124538
6.200465
7.119669
7.394575
7.405781
7.948520
7.988411
8.075786
8.402285
9.269292
10.116763
11.049315
13.098633
14.222985
14.237552
14.748766
19.153911
20.875269
22.287625
23.748523
28.931972
35.370262
39.263971
44.725109
45.624084
45.689237
47.632635
52.648633
55.205386
56.690869
61.896891
68.903480
74.184430
79.533489
85.107324
85.274202
85.558765
87.492165
93.129219
100.229488
109.315616
111.353530
112.042332
117.889399
119.593678
125.180268
126.408082
149.538382
155.945846
174.600421
181.079965
192.757648
195.889364
216.840736
271.602360
321.130354
404.916302
420.967199
463.732703
511.640853
515.874994
535.261594
560.335203
611.055917
659.126088
679.410219
712.001572
772.316643
831.618462
840.544020
992.487132
993.296917
1231.049863
1628.758447
1785.619924
2150.844601
2232.226585
2564.625443
3195.959633
3867.235138
6090.160795
7837.266036
10929.783559
11598.159284
12163.228420
13261.912250
13711.614665
18482.897373
19512.281679
24624.085761
28646.983806
33213.149440
38612.590757
54703.104183
62728.970776
71958.311637
98344.104000
101788.161330
111625.300001
127653.107090
135614.130061
151161.285437
181402.421183
235444.174193
317760.070900
364274.796880
564067.654701
689679.005046
814513.514611
814879.754827
928684.675264
1180014.159159
1253742.277265
1597348.709067
2103727.878141
2574926.625435
3155277.028218
3636972.850348
9872997.205032
11236038.643421
15409738.492716
517013910.342102
2759172586.901715
5874488651.945198
116730993844.217270
meaning that if you picked the right equity-a one in 300 chance-you
would have made 116,730,993,844.217270 dollars, (against the
419,799,293,930.00 dollars if you invested in the exchange's index, or
1,159,847,554,475,297,280.00 dollars if you balanced the portfolio,
daily-which is all tsinvest did with those options; there is no clear
advantage of any stock over any other, the -i means print the index
value, -t means print the time stamp, -j means the index is not to be
balanced-it is a "traditional" index that just sums the values of the
equities at any one time, and -D 0.99 allows the program to invest in
stocks that are depreciating in value-but only if balancing the
portfolio with the stocks will enhance the growth in value of the
portfolio.)
The median gain of stocks in the above table would be, (they all
started with a value of one dollar):
G = 0.999999501^100000 = 0.951362309
which checks, (stock 150 was 0.866489, 151 0.971548.)
Why did the highest value in the distribution table =
116,730,993,844.217270? Its because it is a log normal distribution,
(ln (116730993844.217270) = 25.4831379266; 0.0283 * sqrt (100000) =
8.94924577828, or the highest valued stock was 25.4831379266 /
8.94924577828 = 2.84751794262 standard deviations, and 2.84751794262
standard deviations is 0.002203080516227658, or 1 in 453.908916971,
and 1 in 454 is very close to 1 in 300.) Which checks. (By the way, if
you take the log of the distribution table, and plot as a standard
deviation histogram, you will find that it is almost a perfect
Gaussian/normal standard deviation distribution, too.)
So, it all checks.
Why did I chose to simulate for 100,000 time intervals?
Its from the tsshannoneffective program:
tsshannoneffective -c 0.0004 0.0283 100000
For P = (sqrt (avg) + 1) / 2:
P = 0.510000
Pcomp = 0.504659
For P = (rms + 1) / 2:
P = 0.514150
Pcomp = 0.511506
For P = (avg / rms + 1) / 2:
P = 0.507067
Pcomp = 0.500640
which means that at the end of the simulation, tsinvest would have
determined the Shannon probability of all the stocks to within about
1%; 0.500640 / 0.50706713781 = 0.987324878, or about a 99% accuracy.
The point?
It is possible to make money in an equity market where the stock
values are going no where, (or even down.)
In point of fact, it is possible for the portfolio to be worth more,
and grow faster in value, than any stock in the portfolio, (or the
exchange for that matter.)
The point is that moving money around in the portfolio, intelligently,
is a very important investment concept, (in this case, the tsinvest
program was not all that intelligent; all it did was maintain equal
investments in each of ten stocks, daily.)
John
--
John Conover, john@email.johncon.com, http://www.johncon.com/