Hi all,
I am working with daily stock data and I am trying to compute the monthly betas in month t from daily stock data on t-11 month time window (e.g. the beta in Dec comprises daily stock data from Jan up to and including Dec). Additionally, I want to include a minimum of 150 observations in the regression equation.
I want to calculate the beta by computing the coefficients of a regression of excess stock returns on the excess market return over the past 12 months. My sample data lists the excess returns of each stock (the stock is classified by a number) and the market return mktrf in the last column.
I came up with the following code, but unfortunately I cannot find the error: I used width=252 for the past 12 months in days, but have not included prerequisite of a minimum of 150 observations in the code yet. I also have troubles with the NAs when the stock got delisted.
rollingbeta <- rollapply(joined_data,
width=252,
FUN = function(x) {
t = lm(formula=paste0(" ` ", x , " ` ~ mktrf"), data = joined_data, na.rm=T);
return(t$coef) },
by.column=TRUE,
align="right")
print(coef(rollingbeta))
Ideally, I wish to seek the output in the same data format as my input table.
Any ideas on this? Would appreciate any help!
Here is my sample data created with dput
structure(list(date = structure(c(16804, 16805, 16806, 16807,
16808, 16811, 16812, 16813, 16814, 16815, 16819, 16820, 16821,
16822, 16825, 16826, 16827, 16828, 16829, 16832, 16833, 16834,
16835, 16836, 16839, 16840, 16841, 16842, 16843, 16847, 16848,
16849, 16850, 16853, 16854, 16855, 16856, 16857, 16860, 16861,
16862, 16863, 16864, 16867, 16868, 16869, 16870, 16871, 16874,
16875, 16876, 16877, 16878, 16881, 16882, 16883, 16884, 16888,
16889, 16890, 16891, 16892, 16895, 16896, 16897, 16898, 16899,
16902, 16903, 16904, 16905, 16906, 16909, 16910, 16911, 16912,
16913, 16916, 16917, 16918, 16919, 16920, 16923, 16924, 16925,
16926, 16927, 16930, 16931, 16932, 16933, 16934, 16937, 16938,
16939, 16940, 16941, 16944, 16945, 16946, 16947, 16948, 16952,
16953, 16954, 16955, 16958, 16959, 16960, 16961, 16962, 16965,
16966, 16967, 16968, 16969, 16972, 16973, 16974, 16975, 16976,
16979, 16980, 16981, 16982, 16983, 16987, 16988, 16989, 16990,
16993, 16994, 16995, 16996, 16997, 17000, 17001, 17002, 17003,
17004, 17007, 17008, 17009, 17010, 17011, 17014, 17015, 17016,
17017, 17018, 17021, 17022, 17023, 17024, 17025, 17028, 17029,
17030, 17031, 17032, 17035, 17036, 17037, 17038, 17039, 17042,
17043, 17044, 17045, 17046, 17050, 17051, 17052, 17053, 17056,
17057, 17058, 17059, 17060, 17063, 17064, 17065, 17066, 17067,
17070, 17071, 17072, 17073, 17074, 17077, 17078, 17079, 17080,
17081, 17084, 17085, 17086, 17087, 17088, 17091, 17092, 17093,
17094, 17095, 17098, 17099, 17100, 17101, 17102, 17105, 17106,
17107, 17108, 17109, 17112, 17113, 17114, 17115, 17116, 17119,
17120, 17121, 17122, 17123, 17126, 17127, 17128, 17130, 17133,
17134, 17135, 17136, 17137, 17140, 17141, 17142, 17143, 17144,
17147, 17148, 17149, 17150, 17151, 17154, 17155, 17156, 17157,
17158, 17162, 17163, 17164, 17165, 17169, 17170, 17171, 17172,
17175, 17176, 17177, 17178, 17179, 17183, 17184, 17185, 17186,
17189, 17190, 17191, 17192, 17193, 17196, 17197, 17198, 17199,
17200, 17203, 17204, 17205, 17206, 17207, 17210, 17211, 17212,
17213, 17214, 17218, 17219, 17220, 17221, 17224, 17225, 17226,
17227, 17228, 17231, 17232, 17233, 17234, 17235, 17238, 17239,
17240, 17241, 17242, 17245, 17246, 17247, 17248, 17249, 17252,
17253, 17254, 17255, 17256, 17259, 17260, 17261, 17262, 17263,
17266, 17267, 17268, 17269, 17273, 17274, 17275, 17276, 17277,
17280, 17281, 17282, 17283, 17284, 17287, 17288, 17289, 17290,
17291, 17294, 17295, 17296, 17297, 17298, 17301, 17302, 17303,
17304, 17305, 17308, 17309, 17310, 17311, 17312, 17316, 17317,
17318, 17319, 17322, 17323, 17324, 17325, 17326, 17329, 17330,
17331, 17332, 17333, 17336, 17337, 17338, 17339, 17340, 17343,
17344, 17345, 17346, 17347, 17350, 17352, 17353, 17354, 17357,
17358, 17359, 17360, 17361, 17364, 17365, 17366, 17367, 17368,
17371, 17372, 17373, 17374, 17375, 17378, 17379, 17380, 17381
), class = "Date"), `10001` = c(NA, -0.0132978723404255, 0.0148247978436657,
0.0146082337317397, 0.0196335078534031, 0.0346598202824133, 0.0235732009925558,
0, -0.0145454545454544, -0.0172201722017221, 0.016270337922403,
-0.00492610837438412, 0.00247524752475248, 0.0148148148148148,
-0.02676399026764, 0.0125, 0.0123456790123457, 0, 0.0146341463414634,
0.0120092307692306, 0.0082916627078385, -0.0270892353266823,
-0.0314869975786925, 0.04249, 0.0347621822541966, -0.048677439165701,
0.0109522411693058, -0.0301304819277109, 0.031045900621118, -0.00603409638554224,
-0.0060706060606061, -0.0122051219512195, -0.0247013580246912,
-0.00507329113924053, 0.0101681170483461, -0.00756667506297231,
0.00760421319796951, -0.0126044584382872, 0.00254102040816335,
0.0559696437659033, -0.0168774698795181, 0.00489196078431371,
-1e-05, -0.00122951219512195, -0.0134410134310134, -0.0061981188118813,
0.0111979701120797, -0.0147883251231526, -0.00250999999999995,
-0.0100350626566416, 0.021508987341772, 0.00618578686493161,
0.00984221674876846, -1e-05, -1e-05, 0.00486804878048781, -0.0194274757281553,
-0.0222872277227723, -0.00127582278481024, -1e-05, -0.0101494169835235,
-0.00128040973111387, -0.00384615384615383, -0.0694980694980694,
-0.020746887966805, 0.0409604519774012, 0.0284938941655359, 0.025065963060686,
0.012870012870013, -0.00889453621346892, -0.0256410256410257,
-0.0197368421052631, -0.0308724832214766, 0.0124653739612188,
-0.0177838577291382, -0.0250696378830083, 0.0257142857142856,
0.00278551532033422, 0.0208333333333333, -0.00952380952380949,
0.00686813186813184, -0.00409276944065484, -0.0534346575342465,
0.0188033140376265, -1e-05, -0.00356113636363646, -0.0192544761225944,
0.00144348837209291, 0.011601030478955, 0.0114677618364419, 0.00708219858156018,
0.00703225352112675, -0.00420580419580423, 0.00279898876404478,
-0.011214481792717, -0.0226728895184134, -0.00290855072463774,
0.00289697674418605, -1e-05, 0.00723637681159424, 0.00142884892086321,
0.014357816091954, 0.0113214447592068, -0.00421168067226878,
-0.0140746976090015, 0.00712266761768905, 0.00282286118980186,
-0.0198122598870057, 0.00866460157353239, -1e-05, 0.00141857142857133,
-0.00571613409415122, -0.00718360114777621, 0.0158859537572254,
0.00994732574679931, -0.0155029577464787, -0.0014406151645207,
0.00428799426934086, 0.00284306704707566, -0.00427742532005697,
-0.0128671428571428, -0.0029043560057888, 0.0145037880986939,
-0.00430184549356232, 0.0043003448275863, 0.0128655364806867,
0.0141142937853108, 0.00322119777158776, 0.000934024877832073,
-0.00555785020804438, 0.00138470013947007, -0.00418827298050133,
-0.0056044055944056, 0.00420940928270037, 0.00559224089635852,
0.00416827298050133, 0.00692481276005548, -1e-05, -0.00965187327823685,
-1e-05, -0.00974574408901257, 0.0126304494382022, 0.0013769625520111,
-0.00693520775623262, -0.00977290097629018, 0.00703225352112675,
0.00530468531468526, -0.00112296605453537, 0.00138275766016733,
0.00346705146036148, 0.0145430145530146, -0.00171765027322406,
0.00170057133082453, 0.0109189617486339, -0.00406405405405412,
0.00677426051560388, -0.00405312668463613, 0.00540271989174552,
0.00941126514131902, 0.00532333333333341, 0.00396877984084882,
-0.00661501981505956, -0.0119780851063829, 0.00402768506056523,
-1e-05, -1e-05, -0.00671241286863271, -0.00675763832658565, 0.0108595652173914,
0.00267817204301075, -0.00135048257372654, -0.00672140939597314,
0.0121521621621621, 0.0133411348464619, -0.00132752305665345,
0.00526704485488134, 0.0104886876640421, -1e-05, 0.0285614285714285,
-0.00884838383838387, 0.00381165605095541, 0.00125903553299496,
-1e-05, -1e-05, -0.00381228136882121, -0.0254552926208651, -0.00131548302872058,
0.00391156862745097, -0.00131208333333326, -0.0169591525423728,
-0.00531503978779839, 0.0266566666666666, -0.0155944155844156,
0.013182612137203, 0.647125416666667, -0.00554359683794463, -0.00159982511923689,
-0.00319471337579629, 0.00158744408945683, -0.0151615151515151,
0.00403858299595157, 0.00402225806451601, -0.00804212851405621,
-1e-05, -1e-05, 0.0121357489878543, -0.00801000000000001, -1e-05,
-0.00605838709677424, 0.00201839756592299, -1e-05, -0.00405858299595134,
0.0162501626016259, -0.000810000000000023, -0.00721576461168931,
-1e-05, 0.00402225806451601, 0.00802212851405633, -1e-05, 0.00795812749003983,
-0.0118677075098815, 0.00799000000000001, -0.00397825396825384,
0.00397406374501992, -1e-05, 0.00395825396825395, -0.00396256916996056,
NA, -1e-05, -0.00794650793650791, -1e-05, -0.00401, 0.00400606425702816,
-0.00401, 0.0120381927710843, 0.00395825396825395, -0.00396256916996056,
0.00395825396825395, -1e-05, -1e-05, -0.0079151383399209, -0.00399406374502003,
-0.00801000000000001, 0.00805451612903225, 0.00799000000000001,
-0.00397825396825384, -1e-05, -1e-05, 0.00397406374501992, -0.00397825396825384,
-1e-05, -1e-05, 0.00396406374501992, -0.00398825396825384, 0.0119321912350598,
-2e-05, -0.00789401574803148, 0.0118847619047619, -0.00394156862745108,
-0.00395700787401563, -2e-05, -0.00397256916996056, 0.00394031746031755,
-1.20947991682851e-05, -2e-05, 0.00393256916996045, -0.00395700787401563,
0.00393256916996045, -2e-05, -2e-05, -0.00395700787401563, -2e-05,
-2e-05, 0.00393256916996045, -0.00395700787401563, -2e-05, -2e-05,
-0.00397256916996056, -2e-05, 0.00394825396825395, -0.0079251383399209,
0.00396406374501992, 0.00394825396825395, -0.00397256916996056,
0.00394825396825395, -0.00397256916996056, 0.00791650793650791,
-0.00395700787401563, -2e-05, 0.00393256916996045, -0.00395700787401563,
-1e-05, -1e-05, -1e-05, 0.0078951383399209, -0.00393156862745108,
-1e-05, -1e-05, -0.00394700787401563, -0.0079151383399209, 0.00397406374501992,
-1e-05, -1e-05, 0.00792650793650791, -0.00394700787401563, 0.00394256916996045,
-0.00394700787401563, 0.00394256916996045, -0.00394700787401563,
-1e-05, -0.00317205533596847, 0.00117953211736716, -0.00199019801980198,
0.00792650793650791, -0.00396700787401563, -0.00398256916996056,
0.00393825396825395, -0.00319205533596847, -0.00082302141157811,
-0.000823650793650791, -0.00320712470214448, 0.00395406374501992,
-3e-05, -3e-05, -0.00320460317460305, 0.00315471337579607, -3e-05,
-0.00399825396825384, -3e-05, -3e-05, -3e-05, -0.00401406374502003,
-3e-05, -3e-05, 0.00597000000000001, -0.00201807157057646, 0.00395406374501992,
0.00195412698412698, 0.00195019801980198, -3e-05, -0.00200628458498023,
0.00195019801980198, -3e-05, 0.00234154150197627, -0.00239593059936907,
-3e-05, 0.00392256916996045, -3e-05, -0.00396700787401563, -3e-05,
0.00392256916996045, -0.00396700787401563, 0.00392256916996045,
NA, -3e-05, -0.00396700787401563, -3e-05, -3e-05, 0.00392256916996045,
-3e-05, -3e-05, -3e-05, -3e-05, 0.00391488188976383, -3.78430757405323e-05,
-0.00395156862745108, -3e-05, 0.0078440157480317, 0.00387625,
-3e-05, 0.00386105058365757, -0.00390596899224807, 0.00386105058365757,
-3e-05, -3e-05, 0.00384596899224807, -0.00196050193050182, -0.00197423597678921,
-4e-05, -4e-05, -4e-05, 0.00189798449612403, -0.00197423597678921,
0.00771193798449614, -4e-05, -0.00580923076923075, 0.0018942359767891,
-0.00390100386100374, -0.00197798449612403, -0.00198174757281551,
0.0155242023346305, -4e-05, -0.0115342528735632, 0.00771193798449614,
-4e-05, -4e-05, -0.00388615384615394, 0.00768200772200793, 0.00379141762452088,
-4e-05), `10025` = c(NA, 0.0165323131575352, 0.0415322580645159,
-0.0385856239514776, 0.00429530201342265, -0.0253942796043838,
0.0388096544157981, 0.0665346534653466, -0.0403515286545365,
0.012769250612666, -0.0468670402445236, 0.0756280064136825, -0.0214906832298137,
0.0662688840929289, -0.0770329801166806, 0.0816563467492259,
-0.0197972570065593, -0.022022143813116, 0.0529982582732023,
-0.0170232325141776, -0.00710134615384621, -0.0113887677036679,
-0.0204581449736745, -0.06151, -0.00214106020245069, 0.0628570581954083,
-0.0365540160743438, -0.039373920750782, 0.0439520081411125,
-0.0130071406290617, -0.0166020463523833, 0.00507837707552212,
0.0254363096189714, -0.00429738469533585, -0.0193210647181629,
0.0508149068653539, -0.00912623195745759, 0.00829564784053145,
-0.00254453301229256, -0.00267802185236936, -0.019245668789809,
0.0164856487855568, 0.0296347738308203, -0.0247059543310995,
0.00749731645247482, 0.00807284920434432, -0.0791881508393885,
-0.0138875510204081, 0.0182019205298013, -0.0586820867208672,
-0.0418985850007197, 0.0632412019230769, -0.0797047859262399,
0.0299301197604792, -0.0146194215861658, -0.0127180181543114,
-0.0113492583512106, -0.00899946063236206, 0.0422170878949016,
0.0032913205282113, -0.0128726981752916, -0.00939393939393951,
-0.004435607219333, -0.0408664925487787, -0.0131347108761813,
-0.0157441973705567, 0.0126978891820579, 0.0203549910438039,
0.00175550590488349, 0.00573522383304126, -0.000158403294788667,
0.00998098859315588, 0.0349803921568628, -0.0031827826614127,
0.0165729055800516, -0.0355967693688303, 0.00589330024813894,
-0.0325316065371569, 0.0419123505976096, -0.00428265524625271,
-0.0319508448540705, -0.0220564900031736, 0.0413659532695117,
-0.0166818603926458, -0.0164891633655522, 0.00578990333494451,
-0.0171491958994074, -0.00343242503259449, 0.0183056173344237,
-0.0298799213104224, -0.00530713623572248, 0.00864368613746043,
-0.0306980052796568, -0.0178823404255319, 0.00674909878682846,
0.0101466534687554, 0.0327098364008181, 0.0181418151815181, -0.000172074554295066,
-0.0246493256605608, -0.0187901229848762, 0.00422441734417351,
0.0121337004553888, 0.00315613897683737, 0.0170996345514949,
-0.0199348734280582, 0.0453157790368271, -0.0049518141240235,
0.0128064049983979, 0.0740172065801964, 0.104113711340206, -0.00227757369614516,
0.0521290374331552, 0.0133318043202034, 0.00325018808777429,
-0.013633297087864, 0.0553625291434364, -0.00109056189218397,
0.00936499999999991, 0.014279116456299, -0.0167979783986852,
-0.0219801492537314, -0.00831179465266745, 0.00589914686692101,
-0.0153080051401297, 0.0886054610986827, -0.0469331647448338,
-0.00060894585529463, 0.0252806628311158, 0.0155382815057284,
0.00919916311730169, -0.00742416676172013, 0.057907720064353,
-0.024993706278514, 0.0103509625668448, -0.0145650777373469,
-0.0292144310171198, 0.00863453665283538, -0.0102945389098389,
0.0119978512873802, -0.0212307644038791, 0.013744516843455, -0.0149576831091181,
-0.0234721220964165, -0.0382600597657184, -0.0184042331593338,
0.0101191466193973, -0.0353572048132365, 0.0141532016632016,
0.0103679628443306, 0.00620354298757293, -0.0137466099558914,
0.000117779197546474, -1e-05, -0.0182800907116391, 0.0318744351900052,
-0.0379719119687225, 0.00208753539590984, 0.0177817320774463,
-0.00926449871465289, -0.0141511520498184, 0.0085437570732992,
0.00429584551148217, 0.442889831103027, -0.00658302359085188,
0.00270911538112923, 0.00143626231582756, -0.00172495622348594,
0.00179831826401451, 0.00531490974729249, -0.0021645919741448,
0.00421852001799368, -0.0139859899659559, -0.0169098727966564,
0.00775340110905727, 0.00099880410858406, -0.00605672469079259,
0.0111431016683566, -0.00265357338195087, 0.00465136550589535,
0.00235535662299864, 0.0133318043202034, -0.00323436184505148,
0.00124797466079614, -0.002881758054384, 0.004310043200432, -0.00296725423425042,
-0.013851452453712, -0.0031999380240612, -0.00695888909207281,
-0.00599471595617356, 0.00730752500926275, 0.00228885057471257,
-0.00514761467889906, 0.00607631501291024, -0.00367636113657193,
0.010385584176633, -0.00246834471455886, 0.00774830595107707,
0.00171085861787874, 0.00677119349005435, 0.00537841490794795,
-0.000456627958910151, -1e-05, 0.00624558534405712, -0.0106671936056837,
-0.0197586535008977, -0.000467875457875456, -0.000468085203848047,
0.00411465627864345, -0.000466412596987699, -0.00594607305936084,
0.00320543408360125, -0.0032151282051283, 0.0100956499770327,
0.0131778126421101, 0.0152503231597845, -0.0238826790450927,
0.0117653623188406, 0.00222813786929283, 0.00668941938365337,
0.0026519343389529, 0.000432477876106073, -0.00177912870411328,
0.00663599025254753, 0.000430140845070491, -0.00308963044434678,
NA, -0.00441140845070425, 0.041988231653404, -1e-05, -0.0144351166737377,
0.0034338226431337, -0.00215500214500213, 0.00901837489251929,
-1e-05, 0.0102158201959948, 0.00125528890763389, 0.00715090985678175,
-0.00837470096194064, 0.00125528890763389, 0.00209614995787695,
0.00755620428751575, -0.00251312891113891, -0.00544705562526131,
-0.00211260723296885, -0.00464548251158885, 0.0025302201524134,
-0.0033883783783784, -0.00594220338983058, -0.00214128729752776,
-0.00812618966253735, 0.00687061154177439, 0.00896203592814362,
-0.00595471810089019, 0.00637658848614078, -2e-05, 0.00294610169491518,
0.00589465990705542, -0.00631987400251997, 0.00674246830092975,
-0.000859630562552429, 0.00670268907563023, -0.0818230050083473,
-0.000474545454545374, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA,
NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA,
NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA,
NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA,
NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA,
NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA,
NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA,
NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA,
NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA), `93436` = c(NA,
8.95215075422673e-05, -0.0196482119679542, -0.0154766252739225,
-0.0215627173661025, -0.0149289099526067, 0.0101996632186674,
-0.0460065723674811, 0.0293045779042485, -0.00577165583470751,
-0.00131713742133766, -0.0294060179757718, 0.00639154504277806,
0.0129019352902937, -0.0304616144161937, -0.0143599144515735,
-0.0283632982021079, 0.0086669856968149, 0.00790722192936211,
0.030010920502092, -0.0719100710876408, -0.0508908403545247,
0.0106540534931981, -0.0726159430787659, -0.0898623985239852,
0.00174687546455827, -0.0309037605396291, 0.0473206883831002,
0.003778130524357, 0.02733375, 0.0870557988013148, -0.0113332155560825,
-0.00114929363794452, 0.0669848373154039, -0.00299188365027574,
0.0100910101010102, 0.0470849720670391, 0.0155157962972843, 0.00834347273300413,
-0.0290830995675508, 0.0106688301583043, 0.0392806445789529,
0.0270667344436496, 0.0211300716275367, -0.0131134146816699,
0.0301973050345508, -0.0169705212725181, 0.011297144945901, 0.0368574698795182,
0.0148168649779224, 0.0164322460382889, 0.020041367548326, 0.028084354624967,
0.0239652513534415, -0.0171298388721047, -0.0497880054644809,
0.023217603558271, 0.0110108562019758, -0.000574579171371427,
-0.0140889988267501, 0.0126833756445855, 0.0340340340340339,
0.0395639547118987, 0.0343333738208025, 0.0389478216620347, -0.0309697837389799,
-0.0277216174183514, -0.000599832047026849, -0.00840268886043527,
0.0270761036235978, -0.0104899226024436, 0.0105217184149924,
-0.00247534478016576, -0.0256420356073735, 0.01051057120912,
-0.00672080649677964, 0.0219904144347336, -0.00760591133004929,
0.00762449368596618, -0.0089461653661228, -0.0149520817592556,
-0.0280570021395988, 0.00430965442764581, -0.0392159553349877,
-0.0420210192837465, -0.04956966930266, 0.0160633702075355, -0.0279725924719678,
-0.00111089986597739, 0.00128378504001165, -0.00804981623277183,
0.00158204940177537, 0.00326537209190298, -0.0174376249459887,
0.0317988537085899, 0.0191215054221719, 0.0235483848334184, -0.0184410877065553,
0.00780611321801878, 0.00765371437749536, 0.0252199845158939,
-0.00924951670220335, 0.000841865136298313, -0.0164504425928414,
-0.00274273820368003, 0.000127011326269754, 0.00770724736289325,
0.0528266866050389, 0.0136768382542825, -0.0261648913043478,
-0.0460947575863272, -0.00421494538141591, -0.0133665887914812,
0.0127365574990695, 0.00104649977032618, -0.011298028265957,
0.019621503225507, -0.00041964952207545, -0.104513437912663,
-0.0013320787145326, -0.0165578615071283, 0.0279475459487444,
0.01630830773105, 0.041617434461569, 0.00993338455682953, 0.019869404560015,
-0.0116497228637414, 0.00213973361996451, 0.00698496362618923,
0.00387996943595443, 0.0368937734108313, -0.000588343268974102,
-0.00944690184731805, -0.00450377612007373, -0.00511088927007624,
0.0265326497277677, -0.00438569060773479, 0.0137518751664743,
-0.034429337887546, 0.00801721088435376, 0.0348125131596707,
-0.00218381852962917, -0.0044542507951723, 0.00926830539629748,
0.0181158401630457, -0.020368618339793, -0.0122268601365158,
-0.00621598591549293, 0.0213372695867842, -0.00252506873075757,
-0.0168338925357562, 0.0129012133003184, -0.0149829352191375,
-0.00328941502326612, 0.00310235605353266, -9.86485528124314e-05,
-0.00878698479542532, -0.00166466660703906, 0.00119946067013072,
0.00665636839515022, -0.00920999999999999, 0.0085577118377967,
-0.00988368795587973, -0.00746665259186057, -0.00439993482983341,
-0.0217837169871358, -0.0179468029739776, 0.00316024699536295,
-0.0530263671524927, -0.0149026632465011, 0.0255234209727982,
-0.00553186560173551, -0.0215756140002974, -0.0146532914471019,
0.0196845544299894, -0.0113564447806354, 0.00182626625860733,
0.0204064757395244, 0.0248378195788844, 0.00456643622200576,
-0.00824882911699147, 0.00282424550430023, 0.00588611149010816,
0.00493114227583187, 0.00741347553627387, -0.0152260390449304,
0.00222507118215838, -0.027013442090464, 0.0165819282511211,
0.0473849909327058, -0.0107259569489939, -0.0139639283856014,
-0.0357962419648853, -0.0218507960199004, 0.0220641569604801,
-0.00423990793729783, 0.00703647676161918, -0.00631241675351095,
-0.0186376468238115, -0.0129864388580733, 0.0264903093421323,
0.0223908036162733, -0.0219200019650227, 0.00496237569060771,
0.013333995202159, -0.00208141448017356, -0.000504217653454587,
0.00874197784810111, -0.0198129508357433, -0.0112116802520378,
-0.0351083664593132, -0.0145285806383982, -0.00320114987767266,
0.0167438149610502, 0.0138963811922755, 0.00894398788882562,
-0.0250433435929003, -0.024791647900663, 0.0173085864580523,
-0.0377168307170132, 0.0127758914301462, 0.000860653534309262,
0.0257063051160767, -0.0193039679847344, -0.00271241055021081,
0.036029453717754, 0.010294964168018, NA, -0.00270514365624202,
-0.0334079196410361, -0.000906766365986124, -0.0397143294614573,
-0.0022642335605894, 0.0293612459359674, -0.00509565310492515,
0.0392689884315308, -0.00446249805850378, -0.000582052628841746,
0.00129086377354566, 0.0297150948396819, 0.00271520817562438,
-0.00559659217877089, 0.0248406933900192, 0.00117524371573892,
0.0298819745474275, -0.00523055654006415, 0.00360097737120852,
0.0234488630366994, 0.0290047182900535, 0.00094658907666385,
-0.0230372139801584, -0.00462151481274458, 0.0154229313491506,
0.0460650730448408, -0.00107731530023356, 0.00994692392502752,
0.00989223090694726, -0.00611650639916981, -0.000629039892113028,
-0.000629411047751696, 0.0355216176662746, -0.00914723449001052,
0.0117806621954325, 0.0226348078536666, 0.0039593239251722, 0.0171009087565889,
0.0228387497991324, -0.000569860571069538, -0.00772228317679889,
0.00172250524731701, -0.00919177307768335, 0.00516692893907358,
-0.0106975691660381, 0.00924817525276835, -0.000894577618763639,
0.0256036820116977, -0.00114503394498953, 0.0178454652788566,
0.0271472771672773, 9.14413075780085e-05, 0.0422115492329979,
0.00133424091233061, -0.00436194604598204, -0.0386602630826422,
0.0121755753857594, 0.0189345604819452, -0.0140075265871155,
-0.0640761588241746, 0.00392546661978978, -0.0419266147859922,
0.0152502757584373, 0.00011000480019192, 0.0018298528117749,
0.00434164484190365, -0.00144101323687234, -0.0104395211177899,
-0.00692902329136329, -0.00798990845384211, -0.00495079216006538,
0.0101668640485862, 0.0480462213104765, -0.00880844961240317,
0.0247035650881791, -0.00210883609998096, 0.00159611854684523,
-0.0429238668295663, 0.0172630173926918, -0.000911925414689586,
0.0328811217521, 0.026817785377717, 0.0267459766116496, -0.00026229771129931,
0.0019367878001298, 0.00135729994242946, 0.0726254078332733,
0.0173222712046095, -0.0286766908133025, 0.0125123728813558,
0.0128257080682961, 0.0325276783235273, -0.0118101466116073,
-0.0384803255482492, 0.0240907384449536, -0.008451052631579,
-0.00397771762208068, 0.0175220399666944, -0.00988205551191404,
0.0101845383623682, 0.00792157068062813, 0.0186694773236375,
-0.0115663778323082, -0.00499501918302872, 0.0175962838998154,
0.0278618712388958, -0.0122345658705821, -0.0247093565179215,
-0.0500589370458491, 0.0435968868882421, -0.0037919588130372,
0.0457722722093818, 0.0122964645458507, -0.00654866428878911,
0.00526247910863506, -0.0275229959052985, 0.00354730783841959,
-0.0344137733825431, 0.0226742566397699, -0.00715323516258873,
-0.00157425248528123, -0.0209418736909941, 0.0209006917659449,
0.0212774592224871, 0.0261985768393145, NA, 0.0176065264100267,
-0.00190677780710238, -0.00155774921409049, 0.0219502854200382,
0.0158919163883451, 0.0192416451750035, 0.0287479785902962, -0.0343002702702703,
0.00469965409157067, 0.0471553151722794, 0.0124982617369331,
-0.0140057263699891, -0.0105271492513455, -0.00433802369413019,
0.00656816116819911, 0.0111455856436706, 0.016468405951116, 0.00216544706097596,
-0.0155730955796062, -0.0400840411666535, 0.0244477437425836,
-0.0282866533778688, 0.00235392238392238, -0.0249010381350074,
-0.0724408848051728, -0.0558656137454523, 0.0141749402583946,
0.00899518293850958, 0.0353025090966619, 0.00698891021331209,
-0.0185821218742412, 0.0134722599795923, -0.0250872878149978,
0.0270902062146008, -0.00911872288569345, 0.0142869999385107,
-0.00464717749757533, 0.0429563459196103, -0.00856504963213818,
0.0124747232037692, -0.027348419368911, 0.00178383543622566,
-0.0346596317187453, -0.01209675951402, 0.0197365747723504, 0.0650126251189052
), mktrf = c(-0.0159, 0.0012, -0.0135, -0.0244, -0.0111, -6e-04,
0.0071, -0.0267, 0.0165, -0.0214, -0.002, -0.0094, 0.0045, 0.0208,
-0.0171, 0.0152, -0.0111, 0.0049, 0.0257, -4e-04, -0.02, 0.0046,
0.0027, -0.0206, -0.0151, -0.001, 1e-04, -0.0117, 0.0198, 0.0178,
0.0175, -0.0051, 6e-04, 0.0143, -0.0122, 0.0053, 0.011, -1e-04,
-0.0069, 0.0234, 0.0054, 0.0051, 0.0037, 0.0021, -0.0127, 0.005,
-0.0011, 0.0169, -0.0012, -0.0036, 0.0063, 0.0072, 0.0054, 0.001,
-5e-04, -0.0086, 0, 4e-04, 0.0107, 0.0041, -0.0011, 0.0064, -0.0041,
-0.0094, 0.0114, -0.0123, 0.0029, -0.0028, 0.0099, 0.0123, 3e-04,
-4e-04, 0.0065, 0.0029, 0.0015, -0.0047, 0.0012, -0.0024, 0.0029,
0.0021, -0.0096, -0.005, 0.0078, -0.0105, -0.0066, -8e-04, 0.0038,
5e-04, 0.0126, -0.0089, -0.0011, -0.0082, 0.0099, -0.0095, 0.001,
-0.0033, 0.0075, -0.0018, 0.0143, 0.0072, -4e-04, 0.0049, -1e-04,
0.002, 0.0035, -0.0038, 0.006, 0.0012, 0.0037, -0.0027, -0.0105,
-0.0084, -0.0019, -0.0011, 0.0024, -0.003, 0.0071, 0.0021, -0.002,
0.0145, -0.037, -0.0207, 0.0176, 0.018, 0.0142, 0.0024, -0.0085,
0.0062, 2e-04, 0.016, 0.0043, 0.0075, -5e-04, 0.0051, -5e-04,
0.0025, -0.0022, 0.0048, -0.0038, 0.0048, -0.0027, 0.0013, -0.0014,
0.0018, 0.0017, -0.0016, -0.007, 0.0045, 5e-04, 0.0093, -6e-04,
5e-04, -0.0029, 0.0054, -6e-04, 0.0039, -0.0057, 0.0012, 0.0032,
-0.0011, -2e-04, 0.0027, -0.0056, -8e-04, -0.0015, 0.0053, -0.0014,
-0.0024, 3e-04, 0.0053, 0.0026, 9e-04, -0.0018, -0.0247, 0.0144,
-0.0148, -8e-04, 0.0107, -0.0036, 5e-04, -2e-04, 0.0112, 0.007,
-0.006, -0.0088, 0.0064, 0.0056, -0.0098, 0.0088, -0.0026, -0.0046,
0.0058, -6e-04, -0.0038, 0.0052, -0.013, 6e-04, -0.0042, 1e-04,
-0.0029, 0.006, 0.0025, -0.0016, 2e-04, 0.0054, -0.0046, -0.0023,
-0.0033, -0.0029, 2e-04, -0.0068, -0.0073, -0.004, -0.0012, 0.0223,
0.004, 0.0146, 0.0032, 0.0018, 0.0021, 0.008, -0.0012, 0.0056,
-0.0016, 0.0077, 0.0031, 0.0016, 0.004, -0.0064, 0.0011, -0.0025,
-0.0036, 0, 0.0075, 0.0048, 0.0126, 0.0036, 0.0046, -0.003, 0.006,
-0.0082, 0.0046, -0.0022, 0.0022, 0.0044, -0.0024, -0.003, 0.0019,
0.0027, -0.0087, -4e-04, -0.0052, 0.0083, 0.0079, -0.0021, 0.0029,
-0.0037, 0.0016, 0.0031, -0.003, 0.0029, -0.0049, 0.0024, -0.0038,
0.0033, -0.0029, 0.0083, 0.0084, -0.001, -0.0012, -0.0068, 0,
4e-04, -2e-04, 0.0082, -0.0027, -1e-04, 6e-04, 0.0072, 0.0038,
0.0049, 0.0045, 0.0054, -0.0016, 0.002, 0.006, -0.0015, -0.0011,
0.0015, 0.0022, -0.0042, 0.0147, -0.007, 9e-04, -0.0038, -0.0036,
-0.0019, 4e-04, 0.0034, 0.0013, -0.0036, 0.0086, -6e-04, -8e-04,
-0.0025, -0.0148, 0.0016, -3e-04, -5e-04, -5e-04, 0.0072, 0.0018,
0.0036, -0.0016, -0.0028, 5e-04, -0.0044, 0.0032, -8e-04, 8e-04,
-5e-04, -0.0049, -0.0075, 0.0089, -0.0025, -8e-04, 0.0083, -0.0028,
0.0118, 0.0066, 4e-04, 5e-04, -0.003, 0.0021, 3e-04, -0.0019,
2e-04, 0.0046, -4e-04, -5e-04, 0.0021, -0.0026, -0.0018, 0.0053,
-3e-04, -0.0197, 0.004, 0.007, 0.0056, 0.0018, 0.0024, 0.0042,
6e-04, -0.0019, -2e-04, 0.0095, 0.0035, -0.0017, -0.0028, 0.0015,
0.0018, -0.0012, -0.0011, 0.0055, -0.0017, -0.003, -3e-04, 0.0086,
-0.0073, -7e-04, 2e-04, 0.0024, 4e-04, -0.0085, 0.0102, -0.0083,
0.0014, 0.0024, 0.0012, -0.0095, 0.007, 5e-04, 0, 0.0072, 0.0017,
0.0042, 0, 4e-04, 0.0059, -1e-04, -8e-04, -3e-04, 0.0038, -6e-04,
-0.0014, -0.0017, -0.0011, 0.0024, -8e-04, -0.0021)), row.names = c(NA,
-400L), class = c("data.table", "data.frame"))