From: John Conover <john@email.johncon.com>
Subject: Quantitative Analysis of Non-Linear High Entropy Economic Systems Notes and Asides
Date: 28 Oct 2013 08:39:47 -0000
From Quantitative
Analysis of Non-Linear High Entropy Economic Systems I, in a
simple fixed increment geometric progression of the gambler's capital,
f
is the fraction of the gambler's
capital waged on each bet in the calculation of the "standard
derivation," of the increments of the gambler's capital. If the game
is not fair, the time series of the marginal increments of the
gambler's capital will have an offset,
avg
. And, the gambler's capital will
increase, or decrease, by avg + f
for a
win, and avg - f
for a loss.
Making a time series of
1/3
,-1/3
,1/3
,-1/3
,1/3
,1/3
,
... repeating forever, should yield P = 4/6 = 2/3 =
0.666666666
, and (2 * P) - 1 =
1/3
, and, the average should be
0.111111111
, and the root-mean-square
0.333333333
; tsavg
(1)
and tsrms
(1)
return these correct values, indicating that the average should NOT be
subtracted from the calculation of the sum of the squares of the
marginal increments of the gambler's capital.
Note that:
V(t) - V(t-1)
------------- ......................................(I-1.21)
V(t-1)
is the fraction of the increment between the previous value, and
the current value, of the gambler's capital, which, by definition, is
the fraction of the capital, f
, that the
gambler wagered, in the t
'th
interval.
If the marginal increments of the gambler's capital are not fixed and form a Gaussian/Normal distribution, then Half-normal_distribution, (see, also, Absolute_deviation, which is the same formula) calculations can be used, and the expectation is:
E(Y) = rms * sqrt (2 / pi) = rms * 0.79788456 ......(1.1)
for the average value of rectified Gaussian noise.
The variance is:
V(Y) = (rms^2) * (1 - (2 / pi))
= (rms^2) * 0.363380227 .......................(1.2)
See, also: the "Population Variance and Sample Variance," section, "Biased Sample Variance," in Variance.
Unfortunately, many consider this method of calculating the wagering of the gambler fragile in real world distributions often found in financial time series.
Formal root-mean-square analytical methods often yield more precise results.
Let Si
be the
i
'th element from a random distribution,
with a bias, avg
, and a deviation,
srms
:
1 n
srms^2 = - SUM (Si - avg)^2 ........................(1.3)
n i=1
1 n
= - SUM (Si^2 - 2Siavg + avg^2) .............(1.4)
n i=1
1 n 1 n
= - SUM Si^2 - - SUM 2Siavg + avg^2 .........(1.5)
n i=1 n i=1
But:
1 n
- SUM 2Si = 2avg ...................................(1.6)
n i=1
Therefore:
1 n
srms^2 = - SUM Si^2 - 2avg^2 + avg^2 ...............(1.7)
n i=1
1 n
= - SUM Si^2 - avg^2 ........................(1.8)
n i=1
And:
1 n
- SUM Si^2 = rms^2 .................................(1.9)
n i=1
srms^2 = rms^2 - avg^2 .............................(1.10)
rms^2 = srms^2 + avg^2 .............................(1.11)
1 n
Where, avg = - SUM Si ..............................(1.12)
n i=1
Further, note that the derivation is the paradigm/methodology used
in tsfraction
(1)/tsrms
(1),
and, additionally, in tsinvest
(1).
Now, aggregating N
many of the random
distributions, each with a bias, avgK
,
and a deviation, srmsK
, (1
=< K <= N, rmsK^2 = srmsK^2 + avgK^2,)
together:
1 n
srmst^2 = - SUM (S1i - avg1)^2 +
n i=1
1 n
= - SUM (S2i - avg2)^2 +
n i=1
...
1 n
= - SUM (SNi - avgN)^2 .....................(1.13)
n i=1
1 n
srmst^2 = - SUM (S1i^2 - 2S1iavg1 + avg1^2) +
n i=1
1 n
= - SUM (S2i^2 - 2S2iavg2 + avg2^2) +
n i=1
...
1 n
= - SUM (SNi^2 - 2SNiavgN + avgN^2) ........(1.14)
n i=1
1 n 1 n 1 n
srmst^2 = - SUM S1i^2 - - SUM 2S1iavg1 + - SUM avg1^2 +
n i=1 n i=1 n i=1
1 n 1 n 1 n
= - SUM S2i^2 - - SUM 2S2iavg2 + - SUM avg2^2 +
n i=1 n i=1 n i=1
...
1 n 1 n
= - SUM SNi^2 - - SUM 2SNiavgN
n i=1 n i=1
1 n
+ - SUM avgN^2 ...........................(1.15)
n i=1
For the elements from the K
'th random
distribution:
1 n
- SUM SKi^2 = rmsK^2 ...............................(1.16)
n i=1
1 n
- - SUM 2SKiavgK = -2avgK^2 ........................(1.17)
n i=1
Since:
1 n
- SUM 2SKi = 2avgK .................................(1.18)
n i=1
1 n
- SUM avgK^2 = avgK^2 ..............................(1.19)
n i=1
srmst^2 = rms1^2 - avg1^2 +
rms2^2 - avg2^2 +
...
rmsN^2 - avgN^2 ..........................(1.20)
But:
rmsK^2 - avgK^2 = srmsK^2 ..........................(1.21)
Therefore:
srmst^2 = srms1^2 + srms2^2 + ... + srmsN^2 ........(1.22)
1 n
avgt = - SUM S1i +
n i=1
1 n
- SUM S2i +
n i=1
...
1 n
- SUM SNi ...................................(1.23)
n i=1
For the elements from the K
'th random
distribution:
1 n
- SUM SKi = avgK ...................................(1.24)
n i=1
avgt = avg1 + avg2 + ... + avgN ....................(1.25)
avgt^2 = (avg1 + avg2 + ... + avgN)^2 ..............(1.26)
rmst^2 = rms1^2 + rms2^2 + ... + rmsN^2 -
(avg1^2 + avg2^2 + ... + avgN^2) +
(avg1 + avg2 + ... + avgN)^2 ..............(1.27)
Note that the srmsK
terms add
root-mean-square, and the avgK
terms add
linearly, where srmsK^2 = rmsK^2 -
avgK^2
.
Further, as an approximation when 0 << avgK
<< rmsK << 1
:
rmst^2 ~ rms1^2 + rms2^2 + ... + rmsN^2
which is the method used in the tsinvest
(1)
program to optimize portfolio asset allocation, (and decreasing
PK
, due to the uncertainty created by
limited data set size, i.e., decreasing
avgK
, and/or increasing
rmsK
, via Standard Error
methodology.) Note, however, determination of the value of
srms
is not necessary for precisely
calculating the gain, g
, and/or, the Kelly
Criteria, of an asset's value-only the value of
rms
, (and
avg
,) of an asset are required.
For optimal leverage, (or margin,) let
V(t)
be a geometric Brownian motion
fractal representing an asset's prices, with the
t
'th marginal return:
V(t) - V(t-1)
------------- ......................................(I-1.21)
V(t-1)
The mean of the marginal returns is
avg
.
The square root of the variance of the marginal returns is
rms
.
Then the probability of an "up movement" in any marginal
return, P
, is:
avg
--- + 1
rms
P = ------- ........................................(I-1.24)
2
And, the median gain, g
, of the
marginal returns is:
P (1 - P)
g = (1 + rms) (1 - rms) ....................(I-1.20)
which is maximal when:
2
avg = rms .........................................(I-1.26)
which makes:
rms = 2 P - 1 ......................................(I-1.18)
by substitution into the equation for
P
.
Let V
be the value of an investment
at some time, t
, and
M
be the fraction of
V
purchased on margin, 0
<= M <= 1
, and, I
be the
fraction of V
invested, 0
<= I <= 1
, where M + I =
1
and M * V
is the
amount of the margin, and I * V
is the
amount invested. Letting rmsi be the root mean square of the variance
of the investment:
V
rmsi = rms * -----------
V - (M * V)
1
= rms * ----- = (2 * P) - 1 ...................(1.28)
1 - M
Or:
rms
M = 1 - ----------- ................................(1.29)
(2 * P) - 1
which would maximize the growth, g
,
of the amount invested, I * V
, provided
P > 0.5, avg > 0
, and both
avg
and
rms
are too small, (which is frequently
the case.)
Reducing:
P = ((avg / rms) + 1) / 2 ..........................(1.30)
rms
M = 1 - ----------- ................................(1.31)
(2 * P) - 1
rms
M = 1 - --------------------------------- ..........(1.32)
(2 * (((avg / rms) + 1) / 2)) - 1
rms
M = 1 - --------------------- ......................(1.33)
((avg / rms) + 1) - 1
rms
M = 1 - ----------- ................................(1.34)
(avg / rms)
rms^2
M = 1 - ----- ......................................(1.35)
avg
And, by substitution, the formula for optimal leverage:
rms
M = 1 - ----------- ................................(1.36)
(2 * P) - 1
which is the method used in the tsinvest
(1)
program to maximize Return on
Investment, (ROI,) and, if M = 0
the
investment is at fair value, relative to its metric of risk,
srms
.
For optimal asset allocation, let
V(t)
be a geometric Brownian motion
fractal representing an asset's prices, with the
t
'th marginal return:
V(t) - V(t-1)
------------- ......................................(I-1.21)
V(t-1)
And many such assets assembled in a portfolio, each asset
representing a fraction, cn
, of the
total value of the portfolio, where:
c1 + c2 + c3 + ... + cN = 1 ........................(1.37)
Then the portfolio avg
,
avgp
, would be:
avgp = (c1 * avg1) + (c2 * avg2) +
(c3 * avg3) + ... + (cN * avgN) .............(1.38)
since the avgn
's add
linearly.
And, from Equation
(1.10), the deviation of the n
'th
asset, srmsn
:
srmsn = sqrt (rmsn^2 - avgn^2) .....................(1.39)
Which add root-mean-square:
srmsp = sqrt ((c1 * srms1)^2 + (c2 * srms2)^2 +
(c3 * srms3)^2 + ... + (cN * avgN)^2) ......(1.40)
Yielding, from Equation
(1.11), the rms
of the portfolio,
rmsp
:
rmsp = sqrt (srmsp^2 + avgp^2) .....................(1.41)
The values of the asset allocations in the portfolio,
c1
, c2
,
c3
... cN
,
can be optimized:
avg
--- + 1
rms
P = ------- ........................................(I-1.24)
2
where, for each asset:
rms = 2 P - 1 ......................................(I-1.18)
and substituting:
c = 2 P - 1 = avg / rms ............................(1.42)
Or, for the n
'th asset:
cn * avgn = avgn^2 / rmsn ..........................(1.43)
Which is the asset's contribution to the portfolio's
avgp
.
And the asset's contribution to the portfolio's
rmsp
:
cn * rmsn = avgn ...................................(1.44)
Where the asset's contribution to the portfolio's
srmsp
:
srmsn = sqrt (rmsn^2 - avgn^2) .....................(1.45)
Yielding the following useful equation:
cn * srmsn = cn * sqrt (rmsn^2 - avgn^2) ...........(1.46)
Where each asset's cn * avgn
add
linearly to produce the portfolio's
avgp
, and each asset's cn
* srmsn
add root-mean-square, to produce the
portfolio's srmsp
, and using Equation
(1.11), to produce the portfolio's
rmsp
, with the asset allocations,
c1
, c2
,
c3
... cN
,
optimized, which is the method used in the tsinvest
(1)
program to optimize portfolio asset allocation. Note, however,
determination of the value of srms
is
not necessary for precisely calculating optimal asset allocations-only
the value of rms
, (and
avg
,) for each asset are required.
Let V(t)
be a geometric Brownian
motion fractal representing an asset's prices, with the
t
'th marginal return:
V(t) - V(t-1)
------------- ......................................(I-1.21)
V(t-1)
The mean of the marginal returns is
avg
.
The square root of the variance of the marginal returns is
rms
.
Then the probability of an "up movement" in any marginal
return, P
, is:
avg
--- + 1
rms
P = ------- ........................................(I-1.24)
2
And, the median gain, g
, of the
marginal returns is:
P (1 - P)
g = (1 + rms) (1 - rms) ....................(I-1.20)
which can be implemented as a Kalman Filter,
and as more data is acquired, the accuracy of the values of
avg
and
rms
, (and thus
P
and g
,)
increases. (A device that searches, sorts, and, collates data is,
technically, an information automaton, or information robot,
or just 'bot.)
A reasonable question to be answered is how much accuracy is necessary?
Methodologies such as Standard Error
are often used, but the question can be rephrased: What are the
chances, of measuring t
many marginal
increments, where by serendipity, the measurements were all made in a
"bubble", (i.e., the values in the measurement interval were
all above, or below, their median value)?
The chances of (at least,) t
many
marginal increments, between zero crossings of an asset's median
value, is erf (1 / sqrt (t))
,
(erf (1 / sqrt (t)) ~ 1 / sqrt (t)
for
t >> 1
).
Giving a convenient reduction in the value of
P
in Equation (I-1.24)
by a factor of 1 - erf (1 / sqrt (t))
to
estimate the likelihood of "up movement" in the next marginal
return-compensating for the uncertainty of insufficient data set
size.
In general, calculating the probabilities will require solving for
the area of a section of the Normal/Gaussian distribution, (or
cumulative distribution,) which is expedient if a unit Normal/Gaussian
distribution is constructed as a table in memory, and a binary search
implemented since such a table is monotonic, which is the method used
in the tsinvest
(1)
program.
-- John Conover, john@email.johncon.com, http://www.johncon.com/