first commit

This commit is contained in:
2021-11-15 21:14:51 +01:00
commit 5a31fc8f33
63 changed files with 57408 additions and 0 deletions

BIN
Problemsets/.DS_Store vendored Normal file

Binary file not shown.

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,613 @@
Date,SmallGrowth,LargeValue,Market
1970-01-01,-5.48,-4.875,-8.1
1970-02-01,1.465,7.546,5.13
1970-03-01,-7.232,1.061,-1.06
1970-04-01,-24.488,-8.481,-11.0
1970-05-01,-10.808,-4.552,-6.92
1970-06-01,-12.834,-8.749,-5.79
1970-07-01,4.862,5.726,6.93
1970-08-01,4.64,5.883,4.49
1970-09-01,21.801,3.943,4.18
1970-10-01,-12.134,-4.378,-2.28
1970-11-01,-5.227,5.534,4.6
1970-12-01,6.418,6.491,5.72
1971-01-01,15.029,3.907,4.84
1971-02-01,7.725,0.937,1.41
1971-03-01,7.754,2.246,4.13
1971-04-01,0.584,5.963,3.15
1971-05-01,-6.92,-3.829,-3.98
1971-06-01,-1.05,-0.564,-0.1
1971-07-01,-9.103,-5.887,-4.5
1971-08-01,2.874,13.117,3.79
1971-09-01,1.143,-2.519,-0.85
1971-10-01,-8.265,-4.386,-4.42
1971-11-01,-3.762,-0.087,-0.46
1971-12-01,14.068,8.569,8.71
1972-01-01,13.088,6.093,2.49
1972-02-01,2.516,-0.186,2.87
1972-03-01,2.505,2.59,0.63
1972-04-01,-1.651,-1.378,0.29
1972-05-01,-1.939,-2.966,1.25
1972-06-01,-4.608,-6.964,-2.43
1972-07-01,-7.521,-1.893,-0.8
1972-08-01,-1.859,6.016,3.26
1972-09-01,-5.28,-3.957,-1.14
1972-10-01,-4.095,0.399,0.52
1972-11-01,-0.403,13.583,4.6
1972-12-01,-2.22,-3.17,0.62
1973-01-01,-8.346,-4.609,-3.29
1973-02-01,-14.592,-3.788,-4.85
1973-03-01,-7.226,1.08,-1.3
1973-04-01,-12.277,-3.424,-5.68
1973-05-01,-11.85,-6.19,-2.94
1973-06-01,-5.898,-2.439,-1.56
1973-07-01,18.219,3.58,5.05
1973-08-01,-6.005,0.082,-3.82
1973-09-01,11.269,7.588,4.75
1973-10-01,-3.255,1.898,-0.83
1973-11-01,-25.643,-8.808,-12.75
1973-12-01,-4.478,10.494,0.61
1974-01-01,9.816,-0.712,-0.17
1974-02-01,-0.986,3.233,-0.47
1974-03-01,-0.462,-5.319,-2.81
1974-04-01,-5.388,-6.171,-5.29
1974-05-01,-8.878,-8.554,-4.68
1974-06-01,-4.299,0.97,-2.83
1974-07-01,-9.245,-5.804,-8.05
1974-08-01,-9.834,-9.243,-9.35
1974-09-01,-14.269,-7.436,-11.77
1974-10-01,16.45,0.803,16.1
1974-11-01,-6.6,-4.646,-4.51
1974-12-01,-7.854,1.178,-3.45
1975-01-01,24.883,15.084,13.66
1975-02-01,7.319,-3.674,5.56
1975-03-01,8.548,5.741,2.66
1975-04-01,6.68,4.582,4.23
1975-05-01,11.216,0.516,5.19
1975-06-01,5.331,7.015,4.83
1975-07-01,-2.088,-2.035,-6.59
1975-08-01,-7.603,-4.944,-2.85
1975-09-01,-5.759,-5.884,-4.26
1975-10-01,0.839,3.341,5.31
1975-11-01,-0.406,4.27,2.64
1975-12-01,-1.526,4.768,-1.6
1976-01-01,15.261,14.693,12.16
1976-02-01,9.544,9.098,0.32
1976-03-01,3.162,-1.411,2.32
1976-04-01,-1.853,0.724,-1.49
1976-05-01,-2.126,1.012,-1.34
1976-06-01,3.835,2.513,4.05
1976-07-01,-1.592,2.176,-1.07
1976-08-01,-4.748,0.639,-0.56
1976-09-01,1.777,-1.063,2.07
1976-10-01,-3.205,-4.421,-2.42
1976-11-01,5.318,3.951,0.36
1976-12-01,10.437,7.195,5.65
1977-01-01,2.484,-0.51,-4.05
1977-02-01,-0.83,-1.284,-1.94
1977-03-01,-0.308,-0.159,-1.37
1977-04-01,0.873,5.613,0.15
1977-05-01,-2.14,-3.383,-1.45
1977-06-01,5.403,1.592,4.71
1977-07-01,0.824,-5.293,-1.69
1977-08-01,0.59,-4.644,-1.75
1977-09-01,1.836,-0.542,-0.27
1977-10-01,-5.073,-4.086,-4.38
1977-11-01,9.05,4.19,4.0
1977-12-01,4.317,0.858,0.27
1978-01-01,-1.692,-3.42,-6.01
1978-02-01,2.814,-4.084,-1.38
1978-03-01,7.743,2.867,2.85
1978-04-01,9.715,4.738,7.88
1978-05-01,8.014,1.475,1.76
1978-06-01,0.249,-1.349,-1.69
1978-07-01,5.965,4.197,5.11
1978-08-01,9.118,-0.332,3.75
1978-09-01,-1.636,0.273,-1.43
1978-10-01,-27.398,-12.797,-11.91
1978-11-01,7.99,1.846,2.71
1978-12-01,2.789,-1.529,0.88
1979-01-01,9.216,6.868,4.23
1979-02-01,-3.65,-3.547,-3.56
1979-03-01,11.309,5.709,5.68
1979-04-01,2.378,-1.787,-0.06
1979-05-01,-3.451,-2.146,-2.21
1979-06-01,5.213,1.913,3.85
1979-07-01,1.583,2.897,0.82
1979-08-01,8.104,4.534,5.53
1979-09-01,-0.967,-0.338,-0.82
1979-10-01,-11.852,-8.037,-8.1
1979-11-01,9.941,0.011,5.21
1979-12-01,10.403,1.32,1.79
1980-01-01,11.915,9.429,5.51
1980-02-01,-0.334,1.6,-1.22
1980-03-01,-23.288,-14.096,-12.9
1980-04-01,5.008,1.603,3.97
1980-05-01,6.35,5.328,5.26
1980-06-01,4.369,-0.361,3.06
1980-07-01,11.666,4.724,6.49
1980-08-01,10.789,-0.556,1.8
1980-09-01,5.863,-0.719,2.19
1980-10-01,6.703,-0.133,1.06
1980-11-01,15.272,3.036,9.59
1980-12-01,-7.662,-1.756,-4.52
1981-01-01,-5.571,0.946,-5.04
1981-02-01,-4.41,-1.685,0.57
1981-03-01,6.077,6.957,3.56
1981-04-01,1.974,-4.037,-2.11
1981-05-01,3.874,-0.598,0.11
1981-06-01,-8.49,-0.328,-2.36
1981-07-01,-5.769,-0.637,-1.54
1981-08-01,-13.971,-1.673,-7.04
1981-09-01,-14.816,-0.76,-7.17
1981-10-01,9.22,3.597,4.92
1981-11-01,-2.194,2.697,3.36
1981-12-01,-5.144,-2.664,-3.65
1982-01-01,-3.957,0.633,-3.24
1982-02-01,-8.833,-4.84,-5.86
1982-03-01,-3.018,1.056,-1.87
1982-04-01,5.374,-0.584,3.27
1982-05-01,-4.163,-2.318,-3.99
1982-06-01,-5.372,-3.838,-3.09
1982-07-01,-4.799,-2.879,-3.19
1982-08-01,4.057,11.702,11.14
1982-09-01,1.799,-0.348,1.29
1982-10-01,17.058,5.357,11.3
1982-11-01,8.406,1.045,4.67
1982-12-01,1.965,5.254,0.55
1983-01-01,12.851,2.076,3.6
1983-02-01,2.483,1.785,2.59
1983-03-01,2.214,1.202,2.82
1983-04-01,6.654,6.525,6.67
1983-05-01,11.254,0.479,0.52
1983-06-01,3.47,-0.017,3.07
1983-07-01,-6.851,-2.91,-4.07
1983-08-01,-6.796,5.86,-0.5
1983-09-01,-3.826,-0.256,0.91
1983-10-01,-11.252,-1.434,-3.44
1983-11-01,2.986,-0.079,2.16
1983-12-01,-5.796,-0.189,-1.78
1984-01-01,-2.719,6.219,-1.92
1984-02-01,-8.141,-0.031,-4.82
1984-03-01,-1.752,-2.186,0.63
1984-04-01,-4.803,1.616,-0.51
1984-05-01,-6.983,-6.834,-5.97
1984-06-01,0.242,4.59,1.82
1984-07-01,-8.053,-3.178,-2.74
1984-08-01,10.726,12.016,10.28
1984-09-01,-3.508,2.659,-0.8
1984-10-01,-4.862,-2.404,-0.84
1984-11-01,-6.414,0.594,-1.76
1984-12-01,-0.153,1.469,1.84
1985-01-01,15.272,3.871,7.99
1985-02-01,3.237,2.092,1.22
1985-03-01,-3.291,0.943,-0.84
1985-04-01,-2.893,2.238,-0.96
1985-05-01,1.839,4.12,5.09
1985-06-01,0.039,1.669,1.27
1985-07-01,1.861,-2.971,-0.74
1985-08-01,-2.084,0.217,-1.02
1985-09-01,-8.733,-4.719,-4.54
1985-10-01,0.029,5.73,4.02
1985-11-01,4.875,4.097,6.48
1985-12-01,2.949,3.755,3.88
1986-01-01,3.24,0.85,0.65
1986-02-01,5.262,6.668,7.13
1986-03-01,4.022,3.959,4.88
1986-04-01,2.23,-3.257,-1.31
1986-05-01,3.623,5.058,4.62
1986-06-01,-0.365,2.413,1.03
1986-07-01,-10.631,-3.231,-6.45
1986-08-01,-0.173,10.315,6.07
1986-09-01,-8.411,-6.837,-8.6
1986-10-01,1.486,5.502,4.66
1986-11-01,-2.595,1.199,1.17
1986-12-01,-5.987,-3.418,-3.27
1987-01-01,10.7,11.56,12.47
1987-02-01,10.191,-1.448,4.39
1987-03-01,1.665,4.324,1.64
1987-04-01,-2.761,-0.787,-2.11
1987-05-01,-0.612,0.136,0.11
1987-06-01,-0.646,4.888,3.94
1987-07-01,1.324,2.607,3.85
1987-08-01,0.328,2.142,3.52
1987-09-01,-3.294,-3.178,-2.59
1987-10-01,-34.931,-19.329,-23.24
1987-11-01,-8.849,-7.755,-7.77
1987-12-01,2.511,5.862,6.81
1988-01-01,5.701,8.359,4.21
1988-02-01,5.532,2.396,4.75
1988-03-01,3.738,-1.249,-2.27
1988-04-01,0.524,1.814,0.56
1988-05-01,-4.132,1.703,-0.29
1988-06-01,5.97,2.518,4.79
1988-07-01,-1.381,0.506,-1.25
1988-08-01,-4.732,-3.704,-3.31
1988-09-01,0.507,3.171,3.3
1988-10-01,-3.488,3.855,1.15
1988-11-01,-5.514,-0.112,-2.29
1988-12-01,1.2,-0.128,1.49
1989-01-01,4.675,7.542,6.1
1989-02-01,-1.628,-3.134,-2.25
1989-03-01,0.619,0.617,1.57
1989-04-01,2.261,3.205,4.33
1989-05-01,2.078,2.459,3.35
1989-06-01,-3.993,0.225,-1.35
1989-07-01,2.096,5.981,7.2
1989-08-01,1.487,2.199,1.44
1989-09-01,0.545,-1.15,-0.76
1989-10-01,-5.773,-0.929,-3.67
1989-11-01,-1.32,0.427,1.03
1989-12-01,-1.436,0.41,1.16
1990-01-01,-8.814,-6.348,-7.85
1990-02-01,1.434,1.533,1.11
1990-03-01,3.757,0.495,1.83
1990-04-01,-3.17,-4.856,-3.36
1990-05-01,7.526,7.149,8.42
1990-06-01,0.646,-0.933,-1.09
1990-07-01,-5.585,-2.712,-1.9
1990-08-01,-17.13,-11.245,-10.15
1990-09-01,-11.234,-8.012,-6.12
1990-10-01,-7.165,0.262,-1.92
1990-11-01,2.734,3.776,6.35
1990-12-01,-0.361,0.206,2.46
1991-01-01,6.921,3.441,4.69
1991-02-01,14.11,7.477,7.19
1991-03-01,9.909,0.753,2.65
1991-04-01,0.645,-0.694,-0.28
1991-05-01,2.061,6.433,3.65
1991-06-01,-7.358,-4.384,-4.94
1991-07-01,2.228,-1.44,4.24
1991-08-01,3.299,1.117,2.32
1991-09-01,3.787,-3.403,-1.59
1991-10-01,6.671,0.846,1.29
1991-11-01,-2.442,-9.682,-4.19
1991-12-01,6.319,13.943,10.84
1992-01-01,14.279,6.094,-0.59
1992-02-01,-0.362,10.578,1.09
1992-03-01,-6.928,0.368,-2.66
1992-04-01,-10.41,9.846,1.07
1992-05-01,-1.57,-0.544,0.3
1992-06-01,-9.48,2.649,-2.34
1992-07-01,0.426,-0.656,3.77
1992-08-01,-4.95,-8.846,-2.38
1992-09-01,0.118,-0.16,1.19
1992-10-01,2.41,-0.234,1.02
1992-11-01,10.095,8.2,4.13
1992-12-01,1.256,2.618,1.53
1993-01-01,2.65,8.967,0.93
1993-02-01,-7.671,1.733,0.12
1993-03-01,0.336,3.114,2.3
1993-04-01,-4.558,0.811,-3.05
1993-05-01,5.254,-0.711,2.89
1993-06-01,-1.805,4.398,0.31
1993-07-01,-1.914,-0.502,-0.34
1993-08-01,3.467,3.819,3.71
1993-09-01,2.13,-0.942,-0.12
1993-10-01,5.012,-0.803,1.41
1993-11-01,-4.313,0.576,-1.89
1993-12-01,0.534,1.499,1.65
1994-01-01,2.38,2.629,2.87
1994-02-01,-3.427,-5.087,-2.55
1994-03-01,-8.029,-4.13,-4.78
1994-04-01,-4.275,1.74,0.68
1994-05-01,-2.853,3.157,0.58
1994-06-01,-6.932,-4.119,-3.03
1994-07-01,0.053,1.036,2.82
1994-08-01,3.133,3.104,4.01
1994-09-01,0.579,-6.52,-2.31
1994-10-01,-1.282,2.169,1.34
1994-11-01,-4.868,-2.988,-4.04
1994-12-01,-3.532,-0.82,0.86
1995-01-01,0.985,6.307,1.8
1995-02-01,1.815,6.895,3.63
1995-03-01,0.449,0.646,2.19
1995-04-01,1.216,5.671,2.11
1995-05-01,1.075,5.436,2.9
1995-06-01,7.425,1.484,2.72
1995-07-01,6.583,2.765,3.72
1995-08-01,3.648,3.6,0.55
1995-09-01,2.999,6.513,3.35
1995-10-01,-6.56,-4.041,-1.52
1995-11-01,1.336,4.402,3.96
1995-12-01,2.014,1.448,1.03
1996-01-01,1.165,4.029,2.26
1996-02-01,3.426,2.316,1.33
1996-03-01,2.476,0.083,0.73
1996-04-01,8.139,-2.034,2.06
1996-05-01,7.478,1.914,2.36
1996-06-01,-8.163,0.133,-1.14
1996-07-01,-15.564,-5.013,-5.97
1996-08-01,4.25,2.696,2.77
1996-09-01,1.864,4.745,5.01
1996-10-01,-6.039,4.373,0.86
1996-11-01,-1.053,6.271,6.25
1996-12-01,-1.182,-1.793,-1.7
1997-01-01,5.964,3.454,4.98
1997-02-01,-6.342,4.706,-0.49
1997-03-01,-10.017,-5.895,-5.02
1997-04-01,-5.907,0.888,4.04
1997-05-01,12.202,6.078,6.74
1997-06-01,3.662,3.626,4.1
1997-07-01,3.125,7.745,7.33
1997-08-01,5.28,-6.226,-4.15
1997-09-01,10.008,6.909,5.35
1997-10-01,-6.085,-3.352,-3.8
1997-11-01,-3.745,3.171,2.98
1997-12-01,-6.551,2.602,1.32
1998-01-01,-0.218,0.227,0.15
1998-02-01,5.869,6.609,7.04
1998-03-01,4.123,6.669,4.76
1998-04-01,2.094,-1.863,0.73
1998-05-01,-6.964,-1.33,-3.07
1998-06-01,-0.859,0.538,3.18
1998-07-01,-8.118,-2.737,-2.46
1998-08-01,-28.392,-12.946,-16.08
1998-09-01,6.596,9.46,6.15
1998-10-01,3.077,2.901,7.13
1998-11-01,9.939,4.621,6.1
1998-12-01,4.684,4.651,6.16
1999-01-01,7.543,-0.588,3.5
1999-02-01,-7.903,-1.568,-4.08
1999-03-01,-2.796,1.632,3.45
1999-04-01,7.175,1.871,4.33
1999-05-01,1.606,2.584,-2.46
1999-06-01,6.485,-0.364,4.77
1999-07-01,0.572,-9.442,-3.49
1999-08-01,-3.804,-1.284,-1.38
1999-09-01,1.475,-9.174,-2.79
1999-10-01,-0.536,5.305,6.12
1999-11-01,19.126,-0.868,3.37
1999-12-01,24.726,-1.938,7.72
2000-01-01,9.104,-9.93,-4.74
2000-02-01,36.81,-11.759,2.45
2000-03-01,-14.146,21.517,5.2
2000-04-01,-23.655,-0.676,-6.4
2000-05-01,-14.848,7.191,-4.42
2000-06-01,27.997,-4.128,4.64
2000-07-01,-9.45,1.831,-2.51
2000-08-01,8.774,5.2,7.03
2000-09-01,-11.565,-2.147,-5.45
2000-10-01,-13.026,2.813,-2.76
2000-11-01,-21.778,0.038,-10.72
2000-12-01,-10.659,-0.058,1.19
2001-01-01,27.64,1.032,3.13
2001-02-01,-13.81,3.913,-10.05
2001-03-01,-13.312,-3.065,-7.26
2001-04-01,9.228,7.051,7.94
2001-05-01,12.361,5.377,0.72
2001-06-01,2.264,-3.346,-1.94
2001-07-01,-9.11,7.271,-2.13
2001-08-01,-8.593,-8.659,-6.46
2001-09-01,-16.466,1.355,-9.25
2001-10-01,8.853,-14.857,2.46
2001-11-01,6.121,11.118,7.54
2001-12-01,13.045,1.157,1.61
2002-01-01,-8.246,-9.326,-1.44
2002-02-01,-10.629,-12.893,-2.29
2002-03-01,5.59,-0.02,4.24
2002-04-01,-10.28,-22.297,-5.2
2002-05-01,-7.108,-7.847,-1.38
2002-06-01,-8.926,-13.694,-7.21
2002-07-01,-19.652,-14.825,-8.18
2002-08-01,-0.121,8.181,0.5
2002-09-01,-11.181,-6.331,-10.35
2002-10-01,6.1,13.993,7.84
2002-11-01,17.892,6.929,5.96
2002-12-01,-10.364,-9.849,-5.76
2003-01-01,-0.238,-5.686,-2.57
2003-02-01,-6.478,-5.011,-1.88
2003-03-01,2.094,-3.05,1.09
2003-04-01,12.452,14.718,8.22
2003-05-01,20.564,7.756,6.05
2003-06-01,6.097,3.564,1.42
2003-07-01,8.68,1.236,2.35
2003-08-01,4.237,1.354,2.34
2003-09-01,3.293,-4.242,-1.24
2003-10-01,5.985,2.687,6.08
2003-11-01,2.743,2.839,1.35
2003-12-01,0.162,4.891,4.29
2004-01-01,5.966,6.662,2.15
2004-02-01,-0.059,5.476,1.4
2004-03-01,-1.642,-1.147,-1.32
2004-04-01,-4.572,-2.088,-1.83
2004-05-01,-1.778,1.179,1.17
2004-06-01,0.854,2.288,1.86
2004-07-01,-13.045,-0.993,-4.06
2004-08-01,-1.704,-0.217,0.08
2004-09-01,4.253,3.621,1.6
2004-10-01,1.131,2.535,1.43
2004-11-01,10.675,5.904,4.54
2004-12-01,5.33,2.611,3.43
2005-01-01,-6.511,0.214,-2.76
2005-02-01,-1.276,4.906,1.89
2005-03-01,-6.436,-0.755,-1.97
2005-04-01,-5.969,-2.832,-2.61
2005-05-01,6.428,3.969,3.65
2005-06-01,3.639,3.053,0.57
2005-07-01,7.424,3.973,3.92
2005-08-01,-3.127,-0.661,-1.22
2005-09-01,0.79,1.904,0.49
2005-10-01,-3.77,-1.387,-2.02
2005-11-01,4.946,2.037,3.61
2005-12-01,-0.675,-0.791,-0.25
2006-01-01,11.466,3.447,3.04
2006-02-01,-0.826,-1.514,-0.3
2006-03-01,3.696,0.445,1.46
2006-04-01,-1.394,4.986,0.73
2006-05-01,-9.914,-3.002,-3.57
2006-06-01,-1.3,0.987,-0.35
2006-07-01,-6.239,2.435,-0.78
2006-08-01,3.14,-0.622,2.03
2006-09-01,-0.593,3.872,1.84
2006-10-01,6.783,4.178,3.23
2006-11-01,0.572,-0.366,1.71
2006-12-01,0.21,2.692,0.87
2007-01-01,1.031,2.165,1.4
2007-02-01,-1.203,-3.469,-1.96
2007-03-01,0.018,-0.928,0.68
2007-04-01,2.857,4.351,3.49
2007-05-01,1.816,2.266,3.24
2007-06-01,-0.044,-2.603,-1.96
2007-07-01,-5.868,-5.29,-3.73
2007-08-01,0.584,-0.347,0.92
2007-09-01,1.844,3.887,3.22
2007-10-01,3.181,-0.752,1.8
2007-11-01,-10.235,-5.791,-4.83
2007-12-01,-1.244,1.034,-0.87
2008-01-01,-11.523,-4.773,-6.36
2008-02-01,-5.938,-5.501,-3.09
2008-03-01,-3.863,0.931,-0.93
2008-04-01,3.388,6.001,4.6
2008-05-01,5.467,1.668,1.86
2008-06-01,-6.342,-10.217,-8.44
2008-07-01,4.872,7.964,-0.77
2008-08-01,0.885,-0.478,1.53
2008-09-01,-13.399,-4.041,-9.24
2008-10-01,-23.606,-13.611,-17.23
2008-11-01,-13.07,-17.865,-7.86
2008-12-01,2.79,3.71,1.74
2009-01-01,-6.87,-14.319,-8.12
2009-02-01,-11.135,-12.35,-10.1
2009-03-01,11.056,10.91,8.95
2009-04-01,19.143,20.242,10.18
2009-05-01,6.138,9.93,5.21
2009-06-01,7.723,-2.783,0.43
2009-07-01,8.657,9.442,7.72
2009-08-01,2.944,12.003,3.33
2009-09-01,4.556,2.567,4.08
2009-10-01,-10.592,-9.417,-2.59
2009-11-01,-0.486,4.264,5.56
2009-12-01,6.133,-3.057,2.75
2010-01-01,-4.179,-2.656,-3.36
2010-02-01,4.014,5.636,3.4
2010-03-01,6.866,8.288,6.31
2010-04-01,6.485,-0.498,2.0
2010-05-01,-6.948,-8.103,-7.89
2010-06-01,-6.499,-9.347,-5.57
2010-07-01,6.253,5.325,6.93
2010-08-01,-8.726,-8.952,-4.77
2010-09-01,11.603,6.979,9.54
2010-10-01,6.453,-0.239,3.88
2010-11-01,1.535,-3.261,0.6
2010-12-01,10.168,13.91,6.82
2011-01-01,-2.948,3.314,1.99
2011-02-01,1.482,3.954,3.49
2011-03-01,3.553,-3.259,0.46
2011-04-01,2.714,1.119,2.9
2011-05-01,-1.041,-3.751,-1.27
2011-06-01,-4.507,-2.769,-1.75
2011-07-01,-5.042,-5.069,-2.35
2011-08-01,-11.94,-11.843,-5.99
2011-09-01,-11.489,-14.131,-7.59
2011-10-01,12.494,15.136,11.35
2011-11-01,-2.27,-6.567,-0.28
2011-12-01,-0.718,0.93,0.74
2012-01-01,12.409,10.024,5.05
2012-02-01,1.067,6.691,4.42
2012-03-01,2.203,7.797,3.11
2012-04-01,-3.952,-4.218,-0.85
2012-05-01,-8.355,-12.903,-6.19
2012-06-01,7.331,5.617,3.89
2012-07-01,-2.368,-1.732,0.79
2012-08-01,2.331,6.432,2.55
2012-09-01,4.591,5.426,2.73
2012-10-01,-5.355,3.309,-1.76
2012-11-01,-0.097,-1.561,0.78
2012-12-01,0.266,7.238,1.18
2013-01-01,6.567,7.355,5.57
2013-02-01,-1.633,0.697,1.29
2013-03-01,8.115,3.33,4.03
2013-04-01,-0.001,2.755,1.55
2013-05-01,7.731,8.931,2.8
2013-06-01,-0.796,-2.81,-1.2
2013-07-01,7.032,7.211,5.65
2013-08-01,-2.331,-4.49,-2.71
2013-09-01,7.162,2.223,3.77
2013-10-01,-0.825,3.716,4.18
2013-11-01,7.779,6.322,3.13
2013-12-01,1.88,1.87,2.81
2014-01-01,3.428,-4.111,-3.32
2014-02-01,4.825,2.442,4.65
2014-03-01,-4.922,3.599,0.43
2014-04-01,-8.674,-2.133,-0.19
2014-05-01,-2.733,1.242,2.06
2014-06-01,5.585,3.461,2.61
2014-07-01,-9.171,-1.368,-2.04
2014-08-01,2.879,5.14,4.24
2014-09-01,-6.993,-0.181,-1.97
2014-10-01,5.793,1.495,2.52
2014-11-01,0.163,0.989,2.55
2014-12-01,5.903,2.397,-0.06
2015-01-01,-3.49,-7.737,-3.11
2015-02-01,4.085,5.818,6.14
2015-03-01,-0.947,-1.57,-1.12
2015-04-01,-3.905,1.88,0.59
2015-05-01,3.438,1.702,1.36
2015-06-01,4.313,-0.565,-1.53
2015-07-01,-5.261,0.632,1.54
2015-08-01,-8.048,-7.682,-6.04
2015-09-01,-8.285,-5.687,-3.07
2015-10-01,6.046,7.644,7.75
2015-11-01,3.799,3.217,0.56
2015-12-01,-3.517,-4.191,-2.17
2016-01-01,-13.415,-12.122,-5.77
2016-02-01,-2.523,-6.505,-0.08
2016-03-01,4.083,7.547,6.96
2016-04-01,2.816,7.172,0.92
2016-05-01,0.556,1.898,1.78
2016-06-01,-3.901,-6.7,-0.05
2016-07-01,4.712,4.395,3.95
2016-08-01,3.068,4.569,0.5
2016-09-01,11.696,0.2,0.25
2016-10-01,-10.647,2.361,-2.02
2016-11-01,7.437,14.112,4.86
2016-12-01,1.347,4.154,1.82
2017-01-01,1.809,-0.323,1.94
2017-02-01,2.693,4.468,3.57
2017-03-01,1.957,-3.139,0.17
2017-04-01,3.816,-0.81,1.09
2017-05-01,-2.027,-2.239,1.06
2017-06-01,9.202,5.126,0.78
2017-07-01,-0.795,2.22,1.87
2017-08-01,-0.352,-1.768,0.16
2017-09-01,7.586,4.995,2.51
2017-10-01,-3.185,4.152,2.25
2017-11-01,2.208,2.332,3.12
2017-12-01,1.521,1.116,1.06
2018-01-01,2.685,5.923,5.58
2018-02-01,-2.445,-2.093,-3.65
2018-03-01,2.32,-4.761,-2.35
2018-04-01,-0.599,-0.241,0.29
2018-05-01,13.107,-1.736,2.65
2018-06-01,3.935,-2.491,0.48
2018-07-01,-1.579,5.506,3.19
2018-08-01,4.563,1.244,3.44
2018-09-01,-3.793,-1.748,0.06
2018-10-01,-14.282,-7.72,-7.68
2018-11-01,-1.29,0.422,1.69
2018-12-01,-14.041,-12.948,-9.55
2019-01-01,11.66,12.946,8.41
2019-02-01,7.392,1.562,3.4
2019-03-01,0.645,-3.368,1.1
2019-04-01,0.484,8.746,3.96
2019-05-01,-5.649,-8.963,-6.94
2019-06-01,7.558,7.775,6.93
2019-07-01,-3.385,3.015,1.19
2019-08-01,-5.044,-8.774,-2.58
2019-09-01,-3.529,5.147,1.43
2019-10-01,0.628,3.551,2.06
2019-11-01,7.87,4.762,3.87
2019-12-01,3.645,3.878,2.77
2020-01-01,-1.408,-4.369,-0.11
2020-02-01,-6.249,-11.83,-8.13
2020-03-01,-21.609,-28.521,-13.38
2020-04-01,24.436,15.535,13.65
2020-05-01,13.662,3.789,5.58
2020-06-01,11.08,2.102,2.46
2020-07-01,0.218,2.932,5.77
2020-08-01,3.567,3.473,7.63
2020-09-01,-1.28,-6.122,-3.63
2020-10-01,-2.694,0.978,-2.1
2020-11-01,25.45,21.968,12.47
2020-12-01,13.172,8.036,4.63
1 Date SmallGrowth LargeValue Market
2 1970-01-01 -5.48 -4.875 -8.1
3 1970-02-01 1.465 7.546 5.13
4 1970-03-01 -7.232 1.061 -1.06
5 1970-04-01 -24.488 -8.481 -11.0
6 1970-05-01 -10.808 -4.552 -6.92
7 1970-06-01 -12.834 -8.749 -5.79
8 1970-07-01 4.862 5.726 6.93
9 1970-08-01 4.64 5.883 4.49
10 1970-09-01 21.801 3.943 4.18
11 1970-10-01 -12.134 -4.378 -2.28
12 1970-11-01 -5.227 5.534 4.6
13 1970-12-01 6.418 6.491 5.72
14 1971-01-01 15.029 3.907 4.84
15 1971-02-01 7.725 0.937 1.41
16 1971-03-01 7.754 2.246 4.13
17 1971-04-01 0.584 5.963 3.15
18 1971-05-01 -6.92 -3.829 -3.98
19 1971-06-01 -1.05 -0.564 -0.1
20 1971-07-01 -9.103 -5.887 -4.5
21 1971-08-01 2.874 13.117 3.79
22 1971-09-01 1.143 -2.519 -0.85
23 1971-10-01 -8.265 -4.386 -4.42
24 1971-11-01 -3.762 -0.087 -0.46
25 1971-12-01 14.068 8.569 8.71
26 1972-01-01 13.088 6.093 2.49
27 1972-02-01 2.516 -0.186 2.87
28 1972-03-01 2.505 2.59 0.63
29 1972-04-01 -1.651 -1.378 0.29
30 1972-05-01 -1.939 -2.966 1.25
31 1972-06-01 -4.608 -6.964 -2.43
32 1972-07-01 -7.521 -1.893 -0.8
33 1972-08-01 -1.859 6.016 3.26
34 1972-09-01 -5.28 -3.957 -1.14
35 1972-10-01 -4.095 0.399 0.52
36 1972-11-01 -0.403 13.583 4.6
37 1972-12-01 -2.22 -3.17 0.62
38 1973-01-01 -8.346 -4.609 -3.29
39 1973-02-01 -14.592 -3.788 -4.85
40 1973-03-01 -7.226 1.08 -1.3
41 1973-04-01 -12.277 -3.424 -5.68
42 1973-05-01 -11.85 -6.19 -2.94
43 1973-06-01 -5.898 -2.439 -1.56
44 1973-07-01 18.219 3.58 5.05
45 1973-08-01 -6.005 0.082 -3.82
46 1973-09-01 11.269 7.588 4.75
47 1973-10-01 -3.255 1.898 -0.83
48 1973-11-01 -25.643 -8.808 -12.75
49 1973-12-01 -4.478 10.494 0.61
50 1974-01-01 9.816 -0.712 -0.17
51 1974-02-01 -0.986 3.233 -0.47
52 1974-03-01 -0.462 -5.319 -2.81
53 1974-04-01 -5.388 -6.171 -5.29
54 1974-05-01 -8.878 -8.554 -4.68
55 1974-06-01 -4.299 0.97 -2.83
56 1974-07-01 -9.245 -5.804 -8.05
57 1974-08-01 -9.834 -9.243 -9.35
58 1974-09-01 -14.269 -7.436 -11.77
59 1974-10-01 16.45 0.803 16.1
60 1974-11-01 -6.6 -4.646 -4.51
61 1974-12-01 -7.854 1.178 -3.45
62 1975-01-01 24.883 15.084 13.66
63 1975-02-01 7.319 -3.674 5.56
64 1975-03-01 8.548 5.741 2.66
65 1975-04-01 6.68 4.582 4.23
66 1975-05-01 11.216 0.516 5.19
67 1975-06-01 5.331 7.015 4.83
68 1975-07-01 -2.088 -2.035 -6.59
69 1975-08-01 -7.603 -4.944 -2.85
70 1975-09-01 -5.759 -5.884 -4.26
71 1975-10-01 0.839 3.341 5.31
72 1975-11-01 -0.406 4.27 2.64
73 1975-12-01 -1.526 4.768 -1.6
74 1976-01-01 15.261 14.693 12.16
75 1976-02-01 9.544 9.098 0.32
76 1976-03-01 3.162 -1.411 2.32
77 1976-04-01 -1.853 0.724 -1.49
78 1976-05-01 -2.126 1.012 -1.34
79 1976-06-01 3.835 2.513 4.05
80 1976-07-01 -1.592 2.176 -1.07
81 1976-08-01 -4.748 0.639 -0.56
82 1976-09-01 1.777 -1.063 2.07
83 1976-10-01 -3.205 -4.421 -2.42
84 1976-11-01 5.318 3.951 0.36
85 1976-12-01 10.437 7.195 5.65
86 1977-01-01 2.484 -0.51 -4.05
87 1977-02-01 -0.83 -1.284 -1.94
88 1977-03-01 -0.308 -0.159 -1.37
89 1977-04-01 0.873 5.613 0.15
90 1977-05-01 -2.14 -3.383 -1.45
91 1977-06-01 5.403 1.592 4.71
92 1977-07-01 0.824 -5.293 -1.69
93 1977-08-01 0.59 -4.644 -1.75
94 1977-09-01 1.836 -0.542 -0.27
95 1977-10-01 -5.073 -4.086 -4.38
96 1977-11-01 9.05 4.19 4.0
97 1977-12-01 4.317 0.858 0.27
98 1978-01-01 -1.692 -3.42 -6.01
99 1978-02-01 2.814 -4.084 -1.38
100 1978-03-01 7.743 2.867 2.85
101 1978-04-01 9.715 4.738 7.88
102 1978-05-01 8.014 1.475 1.76
103 1978-06-01 0.249 -1.349 -1.69
104 1978-07-01 5.965 4.197 5.11
105 1978-08-01 9.118 -0.332 3.75
106 1978-09-01 -1.636 0.273 -1.43
107 1978-10-01 -27.398 -12.797 -11.91
108 1978-11-01 7.99 1.846 2.71
109 1978-12-01 2.789 -1.529 0.88
110 1979-01-01 9.216 6.868 4.23
111 1979-02-01 -3.65 -3.547 -3.56
112 1979-03-01 11.309 5.709 5.68
113 1979-04-01 2.378 -1.787 -0.06
114 1979-05-01 -3.451 -2.146 -2.21
115 1979-06-01 5.213 1.913 3.85
116 1979-07-01 1.583 2.897 0.82
117 1979-08-01 8.104 4.534 5.53
118 1979-09-01 -0.967 -0.338 -0.82
119 1979-10-01 -11.852 -8.037 -8.1
120 1979-11-01 9.941 0.011 5.21
121 1979-12-01 10.403 1.32 1.79
122 1980-01-01 11.915 9.429 5.51
123 1980-02-01 -0.334 1.6 -1.22
124 1980-03-01 -23.288 -14.096 -12.9
125 1980-04-01 5.008 1.603 3.97
126 1980-05-01 6.35 5.328 5.26
127 1980-06-01 4.369 -0.361 3.06
128 1980-07-01 11.666 4.724 6.49
129 1980-08-01 10.789 -0.556 1.8
130 1980-09-01 5.863 -0.719 2.19
131 1980-10-01 6.703 -0.133 1.06
132 1980-11-01 15.272 3.036 9.59
133 1980-12-01 -7.662 -1.756 -4.52
134 1981-01-01 -5.571 0.946 -5.04
135 1981-02-01 -4.41 -1.685 0.57
136 1981-03-01 6.077 6.957 3.56
137 1981-04-01 1.974 -4.037 -2.11
138 1981-05-01 3.874 -0.598 0.11
139 1981-06-01 -8.49 -0.328 -2.36
140 1981-07-01 -5.769 -0.637 -1.54
141 1981-08-01 -13.971 -1.673 -7.04
142 1981-09-01 -14.816 -0.76 -7.17
143 1981-10-01 9.22 3.597 4.92
144 1981-11-01 -2.194 2.697 3.36
145 1981-12-01 -5.144 -2.664 -3.65
146 1982-01-01 -3.957 0.633 -3.24
147 1982-02-01 -8.833 -4.84 -5.86
148 1982-03-01 -3.018 1.056 -1.87
149 1982-04-01 5.374 -0.584 3.27
150 1982-05-01 -4.163 -2.318 -3.99
151 1982-06-01 -5.372 -3.838 -3.09
152 1982-07-01 -4.799 -2.879 -3.19
153 1982-08-01 4.057 11.702 11.14
154 1982-09-01 1.799 -0.348 1.29
155 1982-10-01 17.058 5.357 11.3
156 1982-11-01 8.406 1.045 4.67
157 1982-12-01 1.965 5.254 0.55
158 1983-01-01 12.851 2.076 3.6
159 1983-02-01 2.483 1.785 2.59
160 1983-03-01 2.214 1.202 2.82
161 1983-04-01 6.654 6.525 6.67
162 1983-05-01 11.254 0.479 0.52
163 1983-06-01 3.47 -0.017 3.07
164 1983-07-01 -6.851 -2.91 -4.07
165 1983-08-01 -6.796 5.86 -0.5
166 1983-09-01 -3.826 -0.256 0.91
167 1983-10-01 -11.252 -1.434 -3.44
168 1983-11-01 2.986 -0.079 2.16
169 1983-12-01 -5.796 -0.189 -1.78
170 1984-01-01 -2.719 6.219 -1.92
171 1984-02-01 -8.141 -0.031 -4.82
172 1984-03-01 -1.752 -2.186 0.63
173 1984-04-01 -4.803 1.616 -0.51
174 1984-05-01 -6.983 -6.834 -5.97
175 1984-06-01 0.242 4.59 1.82
176 1984-07-01 -8.053 -3.178 -2.74
177 1984-08-01 10.726 12.016 10.28
178 1984-09-01 -3.508 2.659 -0.8
179 1984-10-01 -4.862 -2.404 -0.84
180 1984-11-01 -6.414 0.594 -1.76
181 1984-12-01 -0.153 1.469 1.84
182 1985-01-01 15.272 3.871 7.99
183 1985-02-01 3.237 2.092 1.22
184 1985-03-01 -3.291 0.943 -0.84
185 1985-04-01 -2.893 2.238 -0.96
186 1985-05-01 1.839 4.12 5.09
187 1985-06-01 0.039 1.669 1.27
188 1985-07-01 1.861 -2.971 -0.74
189 1985-08-01 -2.084 0.217 -1.02
190 1985-09-01 -8.733 -4.719 -4.54
191 1985-10-01 0.029 5.73 4.02
192 1985-11-01 4.875 4.097 6.48
193 1985-12-01 2.949 3.755 3.88
194 1986-01-01 3.24 0.85 0.65
195 1986-02-01 5.262 6.668 7.13
196 1986-03-01 4.022 3.959 4.88
197 1986-04-01 2.23 -3.257 -1.31
198 1986-05-01 3.623 5.058 4.62
199 1986-06-01 -0.365 2.413 1.03
200 1986-07-01 -10.631 -3.231 -6.45
201 1986-08-01 -0.173 10.315 6.07
202 1986-09-01 -8.411 -6.837 -8.6
203 1986-10-01 1.486 5.502 4.66
204 1986-11-01 -2.595 1.199 1.17
205 1986-12-01 -5.987 -3.418 -3.27
206 1987-01-01 10.7 11.56 12.47
207 1987-02-01 10.191 -1.448 4.39
208 1987-03-01 1.665 4.324 1.64
209 1987-04-01 -2.761 -0.787 -2.11
210 1987-05-01 -0.612 0.136 0.11
211 1987-06-01 -0.646 4.888 3.94
212 1987-07-01 1.324 2.607 3.85
213 1987-08-01 0.328 2.142 3.52
214 1987-09-01 -3.294 -3.178 -2.59
215 1987-10-01 -34.931 -19.329 -23.24
216 1987-11-01 -8.849 -7.755 -7.77
217 1987-12-01 2.511 5.862 6.81
218 1988-01-01 5.701 8.359 4.21
219 1988-02-01 5.532 2.396 4.75
220 1988-03-01 3.738 -1.249 -2.27
221 1988-04-01 0.524 1.814 0.56
222 1988-05-01 -4.132 1.703 -0.29
223 1988-06-01 5.97 2.518 4.79
224 1988-07-01 -1.381 0.506 -1.25
225 1988-08-01 -4.732 -3.704 -3.31
226 1988-09-01 0.507 3.171 3.3
227 1988-10-01 -3.488 3.855 1.15
228 1988-11-01 -5.514 -0.112 -2.29
229 1988-12-01 1.2 -0.128 1.49
230 1989-01-01 4.675 7.542 6.1
231 1989-02-01 -1.628 -3.134 -2.25
232 1989-03-01 0.619 0.617 1.57
233 1989-04-01 2.261 3.205 4.33
234 1989-05-01 2.078 2.459 3.35
235 1989-06-01 -3.993 0.225 -1.35
236 1989-07-01 2.096 5.981 7.2
237 1989-08-01 1.487 2.199 1.44
238 1989-09-01 0.545 -1.15 -0.76
239 1989-10-01 -5.773 -0.929 -3.67
240 1989-11-01 -1.32 0.427 1.03
241 1989-12-01 -1.436 0.41 1.16
242 1990-01-01 -8.814 -6.348 -7.85
243 1990-02-01 1.434 1.533 1.11
244 1990-03-01 3.757 0.495 1.83
245 1990-04-01 -3.17 -4.856 -3.36
246 1990-05-01 7.526 7.149 8.42
247 1990-06-01 0.646 -0.933 -1.09
248 1990-07-01 -5.585 -2.712 -1.9
249 1990-08-01 -17.13 -11.245 -10.15
250 1990-09-01 -11.234 -8.012 -6.12
251 1990-10-01 -7.165 0.262 -1.92
252 1990-11-01 2.734 3.776 6.35
253 1990-12-01 -0.361 0.206 2.46
254 1991-01-01 6.921 3.441 4.69
255 1991-02-01 14.11 7.477 7.19
256 1991-03-01 9.909 0.753 2.65
257 1991-04-01 0.645 -0.694 -0.28
258 1991-05-01 2.061 6.433 3.65
259 1991-06-01 -7.358 -4.384 -4.94
260 1991-07-01 2.228 -1.44 4.24
261 1991-08-01 3.299 1.117 2.32
262 1991-09-01 3.787 -3.403 -1.59
263 1991-10-01 6.671 0.846 1.29
264 1991-11-01 -2.442 -9.682 -4.19
265 1991-12-01 6.319 13.943 10.84
266 1992-01-01 14.279 6.094 -0.59
267 1992-02-01 -0.362 10.578 1.09
268 1992-03-01 -6.928 0.368 -2.66
269 1992-04-01 -10.41 9.846 1.07
270 1992-05-01 -1.57 -0.544 0.3
271 1992-06-01 -9.48 2.649 -2.34
272 1992-07-01 0.426 -0.656 3.77
273 1992-08-01 -4.95 -8.846 -2.38
274 1992-09-01 0.118 -0.16 1.19
275 1992-10-01 2.41 -0.234 1.02
276 1992-11-01 10.095 8.2 4.13
277 1992-12-01 1.256 2.618 1.53
278 1993-01-01 2.65 8.967 0.93
279 1993-02-01 -7.671 1.733 0.12
280 1993-03-01 0.336 3.114 2.3
281 1993-04-01 -4.558 0.811 -3.05
282 1993-05-01 5.254 -0.711 2.89
283 1993-06-01 -1.805 4.398 0.31
284 1993-07-01 -1.914 -0.502 -0.34
285 1993-08-01 3.467 3.819 3.71
286 1993-09-01 2.13 -0.942 -0.12
287 1993-10-01 5.012 -0.803 1.41
288 1993-11-01 -4.313 0.576 -1.89
289 1993-12-01 0.534 1.499 1.65
290 1994-01-01 2.38 2.629 2.87
291 1994-02-01 -3.427 -5.087 -2.55
292 1994-03-01 -8.029 -4.13 -4.78
293 1994-04-01 -4.275 1.74 0.68
294 1994-05-01 -2.853 3.157 0.58
295 1994-06-01 -6.932 -4.119 -3.03
296 1994-07-01 0.053 1.036 2.82
297 1994-08-01 3.133 3.104 4.01
298 1994-09-01 0.579 -6.52 -2.31
299 1994-10-01 -1.282 2.169 1.34
300 1994-11-01 -4.868 -2.988 -4.04
301 1994-12-01 -3.532 -0.82 0.86
302 1995-01-01 0.985 6.307 1.8
303 1995-02-01 1.815 6.895 3.63
304 1995-03-01 0.449 0.646 2.19
305 1995-04-01 1.216 5.671 2.11
306 1995-05-01 1.075 5.436 2.9
307 1995-06-01 7.425 1.484 2.72
308 1995-07-01 6.583 2.765 3.72
309 1995-08-01 3.648 3.6 0.55
310 1995-09-01 2.999 6.513 3.35
311 1995-10-01 -6.56 -4.041 -1.52
312 1995-11-01 1.336 4.402 3.96
313 1995-12-01 2.014 1.448 1.03
314 1996-01-01 1.165 4.029 2.26
315 1996-02-01 3.426 2.316 1.33
316 1996-03-01 2.476 0.083 0.73
317 1996-04-01 8.139 -2.034 2.06
318 1996-05-01 7.478 1.914 2.36
319 1996-06-01 -8.163 0.133 -1.14
320 1996-07-01 -15.564 -5.013 -5.97
321 1996-08-01 4.25 2.696 2.77
322 1996-09-01 1.864 4.745 5.01
323 1996-10-01 -6.039 4.373 0.86
324 1996-11-01 -1.053 6.271 6.25
325 1996-12-01 -1.182 -1.793 -1.7
326 1997-01-01 5.964 3.454 4.98
327 1997-02-01 -6.342 4.706 -0.49
328 1997-03-01 -10.017 -5.895 -5.02
329 1997-04-01 -5.907 0.888 4.04
330 1997-05-01 12.202 6.078 6.74
331 1997-06-01 3.662 3.626 4.1
332 1997-07-01 3.125 7.745 7.33
333 1997-08-01 5.28 -6.226 -4.15
334 1997-09-01 10.008 6.909 5.35
335 1997-10-01 -6.085 -3.352 -3.8
336 1997-11-01 -3.745 3.171 2.98
337 1997-12-01 -6.551 2.602 1.32
338 1998-01-01 -0.218 0.227 0.15
339 1998-02-01 5.869 6.609 7.04
340 1998-03-01 4.123 6.669 4.76
341 1998-04-01 2.094 -1.863 0.73
342 1998-05-01 -6.964 -1.33 -3.07
343 1998-06-01 -0.859 0.538 3.18
344 1998-07-01 -8.118 -2.737 -2.46
345 1998-08-01 -28.392 -12.946 -16.08
346 1998-09-01 6.596 9.46 6.15
347 1998-10-01 3.077 2.901 7.13
348 1998-11-01 9.939 4.621 6.1
349 1998-12-01 4.684 4.651 6.16
350 1999-01-01 7.543 -0.588 3.5
351 1999-02-01 -7.903 -1.568 -4.08
352 1999-03-01 -2.796 1.632 3.45
353 1999-04-01 7.175 1.871 4.33
354 1999-05-01 1.606 2.584 -2.46
355 1999-06-01 6.485 -0.364 4.77
356 1999-07-01 0.572 -9.442 -3.49
357 1999-08-01 -3.804 -1.284 -1.38
358 1999-09-01 1.475 -9.174 -2.79
359 1999-10-01 -0.536 5.305 6.12
360 1999-11-01 19.126 -0.868 3.37
361 1999-12-01 24.726 -1.938 7.72
362 2000-01-01 9.104 -9.93 -4.74
363 2000-02-01 36.81 -11.759 2.45
364 2000-03-01 -14.146 21.517 5.2
365 2000-04-01 -23.655 -0.676 -6.4
366 2000-05-01 -14.848 7.191 -4.42
367 2000-06-01 27.997 -4.128 4.64
368 2000-07-01 -9.45 1.831 -2.51
369 2000-08-01 8.774 5.2 7.03
370 2000-09-01 -11.565 -2.147 -5.45
371 2000-10-01 -13.026 2.813 -2.76
372 2000-11-01 -21.778 0.038 -10.72
373 2000-12-01 -10.659 -0.058 1.19
374 2001-01-01 27.64 1.032 3.13
375 2001-02-01 -13.81 3.913 -10.05
376 2001-03-01 -13.312 -3.065 -7.26
377 2001-04-01 9.228 7.051 7.94
378 2001-05-01 12.361 5.377 0.72
379 2001-06-01 2.264 -3.346 -1.94
380 2001-07-01 -9.11 7.271 -2.13
381 2001-08-01 -8.593 -8.659 -6.46
382 2001-09-01 -16.466 1.355 -9.25
383 2001-10-01 8.853 -14.857 2.46
384 2001-11-01 6.121 11.118 7.54
385 2001-12-01 13.045 1.157 1.61
386 2002-01-01 -8.246 -9.326 -1.44
387 2002-02-01 -10.629 -12.893 -2.29
388 2002-03-01 5.59 -0.02 4.24
389 2002-04-01 -10.28 -22.297 -5.2
390 2002-05-01 -7.108 -7.847 -1.38
391 2002-06-01 -8.926 -13.694 -7.21
392 2002-07-01 -19.652 -14.825 -8.18
393 2002-08-01 -0.121 8.181 0.5
394 2002-09-01 -11.181 -6.331 -10.35
395 2002-10-01 6.1 13.993 7.84
396 2002-11-01 17.892 6.929 5.96
397 2002-12-01 -10.364 -9.849 -5.76
398 2003-01-01 -0.238 -5.686 -2.57
399 2003-02-01 -6.478 -5.011 -1.88
400 2003-03-01 2.094 -3.05 1.09
401 2003-04-01 12.452 14.718 8.22
402 2003-05-01 20.564 7.756 6.05
403 2003-06-01 6.097 3.564 1.42
404 2003-07-01 8.68 1.236 2.35
405 2003-08-01 4.237 1.354 2.34
406 2003-09-01 3.293 -4.242 -1.24
407 2003-10-01 5.985 2.687 6.08
408 2003-11-01 2.743 2.839 1.35
409 2003-12-01 0.162 4.891 4.29
410 2004-01-01 5.966 6.662 2.15
411 2004-02-01 -0.059 5.476 1.4
412 2004-03-01 -1.642 -1.147 -1.32
413 2004-04-01 -4.572 -2.088 -1.83
414 2004-05-01 -1.778 1.179 1.17
415 2004-06-01 0.854 2.288 1.86
416 2004-07-01 -13.045 -0.993 -4.06
417 2004-08-01 -1.704 -0.217 0.08
418 2004-09-01 4.253 3.621 1.6
419 2004-10-01 1.131 2.535 1.43
420 2004-11-01 10.675 5.904 4.54
421 2004-12-01 5.33 2.611 3.43
422 2005-01-01 -6.511 0.214 -2.76
423 2005-02-01 -1.276 4.906 1.89
424 2005-03-01 -6.436 -0.755 -1.97
425 2005-04-01 -5.969 -2.832 -2.61
426 2005-05-01 6.428 3.969 3.65
427 2005-06-01 3.639 3.053 0.57
428 2005-07-01 7.424 3.973 3.92
429 2005-08-01 -3.127 -0.661 -1.22
430 2005-09-01 0.79 1.904 0.49
431 2005-10-01 -3.77 -1.387 -2.02
432 2005-11-01 4.946 2.037 3.61
433 2005-12-01 -0.675 -0.791 -0.25
434 2006-01-01 11.466 3.447 3.04
435 2006-02-01 -0.826 -1.514 -0.3
436 2006-03-01 3.696 0.445 1.46
437 2006-04-01 -1.394 4.986 0.73
438 2006-05-01 -9.914 -3.002 -3.57
439 2006-06-01 -1.3 0.987 -0.35
440 2006-07-01 -6.239 2.435 -0.78
441 2006-08-01 3.14 -0.622 2.03
442 2006-09-01 -0.593 3.872 1.84
443 2006-10-01 6.783 4.178 3.23
444 2006-11-01 0.572 -0.366 1.71
445 2006-12-01 0.21 2.692 0.87
446 2007-01-01 1.031 2.165 1.4
447 2007-02-01 -1.203 -3.469 -1.96
448 2007-03-01 0.018 -0.928 0.68
449 2007-04-01 2.857 4.351 3.49
450 2007-05-01 1.816 2.266 3.24
451 2007-06-01 -0.044 -2.603 -1.96
452 2007-07-01 -5.868 -5.29 -3.73
453 2007-08-01 0.584 -0.347 0.92
454 2007-09-01 1.844 3.887 3.22
455 2007-10-01 3.181 -0.752 1.8
456 2007-11-01 -10.235 -5.791 -4.83
457 2007-12-01 -1.244 1.034 -0.87
458 2008-01-01 -11.523 -4.773 -6.36
459 2008-02-01 -5.938 -5.501 -3.09
460 2008-03-01 -3.863 0.931 -0.93
461 2008-04-01 3.388 6.001 4.6
462 2008-05-01 5.467 1.668 1.86
463 2008-06-01 -6.342 -10.217 -8.44
464 2008-07-01 4.872 7.964 -0.77
465 2008-08-01 0.885 -0.478 1.53
466 2008-09-01 -13.399 -4.041 -9.24
467 2008-10-01 -23.606 -13.611 -17.23
468 2008-11-01 -13.07 -17.865 -7.86
469 2008-12-01 2.79 3.71 1.74
470 2009-01-01 -6.87 -14.319 -8.12
471 2009-02-01 -11.135 -12.35 -10.1
472 2009-03-01 11.056 10.91 8.95
473 2009-04-01 19.143 20.242 10.18
474 2009-05-01 6.138 9.93 5.21
475 2009-06-01 7.723 -2.783 0.43
476 2009-07-01 8.657 9.442 7.72
477 2009-08-01 2.944 12.003 3.33
478 2009-09-01 4.556 2.567 4.08
479 2009-10-01 -10.592 -9.417 -2.59
480 2009-11-01 -0.486 4.264 5.56
481 2009-12-01 6.133 -3.057 2.75
482 2010-01-01 -4.179 -2.656 -3.36
483 2010-02-01 4.014 5.636 3.4
484 2010-03-01 6.866 8.288 6.31
485 2010-04-01 6.485 -0.498 2.0
486 2010-05-01 -6.948 -8.103 -7.89
487 2010-06-01 -6.499 -9.347 -5.57
488 2010-07-01 6.253 5.325 6.93
489 2010-08-01 -8.726 -8.952 -4.77
490 2010-09-01 11.603 6.979 9.54
491 2010-10-01 6.453 -0.239 3.88
492 2010-11-01 1.535 -3.261 0.6
493 2010-12-01 10.168 13.91 6.82
494 2011-01-01 -2.948 3.314 1.99
495 2011-02-01 1.482 3.954 3.49
496 2011-03-01 3.553 -3.259 0.46
497 2011-04-01 2.714 1.119 2.9
498 2011-05-01 -1.041 -3.751 -1.27
499 2011-06-01 -4.507 -2.769 -1.75
500 2011-07-01 -5.042 -5.069 -2.35
501 2011-08-01 -11.94 -11.843 -5.99
502 2011-09-01 -11.489 -14.131 -7.59
503 2011-10-01 12.494 15.136 11.35
504 2011-11-01 -2.27 -6.567 -0.28
505 2011-12-01 -0.718 0.93 0.74
506 2012-01-01 12.409 10.024 5.05
507 2012-02-01 1.067 6.691 4.42
508 2012-03-01 2.203 7.797 3.11
509 2012-04-01 -3.952 -4.218 -0.85
510 2012-05-01 -8.355 -12.903 -6.19
511 2012-06-01 7.331 5.617 3.89
512 2012-07-01 -2.368 -1.732 0.79
513 2012-08-01 2.331 6.432 2.55
514 2012-09-01 4.591 5.426 2.73
515 2012-10-01 -5.355 3.309 -1.76
516 2012-11-01 -0.097 -1.561 0.78
517 2012-12-01 0.266 7.238 1.18
518 2013-01-01 6.567 7.355 5.57
519 2013-02-01 -1.633 0.697 1.29
520 2013-03-01 8.115 3.33 4.03
521 2013-04-01 -0.001 2.755 1.55
522 2013-05-01 7.731 8.931 2.8
523 2013-06-01 -0.796 -2.81 -1.2
524 2013-07-01 7.032 7.211 5.65
525 2013-08-01 -2.331 -4.49 -2.71
526 2013-09-01 7.162 2.223 3.77
527 2013-10-01 -0.825 3.716 4.18
528 2013-11-01 7.779 6.322 3.13
529 2013-12-01 1.88 1.87 2.81
530 2014-01-01 3.428 -4.111 -3.32
531 2014-02-01 4.825 2.442 4.65
532 2014-03-01 -4.922 3.599 0.43
533 2014-04-01 -8.674 -2.133 -0.19
534 2014-05-01 -2.733 1.242 2.06
535 2014-06-01 5.585 3.461 2.61
536 2014-07-01 -9.171 -1.368 -2.04
537 2014-08-01 2.879 5.14 4.24
538 2014-09-01 -6.993 -0.181 -1.97
539 2014-10-01 5.793 1.495 2.52
540 2014-11-01 0.163 0.989 2.55
541 2014-12-01 5.903 2.397 -0.06
542 2015-01-01 -3.49 -7.737 -3.11
543 2015-02-01 4.085 5.818 6.14
544 2015-03-01 -0.947 -1.57 -1.12
545 2015-04-01 -3.905 1.88 0.59
546 2015-05-01 3.438 1.702 1.36
547 2015-06-01 4.313 -0.565 -1.53
548 2015-07-01 -5.261 0.632 1.54
549 2015-08-01 -8.048 -7.682 -6.04
550 2015-09-01 -8.285 -5.687 -3.07
551 2015-10-01 6.046 7.644 7.75
552 2015-11-01 3.799 3.217 0.56
553 2015-12-01 -3.517 -4.191 -2.17
554 2016-01-01 -13.415 -12.122 -5.77
555 2016-02-01 -2.523 -6.505 -0.08
556 2016-03-01 4.083 7.547 6.96
557 2016-04-01 2.816 7.172 0.92
558 2016-05-01 0.556 1.898 1.78
559 2016-06-01 -3.901 -6.7 -0.05
560 2016-07-01 4.712 4.395 3.95
561 2016-08-01 3.068 4.569 0.5
562 2016-09-01 11.696 0.2 0.25
563 2016-10-01 -10.647 2.361 -2.02
564 2016-11-01 7.437 14.112 4.86
565 2016-12-01 1.347 4.154 1.82
566 2017-01-01 1.809 -0.323 1.94
567 2017-02-01 2.693 4.468 3.57
568 2017-03-01 1.957 -3.139 0.17
569 2017-04-01 3.816 -0.81 1.09
570 2017-05-01 -2.027 -2.239 1.06
571 2017-06-01 9.202 5.126 0.78
572 2017-07-01 -0.795 2.22 1.87
573 2017-08-01 -0.352 -1.768 0.16
574 2017-09-01 7.586 4.995 2.51
575 2017-10-01 -3.185 4.152 2.25
576 2017-11-01 2.208 2.332 3.12
577 2017-12-01 1.521 1.116 1.06
578 2018-01-01 2.685 5.923 5.58
579 2018-02-01 -2.445 -2.093 -3.65
580 2018-03-01 2.32 -4.761 -2.35
581 2018-04-01 -0.599 -0.241 0.29
582 2018-05-01 13.107 -1.736 2.65
583 2018-06-01 3.935 -2.491 0.48
584 2018-07-01 -1.579 5.506 3.19
585 2018-08-01 4.563 1.244 3.44
586 2018-09-01 -3.793 -1.748 0.06
587 2018-10-01 -14.282 -7.72 -7.68
588 2018-11-01 -1.29 0.422 1.69
589 2018-12-01 -14.041 -12.948 -9.55
590 2019-01-01 11.66 12.946 8.41
591 2019-02-01 7.392 1.562 3.4
592 2019-03-01 0.645 -3.368 1.1
593 2019-04-01 0.484 8.746 3.96
594 2019-05-01 -5.649 -8.963 -6.94
595 2019-06-01 7.558 7.775 6.93
596 2019-07-01 -3.385 3.015 1.19
597 2019-08-01 -5.044 -8.774 -2.58
598 2019-09-01 -3.529 5.147 1.43
599 2019-10-01 0.628 3.551 2.06
600 2019-11-01 7.87 4.762 3.87
601 2019-12-01 3.645 3.878 2.77
602 2020-01-01 -1.408 -4.369 -0.11
603 2020-02-01 -6.249 -11.83 -8.13
604 2020-03-01 -21.609 -28.521 -13.38
605 2020-04-01 24.436 15.535 13.65
606 2020-05-01 13.662 3.789 5.58
607 2020-06-01 11.08 2.102 2.46
608 2020-07-01 0.218 2.932 5.77
609 2020-08-01 3.567 3.473 7.63
610 2020-09-01 -1.28 -6.122 -3.63
611 2020-10-01 -2.694 0.978 -2.1
612 2020-11-01 25.45 21.968 12.47
613 2020-12-01 13.172 8.036 4.63

