Browse Source

Implemented fancy exp smoothing to sequence data for fatigue and work load.

master
Jeffery Russell 5 years ago
parent
commit
6190974fc3
6 changed files with 461 additions and 16 deletions
  1. +356
    -0
      data_preparation/cleaned/expSmoothWorkAndFatigueData.csv
  2. +105
    -16
      data_preparation/createWorkSequenceData.R
  3. BIN
      findings/Rplot.png
  4. BIN
      findings/Rplot01.png
  5. BIN
      findings/SmoothedFatigue.png
  6. BIN
      findings/SmoothedWork.png

+ 356
- 0
data_preparation/cleaned/expSmoothWorkAndFatigueData.csv View File

@ -0,0 +1,356 @@
"","day","totalWork","averageWorkLoad","smoothedWork","smoothedFatigueData"
"1",0,4855,255.526315789474,4855,0.734457489003587
"2",1,1380,138,5921.8864123285,1.17226558337237
"3",2,6030,231.923076923077,11569.9661032971,1.37713723445689
"4",3,7745,322.708333333333,18568.7841062135,2.14122117421005
"5",4,15,15,17386.2272349068,2.07084549296884
"6",5,15,7.5,16279.9370216023,2.32455167186088
"7",6,12595,279.888888888889,27824.9947995838,2.64144946421754
"8",7,10075,373.148148148148,36105.4769934791,3.23482637227442
"9",8,1750,97.2222222222222,35526.925925298,3.71171475010759
"10",9,8270,275.666666666667,41505.6873598172,4.367443731198
"11",10,9630,310.645161290323,48458.8604436475,4.02391224614595
"12",11,1245,415,46578.6024317046,4.06071992081471
"13",12,120,60,43694.6079278704,4.42194961229369
"14",13,11310,282.75,52186.6109247406,4.8905940005545
"15",14,10065,402.6,58885.9390452222,4.79305519268368
"16",15,1519,75.95,56607.2072969514,5.02320510285851
"17",16,8720,264.242424242424,61676.4378294308,5.43408740344315
"18",17,15120,351.627906976744,72818.7384013009,5.39209584506458
"19",18,0,NA,68122.438415607,5.211384462377
"20",19,820,205,64549.0169751866,5.62155444657945
"21",20,12530,278.444444444444,72916.0562572115,5.88179210428699
"22",21,13502,375.055555555556,81715.4799495798,5.7167777541223
"23",22,1890,85.9090909090909,78335.402278043,5.39891337869871
"24",23,8693,248.371428571429,81976.316006371,5.34496796768551
"25",24,13915,356.794871794872,90604.4162311192,5.18706349273436
"26",25,330,110,85091.0642589241,5.40530132657652
"27",26,0,0,79603.2849779978,5.84123885379856
"28",27,12003,272.795454545455,86472.4291283794,6.24393929981775
"29",28,11340,306.486486486487,92235.5614622504,6.63960620282397
"30",29,2017,91.6818181818182,88304.0120162484,6.53452702106419
"31",30,8320,244.705882352941,90929.0200475163,6.25823948059895
"32",31,11060,316,96124.7333965315,6.53950438972753
"33",32,375,187.5,90300.3595267572,6.65762682900658
"34",33,0,0,84476.6170881478,6.59146650018739
"35",34,10339,240.441860465116,89367.4653578036,6.65551115699305
"36",35,8440,383.636363636364,92043.8880767963,6.63951371930067
"37",36,1719,114.6,87826.7002253114,6.60632335535045
"38",37,9995,312.34375,92157.4915330568,6.33709869507924
"39",38,9108,350.307692307692,95321.9770521668,5.64284187562198
"40",39,2580,430,91754.3753593256,4.92921945015187
"41",40,0,NA,85836.8590558621,4.05255339022682
"42",41,2950,210.714285714286,83250.9812199334,4.57713319854999
"43",42,2800,200,80681.8744419838,4.54276521483052
"44",43,3107,194.1875,78585.4571059198,4.42496191422779
"45",44,2650,147.222222222222,76167.2440444905,4.68824528724741
"46",45,3316,157.904761904762,74570.9888342288,4.63820744486777
"47",46,212,70.6666666666667,69973.6809351358,5.08183917963756
"48",47,30,30,65490.8672831933,5.28396856049602
"49",48,12770,271.702127659574,74037.163799206,5.31361352554287
"50",49,8945,248.472222222222,78207.2838860872,5.13365596305719
"51",50,3500,120.689655172414,76663.4603557853,5.1596789588099
"52",51,12530,298.333333333333,84249.2026595316,4.83989879386053
"53",52,14549,354.853658536585,93364.7175713362,4.48876116324813
"54",53,0,0,87343.3454434892,4.44035260228858
"55",54,405,135,82115.3097584137,4.42703190601711
"56",55,11969,291.926829268293,88788.445857031,4.64280272600819
"57",56,10620,321.818181818182,93682.2112893541,4.6955059344544
"58",57,2517,109.434782608696,90157.3630343986,4.90298678247142
"59",58,12590,307.073170731707,96932.8428707113,4.99519534393142
"60",59,14827,370.675,105508.351584523,4.29078051067369
"61",60,345,172.5,99048.7998864927,4.12584007281451
"62",61,510,127.5,93170.8441528128,4.4703304729828
"63",62,12233,284.488372093023,99394.9755062487,4.7458619624818
"64",63,10827,300.75,103811.693863142,4.82682517503747
"65",64,3547,122.310344827586,100663.564736933,4.69244340942565
"66",65,10480,227.826086956522,104651.467949584,4.23137261198003
"67",66,15293,364.119047619048,113195.179260648,3.83066978789201
"68",67,435,145,106329.880870242,3.75129344729307
"69",68,360,90,99832.3462716915,3.74177377696389
"70",69,13965,297.127659574468,107358.857269263,3.46641591801662
"71",70,10458,307.588235294118,110892.960880408,3.61207543675018
"72",71,4105,136.833333333333,107846.139494459,3.43428788264156
"73",72,9835,245.875,110725.816805761,3.05366022706346
"74",73,11465,337.205882352941,115049.775045121,2.7129047672813
"75",74,450,225,108079.868181027,2.8478726519682
"76",75,255,127.5,101364.471624647,3.14592345903461
"77",76,3240,190.588235294118,98067.1712388964,3.48572935596518
"78",77,1250,312.5,92992.5236962793,2.66831429782826
"79",78,3125,195.3125,90120.1554735875,2.40835490378785
"80",79,11090,382.413793103448,95398.0349376765,2.57616644720609
"81",80,1385,230.833333333333,90630.5280424867,2.55594844401394
"82",81,8545,275.645161290323,93330.4920408502,2.65717612143131
"83",82,14770,422,102081.327220653,2.59870182828566
"84",83,1820,165.454545454545,97317.7946562193,2.54885025043406
"85",84,6735,217.258064516129,97776.4766687658,2.67444977170146
"86",85,3890,204.736842105263,95360.5768954114,2.65823522026778
"87",86,1470,245,90680.4857823021,2.82375781084806
"88",87,4140,217.894736842105,88972.2278554039,2.85321367270864
"89",88,5957,138.53488372093,89191.140632555,3.07485620946327
"90",89,6696,176.210526315789,90134.9350646926,2.7958983671532
"91",90,990,198,85311.8613483912,1.6260792389802
"92",91,960,240,80769.8421974688,0.902619003012676
"93",92,270,90,75830.7515556336,0.738051748825408
"94",93,8950,194.565217391304,79890.1977604925,0.653748399325708
"95",94,10310,312.424242424242,85047.838040498,0.412524435393942
"96",95,850,425,80412.8465487236,0.22052808585821
"97",96,0,0,75226.7796326066,0.67186527786793
"98",97,12195,283.604651162791,82570.1778077377,1.18224702459341
"99",98,11545,349.848484848485,88789.9780944413,1.21318633618191
"100",99,3885,121.40625,86948.6447081541,0.958423972405483
"101",100,11618,258.177777777778,92959.0644635106,0.884140573967966
"102",101,23895,468.529411764706,110858.854127619,0.836358228727342
"103",102,975,325,104684.232388988,0.813629930633868
"104",103,12,6,97944.8306225718,1.06813797152415
"105",104,14390,306.170212765957,106018.073195155,1.32576333963967
"106",105,13045,334.48717948718,112225.64801366,1.6300508105192
"107",106,3115,124.6,108102.877616479,1.68826231170743
"108",107,13600,266.666666666667,114730.997112234,2.00979124827809
"109",108,19935,355.982142857143,127266.649198138,1.94470337250032
"110",109,0,0,119058.839286426,1.76264074945673
"111",110,0,0,111380.375782208,2.00977334929119
"112",111,9440,200.851063829787,113637.119539702,2.55464324222831
"113",112,6954,267.461538461538,113262.319088265,2.59306421571856
"114",113,2735,130.238095238095,108692.690647951,2.44231187376817
"115",114,1465,209.285714285714,103147.771323039,2.93073776903558
"116",115,1060,151.428571428571,97555.4605631474,2.10608889146209
"117",116,2610,113.478260869565,93873.8147848009,2.02452816778663
"118",117,4590,199.565217391304,92409.6094427456,2.09163849026342
"119",118,5540,263.809523809524,91989.8351177322,1.9189976879193
"120",119,2310,177.692307692308,88367.1333045453,2.30542012754928
"121",120,4140,230,86808.0704536222,2.61346225107171
"122",121,9419,200.404255319149,90628.5562664804,2.81433939322015
"123",122,11727,254.934782608696,96510.6474306234,2.32713988799941
"124",123,0,NA,90286.384801272,1.08514392934815
"125",124,0,NA,84463.5436348424,0.288249192252421
"126",125,3340,222.666666666667,82356.2350509179,-0.169188154609028
"127",126,2650,240.909090909091,79694.8331510394,-0.128337411875006
"128",127,3395,125.740740740741,77950.0730837267,-0.181431647979353
"129",128,9955,276.527777777778,82877.8378535514,-0.41525870642856
"130",129,15060,327.391304347826,92592.7962163152,-0.379006654502169
"131",130,930,232.5,87551.207623972,-0.696347743264232
"132",131,0,0,81904.7662801792,-0.701357543192421
"133",132,12660,258.367346938775,89282.4809624898,-0.558981708602153
"134",133,10368,398.769230769231,93892.3845813616,-0.534273486423349
"135",134,4170,134.516129032258,92006.9816171388,-0.419394875258334
"136",135,14283,280.058823529412,100356.173974509,-0.521351253009753
"137",136,16834,374.088888888889,110717.901744201,-0.758587435006076
"138",137,0,NA,103577.370449745,-1.41856849065735
"139",138,0,0,96897.3535469437,-1.5560897580198
"140",139,13913,278.26,104561.151074244,-1.63715727692346
"141",140,1725,345,99542.6871929015,-1.55813675207749
"142",141,12138,289,105260.879177777,-1.23858233108456
"143",142,11105,241.413043478261,109577.287721379,-1.68914150819285
"144",143,970,485,103480.31806417,-2.32019674483383
"145",144,2230,171.538461538462,99036.5603623242,-2.24870450876799
"146",145,4000,235.294117647059,96649.3939924598,-1.82187252023749
"147",146,360,180,90776.183179019,-1.59805115590193
"148",147,2676,148.666666666667,87597.7534384819,-1.03393651525942
"149",148,975,195,82923.3102147772,-1.16221567698174
"150",149,14565,274.811320754717,92140.3359278678,-2.11960803185057
"151",150,4090,170.416666666667,90287.9278636801,-2.20461686895837
"152",151,15030,406.216216216216,99494.9871805035,-2.20852925143858
"153",152,2245,249.444444444444,95323.2554829923,-2.83593984707602
"154",153,60,20,89235.5713402928,-2.65997155797757
"155",154,15144,322.212765957447,98624.5003021311,-2.59306925620175
"156",155,2095,116.388888888889,94358.9089278966,-2.43821619072028
"157",156,15342,295.038461538462,103615.41840201,-2.47218059910427
"158",157,16775,356.914893617021,113707.947672054,-2.98427174592351
"159",158,1440,480,107814.579300816,-3.40820128804239
"160",159,0,0,100861.292024158,-3.26233929429582
"161",160,11430,238.125,105786.443207914,-2.99479355715332
"162",161,7047,306.391304347826,106010.956542654,-3.14798092231799
"163",162,3885,138.75,103058.990335536,-3.03151758173404
"164",163,9405,200.106382978723,105817.4053292,-3.24420871019732
"165",164,14095,361.410256410256,113087.921823389,-4.32399624198903
"166",165,1115,371.666666666667,106909.54078849,-5.10713837980559
"167",166,0,0,100014.622174155,-5.01684233518359
"168",167,9395,303.064516129032,102959.37764922,-4.76288390871804
"169",168,2345,335,98664.2169653534,-4.92621213988504
"170",169,870,145,93171.0641437631,-5.63201347070976
"171",170,9623,218.704545454545,96785.1813093193,-5.6512026773977
"172",171,903,180.6,91446.2131624198,-5.37872325464732
"173",172,6445,339.210526315789,91993.571168134,-5.01563905013912
"174",173,0,0,86060.6284057926,-4.48360744050644
"175",174,7450,298,87960.3190098294,-3.81181464313922
"176",175,6455,280.652173913043,88742.4928393048,-3.5113603637372
"177",176,1257,125.7,84276.221920288,-2.89236283279562
"178",177,6385,304.047619047619,85225.9942785041,-2.29851745624681
"179",178,9693,220.295454545455,89422.5129538053,-1.6141703779274
"180",179,3628,157.739130434783,87283.3854873652,-2.0691862014061
"181",180,1078,119.777777777778,82732.2168006375,-1.97701757055307
"182",181,570,285,77966.5667041465,-2.66149152611097
"183",182,240,240,73178.2677506626,-3.16295405247205
"184",183,2233,186.083333333333,70691.7806332589,-3.60615564206856
"185",184,3332,222.133333333333,69464.6545667365,-3.63763955139216
"186",185,2497,227,67481.6695599905,-3.18931653846204
"187",186,970,194,64099.5732349666,-2.8140949695299
"188",187,540,270,60505.598498857,-2.05978237250831
"189",188,9420,214.090909090909,66023.4100291993,-1.42280229901796
"190",189,14487,391.540540540541,76252.3612579225,-1.35619015264357
"191",190,4085,157.115384615385,75419.6165819408,-1.02546919566031
"192",191,14435,267.314814814815,84990.578120812,-0.987933837633813
"193",192,14930,403.513513513513,94439.2794938951,-1.39519209115425
"194",193,0,NA,88348.605627892,-1.7101921140598
"195",194,0,NA,82650.7376826967,-1.40720936100493
"196",195,12785,266.354166666667,90105.3424201787,-1.06733072316058
"197",196,13640,349.74358974359,97934.1772227429,-1.09299674187739
"198",197,4410,163.333333333333,96028.1068652004,-0.692334444273978
"199",198,12090,287.857142857143,101924.964731758,-0.343874792251122
"200",199,17320,468.108108108108,112671.516455661,-0.547592458301706
"201",200,1450,483.333333333333,106854.990658375,-0.849461714054149
"202",201,90,90,100053.590146398,-0.610116593022268
"203",202,8060,268.666666666667,101660.832459446,-0.464823271407386
"204",203,6575,298.863636363636,101679.418869941,-0.703108907579951
"205",204,2670,190.714285714286,97791.8065867855,-1.28834885261049
"206",205,6035,177.5,97519.9181407988,-1.66346619156233
"207",206,9850,394,101080.564600429,-2.05434229454729
"208",207,4377,175.08,98938.5742346409,-1.95155387402133
"209",208,2570,171.333333333333,95127.7272855758,-1.89367204608995
"210",209,6760,293.913043478261,95752.653345839,-2.42846908300132
"211",210,3430,285.833333333333,93007.2760403435,-2.72937906494616
"212",211,2317,136.294117647059,89325.9563945051,-2.82470536586755
"213",212,10625,247.093023255814,94190.0561516893,-3.75908792834213
"214",213,14325,397.916666666667,102440.455450426,-4.12781994575865
"215",214,0,NA,95833.7616236934,-4.47213176873685
"216",215,0,NA,89653.1534008202,-4.14932797750204
"217",216,14270,269.245283018868,98141.1512365784,-4.02304377108622
"218",217,12574,405.612903225806,104385.732500863,-3.75907428747003
"219",218,3859,142.925925925926,101512.5818922,-3.68113264820081
"220",219,8610,239.166666666667,103575.729428747,-3.50058751721727
"221",220,2235,558.75,99130.8183603377,-3.26456248730921
"222",221,0,NA,92737.5730079965,-2.95293898533694
"223",222,0,NA,86756.6473238603,-2.39019425061538
"224",223,16015,333.645833333333,97176.4495693959,-2.38191837873351
"225",224,6765,338.25,97674.2473527426,-2.1675751748704
"226",225,3502,134.692307692308,94876.9406561967,-2.39884112888887
"227",226,12480,235.471698113208,101238.040702302,-2.61480272427831
"228",227,13525,450.833333333333,108233.894227919,-2.36304668558317
"229",228,540,270,101793.564067392,-2.26898566724863
"230",229,0,0,95228.5902163083,-1.78635611290722
"231",230,395,197.5,89482.01132207,-1.15188349967945
"232",231,4800,120,88511.0466264748,-0.907911233273577
"233",232,4391,156.821428571429,87193.7023715264,-0.771870460074191
"234",233,3387,141.125,84957.3176193309,-1.19645481907353
"235",234,1550,140.909090909091,81028.1640624338,-1.3669941096583
"236",235,0,NA,75802.4134646947,-1.93842802621238
"237",236,0,0,70913.6872784766,-1.55101036474046
"238",237,10610,225.744680851064,76950.2497833627,-1.72888670003712
"239",238,7345,333.863636363636,79332.4961722635,-1.69124326277177
"240",239,3585,115.645161290323,77801.1043091466,-1.52856703874811
"241",240,13870,283.061224489796,86653.4765243801,-2.03619081942325
"242",241,10470,299.142857142857,91534.9325658309,-2.52892405297601
"243",242,0,NA,85631.5687897329,-2.97169334038357
"244",243,0,0,80108.9307420106,-3.03299417497534
"245",244,12750,250,87692.464272565,-2.93872580610086
"246",245,6086,234.076923076923,88122.9128616202,-2.61589916284949
"247",246,635,48.8461538461538,83074.6005233783,-2.03072230344259
"248",247,8245,257.65625,85961.8690683317,-2.38840882952337
"249",248,0,NA,80417.9289597976,-2.08896157702047
"250",249,0,NA,75231.5342636671,-2.68157666994471
"251",250,1915,136.785714285714,72294.6257983061,-2.38452958530912
"252",251,5903,281.095238095238,73535.1274145623,-1.95399539977659
"253",252,4380,219,73172.6253415131,-1.03459457430505
"254",253,30,15,68483.502120087,-0.324807036740914
"255",254,4527,251.5,68593.794592769,0.746032606821206
"256",255,4883,143.617647058824,69052.9739713594,0.862256382147021
"257",256,2254,118.631578947368,66853.5394874132,0.964822289286972
"258",257,4739,163.413793103448,67280.9531645622,0.525813577985126
"259",258,1007,83.9166666666667,63948.801645033,-0.642565980605287
"260",259,2538,97.6153846153846,62362.5506233298,-1.28323522978287
"261",260,2540,211.666666666667,60880.6017125129,-1.16156972453835
"262",261,1605,160.5,58559.2281549837,-0.835951243290449
"263",262,2440,203.333333333333,57222.5669770474,-0.15120273843113
"264",263,7804,185.809523809524,61336.1111084675,-0.522636694504213
"265",264,4526,156.068965517241,61906.3603766467,-2.58366233086301
"266",265,1395,232.5,59308.8325502376,-3.50126964349384
"267",266,1992,221.333333333333,57475.8271248178,-4.27981330789592
"268",267,560,112,54329.0377457368,-4.97301877532652
"269",268,7690,240.3125,58515.1943011832,-5.49740727855083
"270",269,9980,285.142857142857,64721.3729992392,-5.6851891761084
"271",270,150,150,60697.296521625,-5.47282320915411
"272",271,270,90,57052.7448685155,-5.59804781595529
"273",272,15480,315.918367346939,68853.2413397231,-5.54319906159487
"274",273,8550,305.357142857143,72962.6882153787,-5.05553585375382
"275",274,4317,126.970588235294,72574.1044721708,-5.26409653593119
"276",275,5170,191.481481481481,73063.5816661302,-4.94870764127353
"277",276,5113,213.041666666667,73464.4910000928,-4.1881939614329
"278",277,0,NA,68726.5444823793,-3.08211045319429
"279",278,0,0,64294.162420352,-2.3785922450207
"280",279,3465,247.5,63612.6380409966,-1.61710552949709
"281",280,8359,225.918918918919,67869.0672236404,-1.15852682001907
"282",281,3425,214.0625,66916.986455296,-0.93471147733515
"283",282,2595,259.5,65196.3082461956,-0.511562466995274
"284",283,3160,185.882352941176,64151.6017625904,0.106536838397893
"285",284,6952,173.8,66966.27154987,-0.139183601373872
"286",285,5208,173.6,67855.4147964275,-1.42336928173112
"287",286,260,130,63739.2145142757,-1.84654290918482
"288",287,625,78.125,60253.4803985336,-1.85805906148736
"289",288,2685,122.045454545455,59052.5517852938,-1.68362620746354
"290",289,1975,131.666666666667,57219.0746790837,-0.862390024111918
"291",290,3345,167.25,56873.8440393286,-0.461360799778488
"292",291,555,111,53760.8783643907,0.159221396281252
"293",292,60,60,50353.6772313227,0.375128293724315
"294",293,10016,222.577777777778,57122.2167719299,0.417391571180711
"295",294,9630,321,63068.2327906307,0.146363102563178
"296",295,2495,118.809523809524,61495.7723092351,-0.531684113842125
"297",296,12360,262.978723404255,69889.7245452034,-1.39014798142728
"298",297,10405,315.30303030303,75787.3254939735,-2.16494377084997
"299",298,0,NA,70899.572376477,-2.07794912499982
"300",299,0,NA,66327.045193949,-1.84605638070581
"301",300,12025,261.413043478261,74074.414075447,-1.65813741556915
"302",301,5115,243.571428571429,74412.1317797051,-1.34989595385612
"303",302,2690,107.6,72303.0690510073,-1.60614835885251
"304",303,10325,258.125,77965.0261364407,-1.65216099735796
"305",304,5527,276.35,78463.826538813,-1.38641058670367
"306",305,0,NA,73403.4577993688,-1.42502683481083
"307",306,0,NA,68669.4474967831,-2.21488390521384
"308",307,3265,181.388888888889,67505.7477915025,-1.96112791920775
"309",308,7535,163.804347826087,70687.0985887333,-1.89413041192959
"310",309,174,34.8,66302.2744813786,-1.52371118434185
"311",310,4010,267.333333333333,66036.2409008133,-1.20761328434503
"312",311,6507,154.928571428571,68284.3646279414,-1.29849978046495
"313",312,2397,119.85,66277.5000778851,-1.94905815094166
"314",313,2125,177.083333333333,64128.0642732951,-3.0570244403338
"315",314,4577,240.894736842105,64569.2520642241,-3.28487719600967
"316",315,690,230,61094.9863243489,-3.30998222727639
"317",316,1500,375,58654.7864568395,-3.23179943508104
"318",317,8550,285,63421.9624359113,-3.2380470501045
"319",318,11465,272.97619047619,70796.6888632079,-3.27572807612391
"320",319,728,104,66958.7969486412,-3.04444951030205
"321",320,474,158,63114.4222547676,-3.40920579493496
"322",321,11080,307.777777777778,70123.9828755701,-3.4476733879
"323",322,9940,331.333333333333,75541.4757983333,-3.58552392015834
"324",323,15,7.5,70684.5782689377,-4.0310408516131
"325",324,9170,286.5625,75295.9167046053,-4.99433404295782
"326",325,14250,323.863636363636,84689.8560215172,-5.22473246064552
"327",326,0,NA,79227.9518694513,-4.94715663606704
"328",327,0,NA,74118.3023836206,-4.85827373517097
"329",328,14240,296.666666666667,83578.1895985626,-4.72307474742378
"330",329,9915,381.346153846154,88102.9801657522,-5.20068756803013
"331",330,60,30,82480.9533471633,-5.76805115218023
"332",331,7562,222.411764705882,84723.5079883383,-6.23022972874334
"333",332,9405,247.5,88664.4335194725,-6.4521657243094
"334",333,1905,238.125,84851.196881338,-6.00694589205479
"335",334,720,360,80098.8873707848,-5.89653830396822
"336",335,8986,236.473684210526,83919.06862863,-6.01186974378171
"337",336,6670,290,85176.8748794311,-5.79257542688817
"338",337,100,50,79783.5614128719,-5.63420036594339
"339",338,5640,194.48275862069,80278.0789924407,-5.67176320225818
"340",339,5500,239.130434782609,80600.7036423482,-5.30455280666865
"341",340,0,NA,75402.5212558801,-4.71480004059679
"342",341,260,130,70799.5853238709,-4.43056103882272
"343",342,8950,229.487179487179,75183.5066078232,-3.73032433876221
"344",343,2953,128.391304347826,73287.6955907894,-3.18452689199416
"345",344,0,0,68561.1511420544,-2.71877125826054
"346",345,5125,189.814814814815,69264.4357952004,-1.89984389654846
"347",346,0,NA,64797.363500684,-1.18981467119339
"348",347,60,60,60678.3861665227,-0.179710944140866
"349",348,0,NA,56765.0540992278,0.394813199648489
"350",349,2445,135.833333333333,55549.1046155253,0.951563739251782
"351",350,4410,245,56376.575380076,1.44075538175343
"352",351,0,0,52740.6800602226,1.94611731848964
"353",352,2630,239.090909090909,51969.274591656,2.56030455430364
"354",353,840,140,49457.6193875204,2.46187219653666
"355",354,446,148.666666666667,46713.9484000605,NA

