muS.10ex: 10 Assets Example Data from Markowitz & Todd

Description Usage Format Source References Examples

Description

The simple example Data of Markowitz and Todd (2000); used for illustrating the CLA; reused in Bailey and López de Prado (2013).

Usage

1
data("muS.10ex")

Format

A list with two components,

mu

Named num [1:10] 1.175 1.19 0.396 1.12 0.346 ...
names : chr [1:10] "X1" "X2" "X3" "X4" ...

covar

num [1:10, 1:10] 0.4076 0.0318 0.0518 0.0566 0.033 ...

Source

From ‘http://www.quantresearch.info/CLA_Data.csv.txt’ (URL no longer working, Aug.2020!) by López de Prado.

References

Markowitz, H. M. (1987, 1st ed.) and Markowitz, H. M. and Todd, P. G. (2000) Mean-Variance Analysis in Portfolio Choice and Capital Markets, page 335.

Bailey, D. H. and López de Prado, M. (2013) An open-source implementation of the critical-line algorithm for portfolio optimization, Algorithms 6(1), 169–196; doi: 10.3390/a6010169, p. 16f.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
data(muS.10ex)
str(muS.10ex)

CLA.10ex <- with(muS.10ex, CLA(mu, covar, lB=0, uB=1))
if(require("Matrix"))
  drop0(zapsmall(CLA.10ex$weights_set))
## The results, summarized, as in Bayley and López de Prado (Table 2, p.18) :
with(CLA.10ex, round(cbind(MS_weights[,2:1], lambda=lambdas, t(weights_set)), 3))

CLA.10ex.1c <- with(muS.10ex, CLA(mu, covar, lB=1/100, uB=1))
round(CLA.10ex.1c$weights_set, 3)

Example output

List of 2
 $ mu   : Named num [1:10] 1.175 1.19 0.396 1.12 0.346 ...
  ..- attr(*, "names")= chr [1:10] "X1" "X2" "X3" "X4" ...
 $ covar: num [1:10, 1:10] 0.4076 0.0318 0.0518 0.0566 0.033 ...
Loading required package: Matrix
10 x 10 sparse Matrix of class "dgCMatrix"
                                                                           
X1  . 0.6493694 0.4339841 0.1268879 0.1232010 0.0869215 0.0846709 0.0737893
X2  1 0.3506306 0.2312475 0.0723433 0.0704441 0.0504510 0.0492539 0.0438287
X3  . .         .         .         .         .         .         .        
X4  . .         0.3347684 0.2812537 0.2789936 0.2235940 0.2196339 0.1989756
X5  . .         .         .         .         .         .         0.0261582
X6  . .         .         .         .         0.1738316 0.1800392 0.1981519
X7  . .         .         .         .         .         .         .        
X8  . .         .         .         0.0064356 0.0301730 0.0310298 0.0334196
X9  . .         .         .         .         .         0.0064857 0.0279030
X10 . .         .         0.5195150 0.5209258 0.4350288 0.4288866 0.3977739
                       
X1  0.0683440 0.0369686
X2  0.0413870 0.0269008
X3  0.0152153 0.0949424
X4  0.1881344 0.1257760
X5  0.0341625 0.0767461
X6  0.2023194 0.2193557
X7  .         0.0299871
X8  0.0339293 0.0359633
X9  0.0336326 0.0613498
X10 0.3828754 0.2920102
         Mu   Sig lambda    X1    X2    X3    X4    X5    X6   X7    X8    X9
 [1,] 1.190 0.952 58.303 0.000 1.000 0.000 0.000 0.000 0.000 0.00 0.000 0.000
 [2,] 1.180 0.546  4.174 0.649 0.351 0.000 0.000 0.000 0.000 0.00 0.000 0.000
 [3,] 1.160 0.417  1.946 0.434 0.231 0.000 0.335 0.000 0.000 0.00 0.000 0.000
 [4,] 1.111 0.267  0.165 0.127 0.072 0.000 0.281 0.000 0.000 0.00 0.000 0.000
 [5,] 1.108 0.265  0.147 0.123 0.070 0.000 0.279 0.000 0.000 0.00 0.006 0.000
 [6,] 1.022 0.230  0.056 0.087 0.050 0.000 0.224 0.000 0.174 0.00 0.030 0.000
 [7,] 1.015 0.228  0.052 0.085 0.049 0.000 0.220 0.000 0.180 0.00 0.031 0.006
 [8,] 0.973 0.220  0.037 0.074 0.044 0.000 0.199 0.026 0.198 0.00 0.033 0.028
 [9,] 0.950 0.216  0.031 0.068 0.041 0.015 0.188 0.034 0.202 0.00 0.034 0.034
[10,] 0.803 0.205  0.000 0.037 0.027 0.095 0.126 0.077 0.219 0.03 0.036 0.061
        X10
 [1,] 0.000
 [2,] 0.000
 [3,] 0.000
 [4,] 0.520
 [5,] 0.521
 [6,] 0.435
 [7,] 0.429
 [8,] 0.398
 [9,] 0.383
[10,] 0.292
    [,1]  [,2]  [,3]  [,4]  [,5]  [,6]  [,7]  [,8]  [,9] [,10]
X1  0.01 0.597 0.402 0.115 0.112 0.079 0.078 0.069 0.058 0.037
X2  0.91 0.323 0.215 0.066 0.065 0.047 0.046 0.042 0.037 0.027
X3  0.01 0.010 0.010 0.010 0.010 0.010 0.010 0.010 0.042 0.095
X4  0.01 0.010 0.313 0.263 0.258 0.209 0.207 0.190 0.167 0.126
X5  0.01 0.010 0.010 0.010 0.010 0.010 0.010 0.032 0.048 0.077
X6  0.01 0.010 0.010 0.010 0.026 0.181 0.184 0.199 0.208 0.219
X7  0.01 0.010 0.010 0.010 0.010 0.010 0.010 0.010 0.010 0.030
X8  0.01 0.010 0.010 0.010 0.010 0.031 0.032 0.034 0.035 0.036
X9  0.01 0.010 0.010 0.010 0.010 0.010 0.013 0.031 0.043 0.061
X10 0.01 0.010 0.010 0.496 0.489 0.412 0.409 0.384 0.353 0.292

CLA documentation built on Dec. 16, 2021, 5:07 p.m.