312
Problemsets/MC_pi.ipynb Normal file

File diff suppressed because one or more lines are too long

206
Problemsets/MV_by_MC.ipynb Normal file

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

244
Problemsets/PS03_CLT.ipynb Normal file

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,136 @@
{
"cells": [
{
"cell_type": "code",
"execution_count": 1,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"printyellow (generic function with 1 method)"
]
},
"execution_count": 1,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"using Printf, Dates, Statistics, DelimitedFiles, StatsBase\n",
"\n",
"include(\"jlFiles/printmat.jl\")"
]
},
{
"cell_type": "code",
"execution_count": 2,
"metadata": {},
"outputs": [],
"source": [
"using Plots\n",
"\n",
"gr(size=(480,320))\n",
"default(fmt = :svg)"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"# Load Data"
]
},
{
"cell_type": "code",
"execution_count": 3,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"(10340, 25)"
]
},
"execution_count": 3,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"x = readdlm(\"Data/25_Portfolios_5x5_Daily.CSV\",',',skipstart=1) #daily return data\n",
"ym = round.(Int,x[:,1]) #yearmonthday, like 20071231\n",
"\n",
"dN = Date.(string.(ym),\"yyyymmdd\") #covert to Julia date, eg. 2001-12-31\n",
"\n",
"\n",
"vv = Date(1980,1,1) .<= dN .<= Date(2020,12,31) #pick out the correct sample\n",
"ym = ym[vv]\n",
"R = x[vv,2:end] #returns\n",
"\n",
"(T,n) = size(R) #number of data points, number of assets"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"# Task 1: Two Simple Strategies\n",
"\n",
"`R_1`: go long each of asset 1-24 (each with the weight 1/24) and short asset 25\n",
"\n",
"`R_2`: go long asset 1 and short asset 25\n",
"\n",
"The returns of these portfolios are easy to calculate without having to explicitly construct the portfolio weights, but it still a good preparation for later to do the explicit calculations as follows:\n",
"\n",
"1. Construct the vector of portfolio weights `w`\n",
"2. The portfolio return in `t` is `w'*R[t,:]`.\n",
"\n",
"Also, do not be afraid of loops: they are quick.\n",
"\n",
"Show means and standard deviations of the two strategies. Annualize the mean by `*252` and the standard deviation by `*sqrt(252)`.\n",
"\n",
"Plot histograms with bins that are 0.25 wide. (Don't annualize anything in the histograms.)"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"# Task 2: Another Trading Strategy\n",
"\n",
"We now do simple volatility based trading strategy.\n",
"\n",
"1. Find the 3 least volatile assets over `t-22:t-1` and give each a portfolio weight `w[t,i]=1/3`. \n",
"\n",
"2. Find the 3 most volatile assets over `t-22:t-1` and give each a portfolio weight `w[t,i]=-1/3`. \n",
"\n",
"3. The portfolio return in `t` is `w[t,:]'*R[t,:]`.\n",
"\n",
"4. Compare the average and std (annualized) with the previous portfolios, over periods `23:T`\n",
"\n",
"Hint: `v = sortperm(x)` gives indices such that `v[1:2]` are the indices of the lowest 2 elements in x. Try `sortperm([12,11,13])` to see."
]
}
],
"metadata": {
"@webio": {
"lastCommId": null,
"lastKernelId": null
},
"anaconda-cloud": {},
"kernelspec": {
"display_name": "Julia 1.6.2",
"language": "julia",
"name": "julia-1.6"
},
"language_info": {
"file_extension": ".jl",
"mimetype": "application/julia",
"name": "julia",
"version": "1.6.2"
}
},
"nbformat": 4,
"nbformat_minor": 1
}

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,59 @@
#------------------------------------------------------------------------------
"""
printTeXTable(fh::IO,x;colNames=[],rowNames=[],width=12,prec=2) or
printTeXTable(x;colNames=[],rowNames=[],width=12,prec=2) or
Create LaTeX table from numeric matrix x. Print to file or screen and returns a string
with the table contents.
# Input
-`fh::IOStream`:
-`x::`:
-`colNames::`:
-`rowNames::`:
-`width::`:
-`prec::`:
"""
function printTeXTable(fh::IO,x;colNames=[],rowNames=[],width=12,prec=2)
(m,n) = (size(x,1),size(x,2))
isempty(rowNames) && (rowNames = [string("r",i) for i = 1:m]) #create row names "r1"
isempty(colNames) && (colNames = [string("c",i) for i = 1:n]) #create column names "c1"
str = """
\\begin{table}
\\begin{tabular}{l"""
str = string(str,"r"^n,"}\n"," ")
str = string(str," & ") #empty cell above rowNames[1]
for i = 1:n-1 #column names
str = string(str,colNames[i]," & ")
end
str = string(str,colNames[n]," \\\\ \\hline \n")
for i = 1:m #loop over rows
str = string(str," ",rowNames[i]," & ") #row name
for j = 1:n-1
str = string(str,fmtNumPs(x[i,j],width,prec,"right"), " & ") #x[i,1:end-1]
end
str = string(str,fmtNumPs(x[i,n],width,prec,"right")," \\\\ \n") #x[i,end]
end
endstr = """
\\hline
\\end{tabular}
\\end{table}"""
str = string(str,endstr,"\n")
print(fh,str) #print
return str
end
#when fh is not supplied: printing to screen
printTeXTable(x;colNames=[],rowNames=[],width=12,prec=2) =
printTeXTable(stdout::IO,x;colNames,rowNames,width,prec)
#------------------------------------------------------------------------------