+ 105
- 16
data_preparation/createWorkSequenceData.R View File

@ -27,6 +27,92 @@ plot(dayList, averageWorkLoad, main="Average Work Load")
plot(dayList, workLoad, main="Daily Total Work Load") plot(dayList, workLoad, main="Daily Total Work Load")
fatigueFunction <- function(workLoad, index)
{
if(index == 1)
{
return(workLoad[1])
}
else
{
return(workLoad[index] + (exp(1)^(-1/15))*fatigueFunction(workLoad, index -1))
}
}
smoothedWork <- c()
for(day in dayList)
{
smoothedWork <- c(smoothedWork, fatigueFunction(workLoad, day + 1))
}
plot(dayList, smoothedFatigue)
fatigueData <- readFatigueSums()
dayNum <- max(fatigueData$TimeSinceAugFirst)
dayList <- 0:dayNum
slidingAverage <- c()
window <- 21 - 1
for(day in window:dayNum)
{
windowAverage <- mean(fatigueData$fatigueSum[c((day-window):day)], na.rm = T)
slidingAverage <- c(slidingAverage, windowAverage)
}
smoothedFatigueData <- c()
for(day in dayList)
{
smoothedFatigueData <- c(smoothedFatigueData, fatigueFunction(fatigueData$fatigueSum, day + 1))
}
plot(dayList, smoothedFatigueData)
workTibble <- tibble(day = dayList, totalWork = workLoad,
averageWorkLoad = averageWorkLoad,
smoothedWork = smoothedWork,
smoothedFatigueData = smoothedFatigueData)
workGraph <- ggplot(data = workTibble) +
theme(plot.title = element_text(hjust = 0.5)) +
ggtitle("Team's Smoothed Work") +
geom_point(mapping = aes(x=day, y=smoothedWork)) +
labs(x = "Days Since August First 2017", y = "Teams Training Work")+
theme_bw()
fatGraph <- ggplot(data = workTibble) +
theme(plot.title = element_text(hjust = 0.5)) +
ggtitle("Team's Percieved Fatigue") +
geom_point(mapping = aes(x=day, y=smoothedFatigueData)) +
labs(x = "Days Since August First 2017", y = "Teams Average Normalized Fatigue")+
theme_bw()
for(gameDay in games$Date)
{
fatGraph <- fatGraph + geom_vline(xintercept = gameDay, linetype="dotted",
color = "blue", size=1.0)
workGraph <- workGraph + geom_vline(xintercept = gameDay, linetype="dotted",
color = "blue", size=1.0)
}
workGraph
fatGraph
write.csv(dataTibble, "cleaned/expSmoothWorkAndFatigueData.csv")
slidingAverage <- c() slidingAverage <- c()
window <- 31 - 1 window <- 31 - 1
@ -46,7 +132,7 @@ plot(density(workLoad), main="Total Work Load Average")
dataTibble <- tibble(TimeSinceAugFirst = window:numDays, slidingWorkAverage = slidingAverage) dataTibble <- tibble(TimeSinceAugFirst = window:numDays, slidingWorkAverage = slidingAverage)
ggplot(data = dataTibble) +
workGraph <- ggplot(data = dataTibble) +
theme(plot.title = element_text(hjust = 0.5)) + theme(plot.title = element_text(hjust = 0.5)) +
ggtitle("Team's 7 Day Moving Average") + ggtitle("Team's 7 Day Moving Average") +
geom_point(mapping = aes(x=TimeSinceAugFirst, y=slidingWorkAverage)) + geom_point(mapping = aes(x=TimeSinceAugFirst, y=slidingWorkAverage)) +
@ -54,37 +140,40 @@ ggplot(data = dataTibble) +
theme_bw() theme_bw()
for(gameDay in games$Date)
{
workGraph <- workGraph + geom_vline(xintercept = gameDay, linetype="dotted",
color = "blue", size=1.0)
}
write.csv(dataTibble, "cleaned/slidingWorkAverageSevenDay.csv")
workGraph
################################ Wellness Data ###################################
fatigueData <- readFatigueSums()
write.csv(dataTibble, "cleaned/slidingWorkAverageSevenDay.csv")
dayNum <- max(fatigueData$TimeSinceAugFirst)
dayList <- 0:dayNum
################################ Wellness Data ###################################
slidingAverage <- c()
window <- 21 - 1
for(day in window:dayNum)
{
windowAverage <- mean(fatigueData$fatigueSum[c((day-window):day)], na.rm = T)
slidingAverage <- c(slidingAverage, windowAverage)
}
graphingTib <- tibble(slidingAverage = slidingAverage, days = window:dayNum) graphingTib <- tibble(slidingAverage = slidingAverage, days = window:dayNum)
ggplot(data = graphingTib) +
fGraph <- ggplot(data = graphingTib) +
theme(plot.title = element_text(hjust = 0.5)) + theme(plot.title = element_text(hjust = 0.5)) +
ggtitle("Team's Average Normalized Fatigue") + ggtitle("Team's Average Normalized Fatigue") +
geom_point(mapping = aes(x=days, y=slidingAverage)) + geom_point(mapping = aes(x=days, y=slidingAverage)) +
labs(x = "Days Since August Twenty First 2017", y = "Teams Average Normalized Fatigue")+ labs(x = "Days Since August Twenty First 2017", y = "Teams Average Normalized Fatigue")+
theme_bw() theme_bw()
for(gameDay in games$Date)
{
fGraph <- fGraph + geom_vline(xintercept = gameDay, linetype="dotted",
color = "blue", size=1.0)
}
fGraph
plot(density(slidingAverage)) plot(density(slidingAverage))
plot(window:dayNum, slidingAverage) plot(window:dayNum, slidingAverage)

BIN
findings/Rplot.png View File

Before After
Width: 824  |  Height: 532  |  Size: 64 KiB

BIN
findings/Rplot01.png View File

Before After
Width: 824  |  Height: 532  |  Size: 65 KiB

BIN
findings/SmoothedFatigue.png View File

Before After
Width: 824  |  Height: 532  |  Size: 62 KiB

BIN
findings/SmoothedWork.png View File

Before After
Width: 824  |  Height: 532  |  Size: 63 KiB

Loading…
Cancel
Save