View File

@@ -0,0 +1,246 @@
#------------------------------------------------------------------------------
"""
printmat([fh::IO],x...;colNames=[],rowNames=[],
width=10,prec=3,NoPrinting=false,StringFmt="",cell00="")
Print all elements of a matrix (or several) with predefined formatting. It can also handle
OffsetArrays. StringFmt = "csv" prints using a csv format.
# Input
- `fh::IO`: (optional) file handle. If not supplied, prints to screen
- `x::Array(s)`: (of numbers, dates, strings, ...) to print
- `colNames::Array`: of strings with column headers
- `rowNames::Array`: of strings with row labels
- `width::Int`: (keyword) scalar, minimum width of printed cells
- `prec::Int`: (keyword) scalar, precision of printed cells
- `NoPrinting::Bool`: (keyword) bool, true: no printing, just return formatted string [false]
- `StringFmt::String`: (keyword) string, "", "csv"
- `cell00::String`: (keyword) string, for row 0, column 0
# Output
- str (if NoPrinting) string, (otherwise nothing)
# Examples
```
x = [11 12;21 22]
printmat(x)
```
```
x = [1 "ab"; Date(2018,10,7) 3.14]
printmat(x,width=20,colNames=["col 1","col 2"])
```
```
printmat([11,12],[21,22])
```
Can also call as
```
opt = Dict(:rowNames=>["1";"4"],:width=>10,:prec=>3,:NoPrinting=>false,:StringFmt=>"")
printmat(x;colNames=["a","b"],opt...) #notice ; and ...
```
(not all keywords are needed)
# Requires
- fmtNumPs
# Notice
- The prefixN and suffixN could potentially be made function inputs. This would allow
a fairly flexible way to format tables.
Paul.Soderlind@unisg.ch
"""
function printmat(fh::IO,x...;colNames=[],rowNames=[],
width=10,prec=3,NoPrinting=false,StringFmt="",cell00="")
isempty(x) && return nothing #do nothing is isempty(x)
typeTestQ = any(!=(eltype(x[1])),[eltype(z) for z in x]) #test if eltype(x[i]) differs
if typeTestQ #create matrix from tuple created by x...
x = hcat(Matrix{Any}(hcat(x[1])),x[2:end]...) #preserving types of x[i]
else
x = hcat(x...)
end
(m,n) = (size(x,1),size(x,2))
(length(rowNames) == 1 < m) && (rowNames = [string(rowNames[1],i) for i = 1:m]) #"ri"
(length(colNames) == 1 < n) && (colNames = [string(colNames[1],i) for i = 1:n]) #"ci"
if StringFmt == "csv"
(prefixN,suffixN) = (fill("",n),vcat(fill(",",n-1),"")) #prefix and suffix for column 1:n
(prefixC0,suffixC0) = ("",",") #prefix and suffix for column 0
else
(prefixN,suffixN) = (fill("",n),fill("",n))
(prefixC0,suffixC0) = ("","")
end
if length(rowNames) == 0 #width of column 0 (cell00 and rowNames)
col0Width = 0
else
col0Width = maximum(length,vcat(cell00,rowNames)) + length(prefixC0) + length(suffixC0)
end
colWidth = [width + length(prefixN[j]) + length(suffixN[j]) for j=1:n] #widths of column 1:n
iob = IOBuffer()
if !isempty(colNames) #print (cell00,colNames), if any
!isempty(cell00) ? txt0 = string(prefixC0,cell00,suffixC0) : txt0 = ""
print(iob,rpad(txt0,col0Width))
for j = 1:n #loop over columns
print(iob,lpad(string(prefixN[j],colNames[j],suffixN[j]),colWidth[j]))
end
print(iob,"\n")
end
#print rowNames and x
(i0,j0) = (1 - first(axes(x,1)),1 - first(axes(x,2))) #i+i0,j+j0 give traditional indices
for i in axes(x,1) #loop over rows
!isempty(rowNames) && print(iob,rpad(string(prefixC0,rowNames[i+i0],suffixC0),col0Width))
for j in axes(x,2) #loop over columns
print(iob,fmtNumPs(x[i,j],width,prec,"right",prefix=prefixN[j+j0],suffix=suffixN[j+j0]))
end
print(iob,"\n")
end
str = String(take!(iob))
if NoPrinting #no printing, just return str
return str
else #print, return nothing
print(fh,str,"\n")
return nothing
end
end
#when fh is not supplied: printing to screen
printmat(x...;colNames=[],rowNames=[],width=10,prec=3,NoPrinting=false,StringFmt="",cell00="") =
printmat(stdout::IO,x...;colNames,rowNames,width,prec,NoPrinting,StringFmt,cell00)
#------------------------------------------------------------------------------
#------------------------------------------------------------------------------
"""
printlnPs([fh::IO],z...;width=10,prec=3)
Subsitute for println, with predefined formatting.
# Input
- `fh::IO`: (optional) file handle. If not supplied, prints to screen
- `z::String`: string, numbers and arrays to print
Paul.Soderlind@unisg.ch
"""
function printlnPs(fh::IO,z...;width=10,prec=3)
for x in z #loop over inputs in z...
if isa(x,AbstractArray)
iob = IOBuffer()
for i = 1:length(x)
print(iob,fmtNumPs(x[i],width,prec,"right"))
end
print(fh,String(take!(iob)))
else
print(fh,fmtNumPs(x,width,prec,"right"))
end
end
print(fh,"\n")
end
#when fh is not supplied: printing to screen
printlnPs(z...;width=10,prec=3) = printlnPs(stdout::IO,z...;width,prec)
#------------------------------------------------------------------------------
#------------------------------------------------------------------------------
"""
fmtNumPs(z,width=10,prec=2,justify="right";prefix="",suffix="")
Create a formatted string of a float (eg, "%10.4f"), nothing (""),
while other values are passed through. Strings are right (or left) justified
and can optionally be given prefix and suffix (eg, ",")
# Notice
- With prec > 0 and isa(z,Integer), then the string is padded with 1+prec spaces
to align with the printing of floats with the same prec.
# Requires
- Printf (for 1.6-), fmtNumPsC (for < 1.6)
"""
function fmtNumPs(z,width=10,prec=2,justify="right";prefix="",suffix="")
isa(z,Bool) && (z = convert(Int,z)) #Bool -> Int
if isa(z,AbstractFloat) #example: 101.0234, prec=3
if VERSION < v"1.6-"
fmt = "%$(width).$(prec)f"
zRound = round(z,digits=prec)
strLR = fmtNumPsC(fmt,zRound) #C fallback solution
else
fmt = Printf.Format("%$(width).$(prec)f")
strLR = Printf.format(fmt,z)
end
elseif isa(z,Nothing)
strLR = ""
elseif isa(z,Integer) && prec > 0 #integer followed by (1+prec spaces)
strLR = string(z," "^(1+prec))
else #Int, String, Date, Missing, etc
strLR = string(z)
end
strLR = string(prefix,strLR,suffix)
if justify == "left" #justification
strLR = rpad(strLR,width+length(prefix)+length(suffix))
else
strLR = lpad(strLR,width+length(prefix)+length(suffix))
end
return strLR
end
#------------------------------------------------------------------------------
#------------------------------------------------------------------------------
"""
fmtNumPsC(fmt,z)
c fallback solution for formatting of floating point number. Used if VERSION < v"1.6-"
"""
function fmtNumPsC(fmt,z) #c fallback solution
if ismissing(z) || isnan(z) || isinf(z) #asprintf does not work for these cases
str = string(z)
else
strp = Ref{Ptr{Cchar}}(0)
len = ccall(:asprintf,Cint,(Ptr{Ptr{Cchar}},Cstring,Cdouble...),strp,fmt,z)
str = unsafe_string(strp[],len)
Libc.free(strp[])
end
return str
end
#------------------------------------------------------------------------------
#------------------------------------------------------------------------------
function printblue(x...)
foreach(z->printstyled(z,color=:blue,bold=true),x)
print("\n")
end
function printred(x...)
foreach(z->printstyled(z,color=:red,bold=true),x)
print("\n")
end
function printmagenta(x...)
foreach(z->printstyled(z,color=:magenta,bold=true),x)
print("\n")
end
function printyellow(x...)
foreach(z->printstyled(z,color=:yellow,bold=true),x)
print("\n")
end
#------------------------------------------------------------------------------