Plotting Curves from Data Frame Columns - r
i am facing a problem in plot ols estimations in a scatterplot:
I have this data frame: With 9 columns and 99 rows:
structure(list(Y = c(-0.145442175, 0.291096141, 0.489923112,
-2.038363166, 1.180430664, 0.188114666, 0.850922634, 1.172142766,
-3.980837975, 0.285762444, 2.497040646, 0.658010994, -0.925171981,
0.37076995, -1.108211119, -0.409242669, -1.234583525, -0.385841816,
0.016744771, -0.584406288, 1.17224811, -0.746804388, -0.625028046,
0.257871468, -2.735845346, 2.619304857, -0.406825232, 0.323665151,
2.218951363, -0.821029648, -0.872854889, -2.663306158, -0.121976044,
0.881566376, -1.972706678, -3.855576256, 2.927421113, 1.314753531,
0.234296206, 0.828464757, -0.909318569, 0.616134903, -0.567630403,
0.624571064, -0.414112923, 0.642200314, -0.309421266, 0.195312598,
-0.519988256, 0, 0.081070175, 0.032446432, -0.534025032, -0.426783307,
-0.38495511, -0.207900219, -1.953789746, -0.616924355, -0.783222881,
-1.935420969, 0.638445535, 1.080925923, -1.598076681, 0.25063631,
-0.697183766, 0.188971653, -0.415267389, -4.154506044, 1.163226552,
0.036569698, -0.547147074, 1.11937374, 0.383311682, -0.875037781,
-0.372684863, 0.306816004, -1.250561544, -1.042237738, -1.757788446,
0.021079982, 1.844023775, 1.674645753, -0.428546132, -0.527705597,
0.542202572, -0.621479123, -0.050415867, -0.122332943, 0.468553764,
0.216998274, 3.088480781, 0.434099931, 2.114916704, -2.407018936,
-0.127060127, 0.546756422, 0.263207486, 0.63453915, 0.76832746
), X = c(0.009476137, -0.0236354, 0.0094081, 0.11715252, 0.032324021,
0.0461193, 0.050794971, 0.032372819, 0.202121874, 0.390821859,
-0.124492596, -0.127305193, -0.22233597, -0.081113713, 0.09952616,
0.22494711, 0.226621495, 0.411607624, 0.089200478, -0.013454832,
-0.013547165, -0.232366214, 0.03140992, -0.026798837, -0.084556341,
-0.091993172, -0.303730207, -0.236679148, -0.284235285, -0.355253166,
-0.179645537, -0.01381843, -0.022950244, -0.050065976, -0.032018504,
-0.087168055, -0.081865767, -0.253991077, -0.242882759, -0.150225053,
-0.16596575, -0.156887247, -0.071795146, -0.100408802, -0.067307731,
0.024006869, -0.019250912, -0.02399429, 0.038421097, 0.062320065,
0.07187025, 0.024019462, 0.038421097, 0.033539309, 0.014351457,
-0.009575137, 0.014343968, 0.028561284, 0.0404213, 0.026065697,
-0.004700435, -0.072739794, -0.042217496, -0.05889531, -0.130522139,
-0.136291869, -0.120099035, -0.091418565, -0.122040844, -0.124609029,
-0.096255449, -0.190338762, -0.11611752, -0.055598423, -0.065293448,
-0.038746326, -0.029090518, -0.067627348, -0.082097445, -0.215845836,
-0.389993696, -0.264371785, -0.126530291, -0.111840985, -0.094952196,
-0.136700196, -0.190968195, -0.156564122, -0.181077278, -0.15381292,
-0.122020692, -0.107867301, -0.068642333, -0.034348677, -0.073289926,
-0.063314884, -0.092537576, -0.165375956, -0.15042398), Null = c(-0.036795117836493,
0.0120555676565338, -0.0366906491623935, -0.22323992930528, -0.0728300398338213,
-0.0955073599141197, -0.103350601084975, -0.0729090354522075,
-0.400153521158964, -0.887015257107641, 0.1362666683468, 0.13919994231771,
0.221388292373518, 0.087380368104602, -0.189831042487278, -0.452154909992189,
-0.456044210600938, -0.948567833126862, -0.170785020294756, -0.00253939338337472,
-0.00240533038312774, 0.228145471304061, -0.0713518661553421,
0.0165138860659871, 0.0915102566139487, 0.100284493544177, 0.265652059802101,
0.230938443729295, 0.257246215885006, 0.281209408151878, 0.188533028671265,
-0.00201164134414489, 0.0110851592192505, 0.0481858583559124,
0.0237904823161768, 0.094614581053392, 0.0882862377341187, 0.241468070168396,
0.234837060900023, 0.162029971029324, 0.176601607696189, 0.168307425791361,
0.0759851164110966, 0.109970788582389, 0.0703849242291975, -0.059492586621119,
0.00581616568295407, 0.0125631925046972, -0.0827672867080164,
-0.123023227393077, -0.139691063870559, -0.0595125909296922,
-0.0827672867080164, -0.074799966578053, -0.044324863847201,
-0.00820062690976645, -0.0443132308515717, -0.0667648997869916,
-0.0860567642206439, -0.0627706942069095, -0.0153914247452083,
0.0771546773236518, 0.0377224646820258, 0.0596889425617937, 0.1425196179012,
0.148379247725525, 0.13162698340227, 0.0996137276510431, 0.133686233062275,
0.136388667637584, 0.105222539655097, 0.197385328960716, 0.127361748973716,
0.0554268640818151, 0.0678473149754353, 0.0330232883757411, 0.0197208677278167,
0.0707862239701058, 0.0885648870712001, 0.216820906265572, 0.286245951224793,
0.247258814186372, 0.138394666330137, 0.122716205945161, 0.103719679674083,
0.148789344619283, 0.197893429730301, 0.168006688568371, 0.189742414352596,
0.165430712615822, 0.133664933948451, 0.11833998959919, 0.0720581343490991,
0.0270069004188009, 0.077834296346802, 0.0653403280475977, 0.100918894574441,
0.176071877748707, 0.162219750035618), OLS_1 = c(-2.97674658085357,
-2.95792547866683, -2.97674412477729, -2.7937460366665, -2.96913739819288,
-2.95639989365184, -2.95069150171007, -2.96910314906723, -2.3856485268894,
-0.647452287114872, -2.68293610049662, -2.670570393744, -2.10297963546522,
-2.84137496711892, -2.84927190111917, -2.23638642750757, -2.22477621905134,
-0.385841816000001, -2.87715002139054, -2.96747293407547, -2.96740133507642,
-2.02609643038743, -2.9697648045679, -2.95427875550959, -2.8310157181346,
-2.80733412921436, -1.38551048535346, -1.99204069101103, -1.57679230211392,
-0.821029648, -2.39395151432173, -2.96718943992586, -2.95867282134313,
-2.9175506236826, -2.94755679517459, -2.82290206987746, -2.83914454134393,
-1.84931168689084, -1.94200482386918, -2.56030139156351, -2.4747687889082,
-2.52507434784403, -2.86749990988846, -2.77838660436577, -2.87908253396987,
-2.97385415360498, -2.96244666805069, -2.95752797222193, -2.96426392038595,
-2.93361303993881, -2.91621877029975, -2.97384869333029, -2.96426392038595,
-2.96826157356433, -2.97653443074828, -2.97023260580068, -2.97653534550966,
-2.9715473503959, -2.96240424133875, -2.97289412424858, -2.9730125951007,
-2.86497897723402, -2.93188917574701, -2.89904800305061, -2.6561144854951,
-2.62935195635151, -2.70174255054932, -2.80922741244202, -2.69350740105694,
-2.68242924921473, -2.79295820376613, -2.32657978700299, -2.718248099245,
-2.90625073580661, -2.88407071600265, -2.93759776247538, -2.95143559806685,
-2.87827902655775, -2.83845377816351, -2.15100018436527, -0.392139380784325,
-1.7590965971582, -2.67400272569948, -2.73540774982849, -2.79741598960129,
-2.62741730304073, -2.322499279269, -2.52681590220219, -2.38514457172383,
-2.541507865502, -2.6935934995898, -2.75082409521646, -2.87570553083222,
-2.94427256930162, -2.86349763526591, -2.88884317216564, -2.80553055841713,
-2.47811758528604, -2.55927025907886), OLS_2 = c(-2.83865555876367,
-2.82203271957637, -2.83865550287755, -2.66277932892391, -2.83073328950317,
-2.8182826854432, -2.81275284604234, -2.83069942358793, -2.27571536741022,
-0.632851535784811, -2.56646067709365, -2.55491098827374, -2.02364579120999,
-2.71420058960775, -2.71564453925406, -2.13442002502496, -2.12343285482248,
-0.385841816, -2.74223576659719, -2.83068449367348, -2.83062014186059,
-1.95158880862936, -2.83135434505306, -2.81870405841395, -2.70456098525177,
-2.68251016192609, -1.35080974869909, -1.91966655284606, -1.53026524143009,
-0.821029648, -2.29619548286091, -2.83042962848176, -2.82271365766308,
-2.78489427206998, -2.81254809712918, -2.69700817487578, -2.71212546804251,
-1.78585373408616, -1.87276085874404, -2.45184700668681, -2.37183555552258,
-2.41889982491589, -2.73848954857785, -2.65553364194069, -2.74924637290594,
-2.8354502300085, -2.82614423798244, -2.82167034953476, -2.82594242161564,
-2.7962902949221, -2.77959589724382, -2.83544467118397, -2.82594242161564,
-2.82986834510621, -2.83829410413293, -2.83315419155684, -2.83829521382395,
-2.83312719078141, -2.82412509152621, -2.83447802392599, -2.83561001727694,
-2.73614728712302, -2.79813447119318, -2.76776591170989, -2.54140667394362,
-2.5163996858597, -2.58402223424852, -2.68427373122372, -2.57633280462435,
-2.56598731123967, -2.66911582708562, -2.23311605677819, -2.59943103595799,
-2.7744383205277, -2.75387620457868, -2.80339428073398, -2.81610308322424,
-2.74850042856033, -2.71148276169435, -2.06864445166113, -0.418358709691658,
-1.7012556906544, -2.558117011201, -2.61544592452239, -2.67326984561107,
-2.5145916492569, -2.22929491666958, -2.42052887445801, -2.28795076147412,
-2.43427089501948, -2.57641320261571, -2.62982944259216, -2.74611100908034,
-2.80953310903525, -2.73477077084888, -2.75830410348864, -2.68083005992821,
-2.37496906485549, -2.4508827380889), OLS_3 = c(-2.58083646581942,
-2.5683178338716, -2.58084089114316, -2.41826149362172, -2.57232965672457,
-2.56041470241702, -2.55521822468909, -2.57229650627193, -2.0704676472292,
-0.605591599496051, -2.34899840070827, -2.33897223601076, -1.87552769159633,
-2.47676312148376, -2.46615920192222, -1.94404642215785, -1.9342224786085,
-0.385841816000001, -2.49034777076914, -2.57529735049815, -2.57524652934739,
-1.81248137667339, -2.57293885513887, -2.56558300171966, -2.46846711008925,
-2.44946096338359, -1.28602268062379, -1.78454238349805, -1.4433981562183,
-0.821029648, -2.11368273887782, -2.57509593622485, -2.56887479307252,
-2.53722183306237, -2.56048377359198, -2.46196139684977, -2.47497795642607,
-1.66737628649693, -1.7434807939705, -2.24936019247138, -2.17965685727221,
-2.22066956504207, -2.49762425675709, -2.42616435450559, -2.50683929408026,
-2.57704694280319, -2.57166448720316, -2.56802106429762, -2.56769302344379,
-2.53990559282486, -2.52451787208599, -2.57704119998386, -2.56769302344379,
-2.57148502596854, -2.58019625622877, -2.57722566059429, -2.58019772985789,
-2.57469359055957, -2.56595475982599, -2.57605200249485, -2.57907626550515,
-2.49561557851369, -2.54841138215235, -2.52265924802504, -2.32724456926626,
-2.30551521644622, -2.36423571438323, -2.45098235381054, -2.35756515622,
-2.3485875529132, -2.43789928063234, -2.05861713726078, -2.37759686441414,
-2.52834152993493, -2.51080007744427, -2.55283331443161, -2.56343418632904,
-2.50620082129485, -2.47442497328161, -1.91488441727801, -0.467310795744689,
-1.59326539683083, -2.34175573481226, -2.39147445613669, -2.44148615865099,
-2.30394357612981, -2.05528024243402, -2.22208856552246, -2.10648769733616,
-2.23405702128991, -2.35763491117015, -2.40392966200837, -2.50415507637054,
-2.55797145858227, -2.49443477420494, -2.51458468009137, -2.44801138045477,
-2.18238842077399, -2.24852076027753), OLS_4 = c(-2.4289478285331,
-2.41681903415288, -2.42895104301202, -2.27867081965274, -2.4213161496905,
-2.41038194422522, -2.40559515788832, -2.42128586809391, -1.95522949388955,
-0.590647453749078, -2.21077815389366, -2.20138321248198, -1.76758669368012,
-2.33060054299992, -2.32313500877883, -1.83755181381677, -1.82840597739465,
-0.385841816, -2.34557046847711, -2.42346978407977, -2.42342111188123,
-1.70861264386732, -2.42187239429871, -2.41422413566286, -2.32281181955877,
-2.30497392699143, -1.21632553238408, -1.68248005204524, -1.36346128591018,
-0.781669317752002, -1.99042352676657, -2.42327691796255, -2.41734804581689,
-2.38744248609079, -2.40939495374384, -2.31670510436427, -2.32892438647688,
-1.57289978140148, -1.64407512538075, -2.11744278294415, -2.05217911016675,
-2.09057710272701, -2.35019495754122, -2.28311871426765, -2.35885543710246,
-2.42560672084754, -2.42000135641999, -2.4165372393818, -2.41707097497419,
-2.39145946177805, -2.3772271125231, -2.42560153071694, -2.41707097497419,
-2.420544236609, -2.42841594588832, -2.4253216199613, -2.42841722040367,
-2.42347169955882, -2.41547562547196, -2.42470587973943, -2.4271143253132,
-2.34830761179908, -2.39799094116799, -2.37373288731684, -2.19039487337143,
-2.17003793409615, -2.22505776553193, -2.30640152341961, -2.21880622042115,
-2.21039315621698, -2.294126428977, -1.93888869626962, -2.23758086989921,
-2.37908034073483, -2.36257901260101, -2.4021644964107, -2.41218787827608,
-2.35825527028976, -2.3284051877118, -1.80440438182757, -0.451087514089169,
-1.50359480720157, -2.20399138892979, -2.25058992243427, -2.29749148286179,
-2.16856567860513, -1.93576601076367, -2.09190575790345, -1.98368936201681,
-2.10311255036163, -2.21887159162467, -2.26226743315126, -2.35633238493592,
-2.407018936, -2.34719820268328, -2.36613768370737, -2.30361375259329,
-2.05473632620086, -2.11665669129059), OLS_5 = c(-2.2911912568638,
-2.28123967681215, -2.29119683586224, -2.14805590207021, -2.28325670505768,
-2.27261386268403, -2.268006850245, -2.28322682471889, -1.84560662105751,
-0.576090713535621, -2.0945064647732, -2.0859234999636, -1.68828464788266,
-2.20368547406672, -2.18986194988925, -1.73587625378362, -1.72735189094969,
-0.385841816, -2.21101101562234, -2.28700200417098, -2.28696051646281,
-1.63411554699496, -2.28380625780731, -2.27896044246845, -2.19661244829441,
-2.18039652225164, -1.18146437845759, -1.6101070827248, -1.31682391434599,
-0.781364138557704, -1.89278224977018, -2.28683751979873, -2.28170279433502,
-2.25507742887343, -2.27469315563211, -2.19106352335337, -2.20216376634672,
-1.50940418054145, -1.57481865165838, -2.00915316980509, -1.94938461398854,
-1.98455653642811, -2.22145418758665, -2.1605019074557, -2.22929361026136,
-2.28754415075922, -2.28401553991566, -2.28099274980288, -2.2790962708342,
-2.25448944582185, -2.24095826297856, -2.28753886744317, -2.2790962708342,
-2.28249611688223, -2.29051254450738, -2.28856644852124, -2.29051401027405,
-2.28539476406181, -2.27754391464367, -2.28663199585719, -2.29003809100396,
-2.21974449731936, -2.26453458741267, -2.24273365564754, -2.0758820670505,
-2.05727208640147, -2.1075473897372, -2.18169509790509, -2.10183883759691,
-2.0941547862828, -2.17052540371127, -1.84552009498619, -2.11897925887711,
-2.2475539961602, -2.23266092019845, -2.26826235385205, -2.27716458812284,
-2.22875067319638, -2.20169236013157, -1.72209385129724, -0.476893951190187,
-1.44569200778405, -2.08830648613957, -2.13084935049209, -2.17358829667077,
-2.05592583172644, -1.84265559786228, -1.98577321824112, -1.88660772323127,
-1.99603456442263, -2.10189853669134, -2.14149931364702, -2.22701080101746,
-2.27258448425562, -2.21873931960315, -2.23587705524471, -2.17915915787995,
-1.95172754860073, -2.00843362344438), OLS_6 = c(-2.14615029819501,
-2.1274826763545, -2.14613692884822, -2.038363166, -2.14482079785526,
-2.13839956793073, -2.1352633011825, -2.14480554064275, -1.77137087834078,
-0.604458131512312, -1.92044345866761, -1.91142894340333, -1.5035051350835,
-2.03720410348948, -2.07364942604987, -1.67230210256299, -1.66457879312031,
-0.427523081653794, -2.09111249534671, -2.1358169999572, -2.13575175544593,
-1.44873737433719, -2.14509683128765, -2.12442374236989, -2.02946586195686,
-2.01185030632841, -0.994510606111227, -1.42450007218492, -1.12983335353955,
-0.596198212559954, -1.7115906309286, -2.13555900800151, -2.12811588444992,
-2.09509015766854, -2.11889016916752, -2.02341958358771, -2.03553614239934,
-1.32305159796573, -1.38891263096519, -1.83141440901763, -1.76969899713653,
-1.80596583024281, -2.05682837956465, -1.99043348930533, -2.06558998487816,
-2.14664801486533, -2.13135448546891, -2.1271468279034, -2.14250449627423,
-2.12545741758249, -2.11509475538252, -2.1466464083569, -2.14250449627423,
-2.14442504670383, -2.14684049810003, -2.13838680613343, -2.1468398441846,
-2.14583791450693, -2.14156460788614, -2.14633891192499, -2.14114136796206,
-2.05492693125432, -2.10632999229998, -2.08080895764288, -1.90090288083161,
-1.88144765246016, -1.93417313784094, -2.01325520240903, -1.9281579797124,
-1.92007377040746, -2.00120005643771, -1.66327168223962, -1.94624457366434,
-2.08634430885867, -2.06937728900294, -2.11086434271986, -2.12206882778948,
-2.06498074945642, -2.03501978622706, -1.5377512452434, -0.29431817292714,
-1.25902518147068, -1.91393009686737, -1.95881793980313, -2.00449939786682,
-1.88004274517372, -1.66034827254381, -1.80722288608151, -1.70526848086161,
-1.81783189921089, -1.92822084254891, -1.97013652098612, -2.0630309651189,
-2.1162243283256, -2.0538104595074, -2.07300962091288, -2.0105124912345,
-1.7721107506457, -1.83066883021211)), .Names = c("Y", "X", "Null",
"OLS_1", "OLS_2", "OLS_3", "OLS_4", "OLS_5", "OLS_6"), row.names = c(NA,
99L), class = "data.frame")
My scatter plot will consist of the first column (Y) and the second column (X).
The third column i will not use.
From the fourth column are the curves that are fitted values of OLS regressions.
How do I include them using the plot function?
i am doing this, but its not working
plot(data[,2],data[,1])
for(i in 4:9){
lines(data[,i])
}
What am i doing wrong?
Basically you want
data <- data[order(data$X), ] ## reordering so that `X` is increasing
plot(data$X, data$Y)
for (i in 4:9) {
lines(data$X, data[,i], col = i) ## remember to set `x-coordinates`
}
legend("topright", legend = names(data)[4:9], col = 4:9, lty = 1) ## add legend
Related
Plot VAR fitted values with original data R
Suppose you have a matrix of time series, where each column is a time series. Now, suppose you take second differences of this matrix, (so the data is stationary), using this code: var_train_data <- diff(var_train, differences = 2) and then you estimate this model: var_1 <- VAR(y=var_train_data, lag=9, type="const") Recall that this function VARcomes from vars package. How can you plot the original data and the fitted(var_1) data? Is there a function to return the fitted data from the VAR to "level"? I want to do this but with a VAR. Thanks in advance!! Here is the data: > dput(var_train) structure(c(8.59225428063812, 8.61632381521795, 8.48941975098913, 8.42616336163893, 8.4656261753598, 8.49981580266834, 8.50658473928686, 8.54846279771184, 8.58669260125764, 8.56316032696837, 8.52323490346238, 8.48186742854092, 8.48127581622944, 8.49729119076164, 8.49055049683316, 8.58344453055748, 8.66539149708416, 7.9357662604667, 6.05291235942189, 6.03890804924141, 5.98225560802266, 5.97240914057282, 5.94306180787981, 6.20137810965131, 6.12654161955374, 5.94624694111468, 5.85594359899009, 5.80529348520438, 5.8381279297813, 5.94886540621632, 5.89095336551159, 5.78449385503938, 5.80588769759335, 5.70948049577085, 5.67528501375454, 5.52325929980363, 5.31085745753021, 5.33500450854624, 5.3938341365814, 5.45958551414416, 5.62663959880732, 5.67152161243798, 5.87292229474808, 6.13320939934395, 6.0539450308861, 5.91620206260743, 5.98431404307914, 5.97698522584315, 6.09421451539306, 6.16657264938364, 6.27079937807193, 6.32011405804798, 6.31492735684061, 6.33107810311843, 6.44029387009958, 6.5049295418109, 6.68300329197134, 7.30512711870751, 7.48990882366175, 7.51140038002074, 7.36108949229449, 7.40527167395002, 7.52991897172882, 7.48794703789686, 7.28420343801981, 7.03762657251759, 6.94570770568258, 6.8027650651245, 6.70994292841968, 6.5635196517431, 6.58704241900519, 6.57918807870411, 6.56763428848419, 6.67249919251384, 6.55714884087979, 6.44556863637826, 6.64144323226655, 6.69044694236696, 6.64031146877134, 6.57024614132845, 6.55644009549116, 6.41999492814714, 6.30406385390409, 6.25618617067998, 6.20859002609663, 6.29478035236011, 6.33882450179958, 6.27861522839648, 6.36442286111981, 6.40470239932559, 6.38864543562845, 6.57792182635296, 6.77748387294482, 6.80771392480191, 6.78808230061387, 6.83179944673993, 6.74635337244069, 6.71228769051817, 6.71323231410622, 6.87445699358062, 6.99334898488415, 7.02875008260248, 6.99559171234453, 6.94609768011091, 6.82185333419185, 6.78972221207055, 7.08994524817146, 6.94355669144552, 6.96382050291509, 7.01613754035382, 7.0956860745406, 7.10902496856521, 7.0683268590798, 7.09328003338984, 7.03698767140573, 6.97311732456672, 6.96941465936886, 6.83249279448159, 6.71302370211151, 6.68918458951307, 6.83687286833789, 6.87816384462923, 6.779867793454, 6.6690749885188, 6.68210859744981, 6.63725803128446, 6.47906806746391, 6.63432043737224, 6.57746390143601, 6.63242090143254, 6.51253166492618, 6.61381121689155, 6.59605370068614, 6.52834257739573, 6.38542432810392, 6.40417606373692, 6.39057618124397, 6.38557758480921, 6.40206794670863, 6.38004182339231, 6.33048455580799, 6.31905391015162, 6.18631691346691, 6.16989597138095, 6.18599200958145, 6.15475193126883, 6.10944958256305, 6.07359299021025, 6.30235729839158, 6.21488078851159, 6.19123711209895, 6.13415226194445, 6.10489951928334, 6.10835829857948, 6.17117854049486, 6.20272828827286, 6.14697144970638, 6.11798126273311, 6.09592248164895, 6.04625173074978, 5.99916211737789, 6.01626801829834, 6.07798622087923, 6.06003704039333, 5.96216446139643, 5.8926960131323, 5.91466063648335, 5.87549237085556, 5.89885310338971, 5.9930422492496, 6.02137002988689, 6.01266675475859, 6.15176510875538, 6.27125844671076, 6.34813949104671, 6.50500387674558, 6.50357881390098, 6.4894121494231, 6.48577961874698, 6.65109576407555, 6.55243995455944, 6.52108609966874, 6.61791214295492, 6.73192688164199, 6.82964630649759, 6.7830420348085, 6.67163010253559, 7.35778808496937, 7.68222895818785, 7.65345178297661, 7.75628546245401, 7.62338589734873, 18.0052565534027, 18.0283161481762, 18.0354203734597, 18.071119409619, 18.1057986145642, 18.1434464627582, 18.1679613320011, 18.1724822603554, 18.1626507380013, 18.1735086813587, 18.2048932826437, 18.2692972785199, 18.2533671856288, 18.2415818049433, 18.2496122176447, 18.2718727763864, 18.3010161442641, 18.3291390076371, 18.3572538287519, 18.3507204046193, 18.3600370069532, 18.3939643481435, 18.4165259145903, 18.4908471052973, 18.4867143437776, 18.4804562806922, 18.469238614477, 18.4879629103507, 18.5207111296724, 18.5392075918007, 18.549601058126, 18.5389132074898, 18.5541926126363, 18.5648519425587, 18.6134248798087, 18.6623309458927, 18.6585086859232, 18.6627389755133, 18.6664151651325, 18.7001141293336, 18.7124583930686, 18.7555889295117, 18.7668588119494, 18.7436675451662, 18.7459556596228, 18.7514145615817, 18.7664618044321, 18.8918838160788, 18.8524507901715, 18.8267408416858, 18.8351746759483, 18.8659203733722, 18.8520280137673, 18.8947341990718, 18.8888147953761, 18.8994685106982, 18.9232996525635, 18.8866047503417, 18.9024896904205, 19.0233652386019, 18.987660272875, 18.9544232700339, 18.9334369249929, 18.9449183299094, 18.9631673064947, 18.9933965789268, 18.9872237290741, 18.9873356136058, 19.0123636641398, 19.0206652835947, 19.0270219591515, 19.1598215152463, 19.1409817254047, 19.1376727583276, 19.1107669946426, 19.1241264422661, 19.1370331827589, 19.1912655465102, 19.2115823692113, 19.2158835209359, 19.2414814594526, 19.2701126456528, 19.2843375695361, 19.457274554838, 19.3897327048706, 19.3892248817594, 19.4122218249334, 19.4394604950819, 19.4541631046363, 19.4997359433774, 19.5176831040473, 19.5230181490842, 19.5320146650821, 19.5251016863462, 19.5528663129766, 19.7183358456188, 19.6474484090812, 19.6534432674726, 19.6576920553381, 19.6789279209334, 19.7218625314866, 19.7970056245357, 19.8212720524189, 19.8242227530495, 19.8192388840771, 19.8436023860703, 19.881222941016, 20.0436302759402, 19.9570453168158, 19.9591040082, 19.9740784817898, 19.9751993031549, 19.986022300742, 20.0531114406967, 20.0696985627145, 20.0800828758451, 20.1153963422351, 20.1076549894179, 20.1267044622338, 20.2723835551353, 20.2393724865888, 20.1653637627644, 20.175313365826, 20.1653179028692, 20.2067113730004, 20.2925659543297, 20.2949687148603, 20.3127893925416, 20.3352981379241, 20.3625848609943, 20.4154309157981, 20.5264488163096, 20.4391570088463, 20.4361213999428, 20.4679188013375, 20.4735221776474, 20.5104401429986, 20.5802596472874, 20.5970515415252, 20.6075988336636, 20.6257156522032, 20.6528395142733, 20.7198461324164, 20.7747860368889, 20.739620648921, 20.7095747158136, 20.6824219109357, 20.6683460262695, 20.6916705410586, 20.759196128171, 20.7576642433693, 20.7734082911213, 20.7797650725761, 20.8116082106002, 20.8694893686511, 21.0404672977562, 20.985356981043, 20.9557258620312, 20.9617164802732, 20.9759120662088, 20.9794392421448, 21.0620148226635, 21.0624457124599, 21.0769973151371, 21.0901703250319, 21.098690344787, 21.1226698925968, 21.2711836808076, 21.2200341433781, 21.207193477524, 21.2331394396842, 21.2179204523064, 21.2683699326247, 21.3524515602354, 21.2680244710733, 21.361479141605, 21.3261431820478, 21.26986226303, 21.2991364766223, 21.4762517489448, 21.3298374568077, 21.3331519252179, 21.3667485789704, 21.3885075875912, 21.3906997195313, 21.4381231831175, 21.458826223458, 21.5063778806171, 21.5151033730744, 21.507010374386, 21.5687143378936, 21.7306835559895, 4.44765724836912, 4.47100191330161, 4.54882158610783, 4.5440708847657, 4.51747797566305, 4.55880902228773, 4.58341393701683, 4.64251003043301, 4.67923099142439, 4.67449572095413, 4.61706049834258, 4.66515462150976, 4.68125825810232, 4.66447683681913, 4.67120538921521, 4.75098823360583, 4.7865929014467, 4.76411723853929, 4.80166768795887, 4.80738451939104, 4.72395597727812, 4.70774920353605, 4.73128098441694, 4.7497092825493, 4.70907556418776, 4.76025128174992, 4.78333093429487, 4.83897472963042, 4.84221516595959, 4.84570544645976, 4.86534283142894, 4.83189781246032, 4.88116983304783, 4.93726397688361, 4.9949887298286, 4.99476493720366, 5.03985402500338, 5.08369093771621, 5.14388523087357, 5.18085114132468, 5.24643999990121, 5.29616550395191, 5.31221160299188, 5.19904892834139, 5.11149173059605, 4.91002237688405, 4.74559139066756, 4.62999621355914, 4.65748259587475, 4.62140362369755, 4.62160891785885, 4.64311994758678, 4.72234866533005, 4.80015528005185, 4.76255281172576, 4.81741428916888, 4.78833902844309, 4.84857045098378, 4.88628200385209, 4.90595450753678, 4.94790389478918, 4.92401525818964, 4.95677349014216, 5.01088694769778, 4.9503589208899, 4.92948635242132, 4.93119567690321, 4.95837860539992, 4.97675522372483, 5.02843176452887, 5.06149708771953, 5.11680002731314, 5.15318428207365, 5.18999785496126, 5.22291283107711, 5.27233625060222, 5.23506513572608, 5.22540885753388, 5.23894254044616, 5.2156683767814, 5.20459712839743, 5.16868853558729, 5.18200968431041, 5.1634206717668, 5.17963852108505, 5.21018392350377, 5.23236124392477, 5.21618459500301, 5.15529912255812, 5.08809220037847, 5.1198724394553, 5.14734561157324, 5.15737088983502, 5.14805750597054, 5.13433360782898, 5.13895940081431, 5.16304129678691, 5.17149369912226, 5.1450893326955, 5.12587216446798, 5.11899200918883, 5.10413318074705, 5.1160008826641, 5.13174199954551, 5.1280052744334, 5.11204768607761, 5.10168238434182, 5.12328408372326, 5.11612649122192, 5.14161587137474, 5.13479881416009, 5.14165443688476, 5.12847989418342, 5.13034008951874, 5.11006252539728, 5.07602981399522, 5.04380082747131, 4.9865270245507, 4.93875062722085, 4.83814457466529, 4.73816812891552, 4.76719339629964, 4.73243951213948, 4.7435649612657, 4.77654431271813, 4.75791190194754, 4.69814760133106, 4.63006025665572, 4.62852090719856, 4.62807952037229, 4.56670114439206, 4.50814804330275, 4.44643563505667, 4.47016149299473, 4.53912223957418, 4.57221861050859, 4.61097392628225, 4.63675759989718, 4.63305952571057, 4.63769373351235, 4.63818304039896, 4.66879922486243, 4.65819557081487, 4.71530442638786, 4.75283411765132, 4.75677199897661, 4.70834590013243, 4.70931748325188, 4.68986307689509, 4.66007542691547, 4.68658557879665, 4.71287923105122, 4.74116955758817, 4.75433533727191, 4.79454505679725, 4.80874809318759, 4.86630450704699, 4.84278723259879, 4.83917234051045, 4.85488742314064, 4.89072885950008, 4.88255695031045, 4.86964539401132, 4.85185198871889, 4.88602282140254, 4.89354723701055, 4.80281371512246, 4.75326969467741, 4.7628424628326, 4.77922033722999, 4.78674176423299, 4.81556668261512, 4.79146335227998, 4.74952108237436, 4.77041301487697, 4.71934595594234, 4.74327045521818, 4.7274675891773, 4.76201943815388, 4.78742822435935, 4.7838694829636, 4.70898722458582, 4.54042300123519, 4.43046567457835, 4.51451988598857, 4.60392217055997, 4.635511244447, 4.69067644375465, 4.68405634850711, 4.70605958678574, 4.74618067900467, 4.83260092214898, 4.58877721775886, 4.5853033584615, 4.58186865729406, 4.55644763424071, 4.57312995884514, 4.59141300784382, 4.61405195391224, 4.62539633475001, 4.62855764989542, 4.63775153880854, 4.6400153979937, 4.63484394226681, 4.66244207350167, 4.66434146018009, 4.67076691372282, 4.68407880009055, 4.68958339529632, 4.68622457601331, 4.69208811620889, 4.6940756895394, 4.69428420237835, 4.70035131806994, 4.71249186301022, 4.7271653599702, 4.7349479901132, 4.74160205558268, 4.74031934574645, 4.75062724305051, 4.74555258590119, 4.7562138340694, 4.77117641542375, 4.77731860313779, 4.78678284676528, 4.79153067887926, 4.79406738928742, 4.81477266396795, 4.80529042610458, 4.82344884188224, 4.84012452381554, 4.82978062729767, 4.84653955140898, 4.85661455200409, 4.84934319669535, 4.85983345926684, 4.86432477646786, 4.87752996938969, 4.88896248079701, 4.89778714881147, 4.90781018324614, 4.89428104718603, 4.88909193570591, 4.91223232224708, 4.90441909943736, 4.89184080947695, 4.90838616906774, 4.9120349738912, 4.91193835958192, 4.88849965474606, 4.86952089013496, 4.82754082787148, 4.82297945991404, 4.83636363788566, 4.81537478739995, 4.80170678155239, 4.79837796712813, 4.80808503798778, 4.82809683942688, 4.84168009931907, 4.85375583235012, 4.86250775605786, 4.86576774877652, 4.85101858001533, 4.88095185322792, 4.889979963576, 4.89811535971474, 4.91927159620284, 4.93489213808326, 4.94589827772837, 4.93753721242439, 4.94070114394025, 4.93820671550976, 4.94272951036566, 4.9566005031372, 4.95762163540098, 4.98371534679409, 4.97127518438922, 4.97300329929901, 4.97577277168663, 4.99013444353118, 4.98890830668264, 4.99059253380479, 4.98920233887426, 5.00013814038861, 4.99339203377456, 4.99332756375832, 4.99585549034717, 4.99514277314306, 4.97378016705823, 4.98107090641032, 4.95128483491647, 4.94360774445335, 4.94820569518161, 4.97397566869503, 4.97837258336568, 4.98575124596766, 4.99233525890304, 4.9912972420199, 5.00502716857625, 4.98574031284931, 4.99974886393147, 5.00248006801806, 5.00029210629614, 5.00032426635492, 5.00234130906807, 4.99807143017482, 5.01211153206913, 5.01282969959663, 5.00369558714223, 4.99803646081775, 4.99122145915995, 4.98203245011163, 4.98898183118227, 4.97676031402907, 4.97661306140277, 4.97790228452433, 4.97467881736556, 4.97074319702324, 4.96777121735822, 4.96666260100269, 4.97008836269719, 4.97439822264025, 4.97499263100689, 4.97356254116369, 4.99650332598755, 4.99359641505544, 5.00958842621975, 5.00937803525786, 5.01453325868578, 5.01528247340244, 5.01105287591122, 5.00468878177894, 5.00658901722306, 5.0002693118926, 4.98932483790769, 4.99855492515587, 4.98814720173172, 4.98315862786098, 4.97816073933055, 4.97250227511499, 4.97217034019837, 4.9727134145512, 4.98093640727607, 4.97743699009155, 4.97708205787666, 4.98170032114438, 4.98999371770747, 4.99342868670462, 4.98710032461129, 4.99711328978229, 4.99575482652789, 5.00170349753027, 5.01247168017715, 5.01239395194275, 5.01245423405598, 5.01879001126698, 5.02033652362449, 5.02739033730593, 5.02651459803757, 5.02453819926525, 5.02388052084628, 5.01926462079431, 4.98975208317983, 4.97258722645873, 4.9635436865624, 4.96424225452655, 4.98770778945255, 4.9635436865624, 4.96633503519968, 4.95371214669663, 4.95441761409803, 4.96214508493582, 4.96772779308498, 4.95159275346247, 4.95934199970871, 4.97397130972466, 4.96772779308498, 4.97880057057624, 4.97535347995162, 4.94946885885877, 4.96494033483413, 4.94662996412034, 4.94378298710842, 7.48320429381319, 7.6561645369399, 7.82110610880829, 7.59320189720296, 7.68683478110016, 7.95667983810111, 7.59617632139741, 7.62474227649511, 7.81676325321851, 7.71940521069487, 7.67181853053348, 8.33880996371242, 7.21094058581954, 8.03822762707727, 7.82261070201569, 7.82357158274152, 7.83735667738348, 8.1046367156374, 7.80815635609445, 7.76703032589162, 7.89220083728877, 7.83855143477394, 7.5073939335162, 8.37816256879826, 7.5059752001373, 8.15552853001404, 7.99048020502086, 7.87268970278342, 7.90447413791873, 8.36780891138641, 8.01981945164711, 7.98025535548044, 8.17482965571992, 8.03312420507814, 8.1396225979523, 8.53154436348939, 8.30064119442864, 8.31217764468587, 8.46515718841819, 8.29227902146296, 8.37957956757638, 8.77038284745496, 8.38757448056262, 8.42970131889157, 8.55673020197898, 7.94125019923153, 7.6879198778969, 9.45050056056844, 8.49521672781314, 8.5173342801255, 8.79041321175791, 8.62481679196763, 8.6089805031612, 9.02875849754497, 8.71206191409011, 8.70162108392494, 8.71428574579492, 8.73089101876822, 8.78844251470506, 9.20696012451967, 6.5096550774221, 9.31509857797606, 9.13789797374865, 8.81392733764639, 8.85674985041305, 9.24914586810566, 7.91025892946504, 9.3832351526754, 9.0349150142277, 9.07250596538971, 8.99441603776387, 9.53980564522775, 8.88032246234735, 9.0418287190433, 9.32660204283357, 9.10057585013137, 9.08539025332009, 9.49154546126259, 9.14507434057652, 9.15862717595491, 9.34371391025786, 9.23770140195837, 9.331902300461, 9.84529784537339, 9.22652292064231, 9.36711817060034, 9.45464102264676, 9.43080717829243, 9.48542815127549, 9.80315392429245, 9.46220102483428, 9.49195605787191, 9.58345398545618, 9.63034810064769, 9.62459170291441, 9.97734143922148, 7.7599692507259, 10.24019393111, 9.83720243907435, 9.76324132919314, 9.80448476069629, 10.1429407688952, 9.78954063027604, 9.81148978580127, 9.90999022870695, 9.88337955430856, 9.86638017850479, 10.3500614614058, 8.04569598345531, 10.5137723520267, 10.0317143144973, 10.0016019420988, 10.0649053768744, 10.4518094727319, 10.0925802568863, 10.1154740580661, 10.2417047261218, 10.2102565428829, 9.95096958506337, 10.736142313028, 10.2104846692811, 10.0464027137144, 10.4566501947458, 10.213399969191, 10.4108390826055, 10.7497332163144, 10.3922428157884, 10.3629994803926, 10.5490843518049, 10.5299430900147, 10.5342652815607, 10.903442654213, 10.523826123055, 9.94829558655345, 11.0676534061714, 10.7289541973848, 10.7146558087789, 11.1095150342409, 10.7975434766392, 10.8030323275495, 10.9150557366667, 10.8468764795822, 10.1911966896029, 11.575751749895, 10.8395599835383, 10.9068704738973, 11.155501263489, 11.0291969763111, 11.0962769537602, 11.4469279398172, 11.0612218040278, 11.1062426423224, 11.2517538845846, 11.2333784859651, 10.9841022587667, 11.7991470802475, 11.2598050882812, 11.254649905487, 11.4720292631746, 11.3598860229692, 11.4170427738813, 11.766391720184, 11.4134853828265, 11.4410605118049, 11.5576389232754, 11.5626475736127, 11.5282047555652, 11.9147793383982, 11.4669389639854, 11.5920019692809, 11.7656439584139, 11.5489709584581, 11.6145933534541, 12.0526884789762, 11.5721225093198, 11.5785294086931, 11.9478679038354, 11.7577088515946, 11.644026901156, 12.282699606583, 11.6893399093708, 11.7081194573217, 12.0745898194066, 11.8513909555241, 12.0120697218447, 12.3777829279197, 11.9427908749701, 11.9852440709239, 12.2849763358503, 12.1610242572971, 12.2863478497246, 12.6987948609176, 8.87626014701704, 8.75781187913873, 8.79677757108755, 8.86048921162718, 9.42285091166665, 9.15587149508903, 9.07157541184028, 9.04422296009634, 8.98415367463587, 8.99264229713128, 8.99995926865439, 8.98630888588454, 9.08279027699937, 9.01801415653217, 9.03092644682495, 9.13585333120665, 9.3964555249613, 9.31056129804753, 9.21149824677136, 9.23582853002755, 9.19896921092407, 9.1993094115266, 9.22157244245253, 9.33255711303986, 9.32050974348142, 9.25734511507957, 9.25346237744606, 9.21161756310925, 9.57206242922829, 9.53477519401849, 9.44848135105606, 9.4736925056348, 9.45353618677624, 9.50006144281617, 9.53134203318552, 9.55522920290037, 9.58433205464551, 9.49975115996635, 9.54279990568933, 9.4939629665153, 9.8456088597159, 9.80015328006924, 9.76821638323259, 9.79109456264224, 9.72522763542793, 9.77851709053319, 9.8204171003855, 9.88434452165958, 9.98640258678757, 9.88349657543331, 9.78072105929449, 9.91545274615568, 10.0965440644382, 10.069889220858, 10.1071834236742, 10.0960053864793, 10.0816170924409, 10.0972659507375, 9.98273573064832, 10.0707648293296, 10.0903422031634, 10.0334967498009, 9.988071454218, 10.0452755646408, 10.214325988114, 10.1943936821307, 10.20408926276, 10.1374653682538, 10.1747246925649, 10.1817608649851, 10.1694093867828, 10.2457147073325, 10.2759167729448, 10.2174707468632, 10.2579653028569, 10.3132625062745, 10.5801172770154, 10.5266233798438, 10.5287486381328, 10.4503144592933, 10.481479184849, 10.4934241207427, 10.502542901769, 10.5494285881606, 10.6156346275554, 10.5119074689424, 10.5311093136153, 10.5900727521127, 10.832499150024, 10.7930060469324, 10.775718578877, 10.7531531154054, 10.773311204382, 10.7696395290979, 10.7637570976447, 10.7977938807946, 10.8750990746633, 10.763894326936, 10.7864939948099, 10.8084313558315, 11.0190608163543, 10.9799244653747, 11.0238093735289, 11.0096646409103, 10.9573562063908, 11.0042746906925, 11.0131160377438, 11.0384446615171, 11.0925921149442, 11.016788345678, 11.0067286524726, 11.1218140056974, 11.2613143806394, 11.2211796761646, 11.2935015874788, 11.2367103049134, 11.1817094995799, 11.2157604633905, 11.2061686914688, 11.2392748154291, 11.4109721102435, 11.3043371225574, 11.2735248395737, 11.4375261360429, 11.5623874976603, 11.5247175044255, 11.5814242903823, 11.5093986724378, 11.5000330452891, 11.5579600619228, 11.5311240131655, 11.5954153362326, 11.6738399129326, 11.57644340322, 11.5655204319799, 11.6321174901907, 11.8360148309349, 11.8553639635506, 11.8913520673329, 11.7944527780615, 11.770991474902, 11.8087026529826, 11.7713523360005, 11.884723151518, 11.9993814545919, 11.8115717892501, 11.8332855179777, 11.9237740730483, 12.0455787827743, 12.0702342014546, 12.1012197983564, 12.0183149296719, 12.0336059065465, 12.0269239230024, 12.1132590047525, 12.5264959691571, 12.2615706812812, 12.0565371292502, 12.2657313524817, 12.1439258858968, 12.2359003050756, 12.3309092088311, 12.3771893569204, 12.3071632432092, 12.3196939443778, 12.3000789109455, 12.321469532421, 12.3683550017493, 12.4759510736235, 12.3701719620075, 12.3835321964786, 12.372549767611, 12.5961565138223, 12.6077080727407, 12.5909743980745, 12.5893548765137, 12.5974984744602, 12.6523879936874, 12.6119355657399, 12.6758307918205, 12.8047085707425, 12.7095434517684, 12.7003715885686, 12.7865053255695, 13.0041421782442, 13.0268258741114, 13.0190226032443, 13.0357037893755, 12.9527882182394, 13.0084592868531, 13.0707965999479, 13.1069788399601, 1.04885832686158, 1.06016074629379, 1.0517956106758, 1.02907998600003, 1.05054370620123, 1.07261670636915, 1.0706491823234, 1.0851355199628, 1.08488055975672, 1.08085233559646, 1.081489249884, 1.08587205516048, 1.07249155362154, 1.05497731364761, 1.05675866316574, 1.06428371643968, 1.06065865122313, 1.05621234529568, 1.05339905298902, 1.05787030302435, 1.0658034000068, 1.08707776713932, 1.08626056161822, 1.10238697375394, 1.11390088086972, 1.12120513732074, 1.11937921359653, 1.10341241626668, 1.1156190247407, 1.12376155972358, 1.12411603174635, 1.12183475077377, 1.12994175229071, 1.12956170931204, 1.12199732095331, 1.11645064755987, 1.12481242467782, 1.13066151473637, 1.13028712061827, 1.12694056065497, 1.12382226475179, 1.12352013167586, 1.13391069257413, 1.14763982976838, 1.14481816405703, 1.14852949174863, 1.14182560351963, 1.14086563926171, 1.14491904045717, 1.14897189333479, 1.14616964486707, 1.15074750127031, 1.14681353487065, 1.11151754535415, 1.10497749493861, 1.10963378437214, 1.12415745716768, 1.17507535290893, 1.20285968503846, 1.22784769136553, 1.23940795216891, 1.254741010879, 1.29442450660416, 1.30428779451896, 1.31314618462517, 1.32544236970695, 1.33728107423435, 1.34408499591568, 1.34199331033196, 1.34027541040719, 1.33616830504407, 1.33360421057602, 1.33332422301893, 1.34717794252774, 1.3502492092262, 1.35168291803248, 1.35827816606688, 1.36772644852242, 1.36755741578293, 1.36926148542701, 1.37264481021763, 1.37322962601678, 1.37643913938007, 1.37906284181634, 1.37644362054554, 1.38911039237937, 1.39412557349575, 1.40094895608589, 1.40630864159528, 1.40823485306921, 1.4138446752069, 1.42340582796496, 1.43641264727375, 1.43605231080207, 1.44839810240334, 1.45451041581127, 1.46166006472498, 1.46774816064695, 1.46930608347752, 1.47885183796249, 1.49059366171423, 1.49849145403671, 1.51209667142067, 1.5250141727637, 1.5392257264567, 1.55144303632514, 1.56488453313021, 1.58308777691125, 1.59737589266492, 1.60896279958586, 1.62553339664661, 1.63594174408691, 1.65233080464302, 1.67114336171075, 1.6897476078746, 1.71673790971729, 1.74453973794979, 1.76317526009814, 1.79187692264759, 1.84186982937622, 1.9460629324144, 2.05986108970089, 2.06767436493269, 2.0783176148561, 2.08271855277262, 2.09358626977224, 2.09674958523685, 2.11582742548029, 2.12810020369675, 2.13596929171732, 2.13972610568317, 2.14456803530813, 2.15013985201827, 2.16007349878874, 2.17165498940627, 2.18057666565755, 2.19162746118342, 2.20308765886345, 2.21304799942168, 2.22367586966847, 2.23629862083737, 2.24751866055731, 2.26100586740225, 2.40972893063106, 2.60366275683037, 2.68572993101095, 2.70501080420283, 2.6676315643757, 2.6479269687206, 2.64641010174172, 2.69966594490103, 2.69665303568271, 2.71396750774502, 2.71900427132191, 2.72876269360869, 2.76276620421252, 2.76620189252239, 2.74632816231219, 2.74196673817286, 2.72905831066292, 2.75190757584346, 2.77801573354251, 2.84089580821293, 2.85681823660541, 2.84754572013613, 2.85858396073969, 2.86184353545653, 2.86958309986952, 2.94279115543111, 2.98631808884879, 3.00648449252989, 3.00620698598987, 3.15207693676406, 3.27614511764022, 3.32011714920345, 3.39367422894347, 3.64822360464499, 3.61835354049394, 3.59374251055335, 3.63237359915986, 3.62209957896007, 3.64554153297999, 3.71611226971083, 3.76031231050606, 3.80307769833913, 3.77959145461296, 3.74772344909971, 3.95072671083008, 4.03652777624058, 4.06630193640976, 4.08838169421096, 4.09074775372752), .Dim = c(192L, 7L), .Dimnames = list(NULL, c("EMBI+", "M2 (pesos)", "Commodity Price index", "emae", "gasto programas SS", "recursos tributarios", "ex_rate")), .Tsp = c(2004, 2019.91666666667, 12), class = c("mts", "ts", "matrix"))
Shade Area using Polygon in R
This is my data: data=structure(c(-0.0471957808923093, -0.0467988635384236, -0.0463342530558707, -0.0457926330882236, -0.0451638382532273, -0.0444368569264807, -0.0435998514313549, -0.0426401983500639, -0.0415445516030975, -0.0402989307802484, -0.0388888369350307, -0.0372993976665075, -0.0355155428026053, -0.0335222113649458, -0.0313045897396848, -0.028848380109615, -0.026140097233332, -0.023167390606974, -0.0199193879382963, -0.0163870547327459, -0.0125635636730607, -0.00844466640840535, -0.00402905939999997, 0.000681265356828354, 0.00568069455370951, 0.0109597029612447, 0.01650460835736, 0.0222973821907433, 0.0283155256820092, 0.0345320202245192, 0.0409153597579977, 0.0474296712607441, 0.0540349276635842, 0.0606872553679083, 0.0673393362019039, 0.0739409011365642, 0.0804393104801724, 0.0867802126590783, 0.0929082711616744, 0.0987679468617816, 0.104304320836165, 0.109463941032544, 0.114195674804447, 0.11845154847061, 0.122187554726899, 0.125364408967776, 0.127948236372159, 0.12991117296429, 0.131231865742443, 0.131895859325063, 0.131895859325063, 0.131231865742443, 0.12991117296429, 0.127948236372159, 0.125364408967776, 0.122187554726899, 0.11845154847061, 0.114195674804447, 0.109463941032544, 0.104304320836165, 0.0987679468617816, 0.0929082711616744, 0.0867802126590783, 0.0804393104801724, 0.0739409011365642, 0.0673393362019039, 0.0606872553679083, 0.0540349276635841, 0.0474296712607441, 0.0409153597579976, 0.0345320202245192, 0.0283155256820092, 0.0222973821907433, 0.01650460835736, 0.0109597029612447, 0.00568069455370951, 0.000681265356828344, -0.00402905939999997, -0.00844466640840537, -0.0125635636730607, -0.0163870547327459, -0.0199193879382963, -0.023167390606974, -0.026140097233332, -0.028848380109615, -0.0313045897396848, -0.0335222113649458, -0.0355155428026053, -0.0372993976665075, -0.0388888369350306, -0.0402989307802484, -0.0415445516030976, -0.0426401983500639, -0.0435998514313549, -0.0444368569264807, -0.0451638382532273, -0.0457926330882236, -0.0463342530558707, -0.0467988635384236, -0.0471957808923093, -169.075778315231, -165.419424999945, -161.763071684659, -158.106718369373, -154.450365054087, -150.794011738801, -147.137658423515, -143.481305108229, -139.824951792942, -136.168598477656, -132.51224516237, -128.855891847084, -125.199538531798, -121.543185216512, -117.886831901226, -114.23047858594, -110.574125270654, -106.917771955368, -103.261418640081, -99.6050653247953, -95.9487120095092, -92.2923586942231, -88.636005378937, -84.9796520636509, -81.3232987483648, -77.6669454330787, -74.0105921177926, -70.3542388025065, -66.6978854872204, -63.0415321719343, -59.3851788566482, -55.7288255413621, -52.072472226076, -48.4161189107899, -44.7597655955038, -41.1034122802177, -37.4470589649316, -33.7907056496455, -30.1343523343594, -26.4779990190733, -22.8216457037872, -19.1652923885011, -15.508939073215, -11.8525857579289, -8.19623244264278, -4.53987912735666, -0.88352581207058, 2.77282750321554, 6.42918081850162, 10.0855341337877, 13.7418874490738, 17.3982407643599, 21.054594079646, 24.7109473949321, 28.3673007102183, 32.0236540255043, 35.6800073407905, 39.3363606560765, 42.9927139713627, 46.6490672866487, 50.3054206019349, 53.9617739172209, 57.6181272325071, 61.2744805477931, 64.9308338630793, 68.5871871783654, 72.2435404936515, 75.8998938089376, 79.5562471242237, 83.2126004395098, 86.8689537547959, 90.525307070082, 94.1816603853681, 97.8380137006542, 101.49436701594, 105.150720331226, 108.807073646513, 112.463426961799, 116.119780277085, 119.776133592371, 123.432486907657, 127.088840222943, 130.745193538229, 134.401546853515, 138.057900168801, 141.714253484087, 145.370606799374, 149.02696011466, 152.683313429946, 156.339666745232, 159.996020060518, 163.652373375804, 167.30872669109, 170.965080006376, 174.621433321662, 178.277786636948, 181.934139952235, 185.590493267521, 189.246846582807, 192.903199898093), .Dim = c(100L, 2L), .Dimnames = list(NULL, c("Y", "X"))) With this data I can plot this graph below: plot(data[,1],data[,2],type="l") abline(h=quantile(data[,2],0.75)) abline(h=quantile(data[,2],0.25)) Using polygon function how can I shade the area (with different colors) between the distribution tails and 0.75/0.25 quantiles lines?
An answer: Let dat be your data frame, oo <- dat[24:76, ]; oo[1, ] <- c(dat[1,1], dat[25,2]); oo[, nrow(oo)] <- c(dat[100,1], dat[75,2]); plot(dat, type = "l"); polygon(oo, col = "gray")
How to plot the forecasted values against actual values observed later in R?
We used the R library forecast to make predictions for the next 24 hours. We have the following: fore_cast=forecast.tbats(model,h=24,level=90) fore_cast Point Forecast Lo 90 Hi 90 5.380952 6270.778 5389.089 7296.643 5.386905 5458.096 4557.375 6536.743 5.392857 5219.995 4248.967 6412.814 5.398810 5187.102 4126.390 6520.328 Now we have 2 problems: We need 'time' (in hour e.g. 01,23,19 etc) instead of 'point'. We wish to plot the trendline against time showing the actual observed values against these predicted values. We have loaded actual observed values from a CSV file. We tried: actual_data = read.csv('actualdata.csv') plot(actual_data,fore_cast) Doesn't work, and using plot(actual_data) just shows some points in a straight line instead of curved trendline. EDIT: Sample output of fore_cast from dput: structure(list(model = structure(list(lambda = 0.000438881055939422, alpha = 0.65694875480321, beta = -0.0983972877836753, damping.parameter = 0.800419363290521, gamma.one.values = c(-0.00150031474145603, -0.00124696854910294 ), gamma.two.values = c(0.0023600487982342, -0.002465549595849 ), ar.coefficients = NULL, ma.coefficients = NULL, likelihood = 13202.294346586, optim.return.code = 0L, variance = 0.00855092137349485, AIC = 13258.294346586, parameters = structure(list(vect = c(0.000438881055939422, 0.65694875480321, 0.800419363290521, -0.0983972877836753, -0.00150031474145603, -0.00124696854910294, 0.0023600487982342, -0.002465549595849), control = structure(list(use.beta = TRUE, use.box.cox = TRUE, use.damping = TRUE, length.gamma = 4L, p = 0, q = 0), .Names = c("use.beta", "use.box.cox", "use.damping", "length.gamma", "p", "q"))), .Names = c("vect", "control")), seed.states = structure(c(7.44188559667267, 0.00357069100887873, -0.0664300680553579, 0.0229067500159256, 0.00460111570469819, -0.00772324725408007, -0.000610110386029883, 0.00568378752162509, -0.0084050648066819, -0.0324093004247092, -0.000720936399990958, -0.00705790547321605, -0.00738992950838566, 0.00180424326179638, -0.00107745502434416, 0.00242014705705761, -0.01824679745657, 0.0123019701003545, -0.0245935735677402, 0.0181321397860132), .Dim = c(20L, 1L)), fitted.values = structure(c(1598.57443298879, 1435.74973092922, 1397.92464316794, 1296.90202189518, 1440.3201303663, 1544.11695101118, 1777.97079874181, 1766.50571671645, 1925.27360388028, 1863.26963233038, 1773.08363764691, 1887.26580055295, 1887.48006609474, 1841.66200850472, 1991.90290660363, 2233.04775631848, 2081.30246965768, 1872.12639817609, 1899.38583561568, 2213.43437455052, 2214.00832820531, 1745.36311914995, 1678.67975050944, 1502.35472259274, 1512.27350460399, 1456.14165844166, 1464.3803467642, 1517.99443293857, 1484.54280422369, 1382.37041287489, 1452.43700910726, 1545.16934543365, 1440.50974319508, 1475.59742668699, 1544.88546424501, 1790.95280713647, 1916.4267023671, 1928.72804180587, 1819.15839770808, 1916.43079357329, 1836.80043977753, 1720.25638746452, 1730.03629161412, 1614.6048115754, 1599.23641723244, 1635.86950932066, 1543.46360784778, 1641.35066985679, 1608.60556151299, 1651.47649465456, 1475.15006990464, 1403.67294742438, 1507.58932406857, 1666.3170708439, 1696.06132797576, 1543.32187293056, 1704.58043626911, 1914.72424191575, 2109.33624862625, 2092.98934458578, 2222.13355258602, 2084.68677709368, 1962.9230489947, 2045.61547393981, 2140.30565941261, 2097.46130996426, 2126.07936955385, 2226.18935508502, 2269.54492801286, 2300.37314952852, 2398.48786829541, 2303.31270702723, 2332.74139979969, 2146.51487558643, 2101.27480789243, 2111.61910899422, 2053.57840714969, 2046.56606362537, 2073.82870990658, 2094.88831798868, 2334.85185938782, 2541.72156227893, 2502.36031483721, 2398.12240784327, 2266.35832277135, 2151.05248890962, 2266.88803633019, 2366.19453856405, 2399.97570044332, 2341.74959623409, 2144.33465155869, 2102.91952061083, 2214.48622101851, 2179.48115699957, 2288.28092735955, 2224.55218736155, 2195.1506809087, 2163.94619334319, 2161.41843642149, 2134.75060670667, 2138.77895768654, 2142.84680080931, 2258.55072549978, 2297.90237035988, 2314.94197015208, 2300.99928929609, 2277.39754662665, 2291.06980363364, 2487.04257346235, 2381.05768214413, 2509.40078456481, 2657.61336243367, 2528.65026804303, 2434.2722174014, 2366.04811963942, 2270.6647135766, 2231.33965004538, 2376.51043520344, 2249.42861599343, 2193.98771109322, 2252.12327312365, 2210.76969838623, 2180.50451255189, 2221.92898123682, 2537.84678083006, 2329.57350097532, 2252.82349908982, 2143.92033677754, 2092.3142840022, 2084.70304624685, 2111.18929138546, 2160.05383108999, 2280.94409931504, 2118.22029344747, 2214.65738250204, 2269.05911898631, 2084.26658709038, 2016.04764576402, 2095.57091797435, 2161.07354463394, 2427.77607700887, 2333.91103594967, 2234.23838054763, 2250.71557301013, 2186.97925802073, 2129.51096829218, 2115.40228652934, 2094.89231085691, 2086.41044567131, 2180.94542608489, 2105.38187642016, 2459.45788915933, 2292.36325639374, 2410.75372754831, 2375.56640249604, 2491.11938114866, 2470.51372278037, 2464.95765202085, 2600.85929020727, 2709.48518695182, 2779.77558137814, 2518.29927341458, 2344.06621605191, 2391.56719713269, 2368.68842788795, 2199.93530349068, 2113.92970206565, 2458.96718445444, 3121.97852988865, 2559.40932439262, 2331.12829078836, 2238.54586985577, 2241.91440620202, 2225.29804576634, 2154.14147781021, 2060.57980596908, 2037.30100544426, 2215.93410789353, 2364.42668160056, 2518.72871618042, 2537.34279365294, 2473.76096855791, 2623.63387707374, 2589.08335304697, 2577.0563838788, 2349.53279218826, 2305.52193868551, 2232.63712180453, 2167.50003597208, 2320.23187534213, 2281.86365949586, 2281.21119271599, 2323.2014703372, 2185.94404743238, 2140.21863271207, 2011.67723856012, 1966.52063119589, 2002.67344212857, 1952.41101080662, 1988.37461163105, 2126.75137749373, 2239.14722292367, 2320.98046489603, 2444.91847853015, 2431.69548763034, 2514.73820659393, 2505.85249387343, 2888.19773974179, 2853.20690693738, 2502.20865871069, 2524.56894781003, 2659.52271740553, 2615.9025930681, 2923.69327019152, 2754.76074569658, 2784.59488335761, 2874.24378479002, 2683.41908597168, 2733.83011888159, 2774.1325162997, 2906.41593326865, 2726.06821502751, 2460.21579967528, 2450.8035097605, 2547.39389733175, 2625.60323572861, 2827.94083526683, 2971.92012845614, 3042.90981987278, 2835.00811374845, 2846.98066660519, 2871.21876763166, 2901.99696373824, 2627.47532996657, 2583.75084300313, 2602.68041642846, 2632.8054092953, 2667.85374690972, 2639.10586730146, 2466.95799545022, 2381.06823502402, 2531.32611053776, 2407.14812148706, 2342.75701798463, 2401.73791085847, 2365.50645844524, 2404.50408575777, 2452.57343738519, 2613.15332739214, 2665.50965844576, 2723.8237337447, 2915.09266385617, 2890.17498445896, 2853.6278331055, 2868.1228183545, 2917.07803535669, 2876.59409770233, 2577.82035337979, 2581.91435020803, 2520.20342021937, 2603.37973251208, 2536.03988578365, 2510.83398648802, 2472.80606784857, 2425.51212342113, 2442.02863541673, 2465.73405821711, 2384.42988766816, 2555.51500549788, 2737.77091706275, 2425.00224845814, 2460.17325671183, 2639.16650619329, 2816.37024420397, 2755.69999167982, 2802.64991688288, 2685.12803367301, 2521.77568128564, 2500.99980614696, 2620.41659854805, 2529.25134423133, 2590.14804885984, 2318.80485234464, 2341.88940012276, 2460.21008281205, 2513.70688167177, 2437.71670675479, 2383.29782281743, 2499.36244454453, 2472.98602901478, 2491.10649022417, 2350.1405559119, 2362.78308814045, 2431.3911847573, 2321.15216823049, 2355.74203614213, 2429.60523843166, 2355.61947983433, 2346.3751018515, 2453.82214513707, 2542.98125962684, 2342.43364707529, 2302.17741211575, 2388.93541944219, 2435.41878657221, .... Sample output from dput for actual observed values: structure(list(index12 = c(6297.416944, 5406.865556, 4718.355556, 5304.729167, 4968.014722, 5081.130833, 5544.955, 4655.009444, 4269.023056, 4346.588333, 4511.455833, 5102.57, 4818.673333, 4862.343056, 4785.176667, 5385.005278, 6469.080833, 7166.025278, 7010.708333, 511.114167)), .Names = "index12", class = "data.frame", row.names = c(NA, -20L))
The value of Point is unusual in spite of hour unit data. I think you failed to make a model. Here is my example: actual_data <- structure(list(index12 = c(6297.416944, 5406.865556, 4718.355556, 5304.729167, 4968.014722, 5081.130833, 5544.955, 4655.009444, 4269.023056, 4346.588333, 4511.455833, 5102.57, 4818.673333, 4862.343056, 4785.176667, 5385.005278, 6469.080833, 7166.025278, 7010.708333, 511.114167)), .Names = "index12", class = "data.frame", row.names = c(NA, -20L)) # I suppose that actual_data was taken per hour. num_actual <- as.numeric(actual_data[,1]) model <- bats(num_actual) fore_cast <- forecast(model, h=24, level=90) fore_cast # Point is from 21 to 44 because of length(actual_data)=20 and demanding predictions for the next 24 hours # Point Forecast Lo 90 Hi 90 # 21 5063.207 2902.187 7224.226 # 22 5108.114 2946.988 7269.241 # : # 44 5108.114 2944.629 7271.600 # plot() has forecast method. It draws actual_data and prediction, and paints Lo90-Hi90. plot(fore_cast, main="")
Identify significant change on a slope
I am trying to find a point where a big change happens on a slope. Tried to use ecp::e.divisive() function with different settings and couldn't make it identify the change the way I need. Below code and plot should illustrate more. Grey lines are cutoffs coming from ecp package, and I am trying to it to plot blue line (which is at the moment plotted manually). Please advise if there are better packages for this task. library("ecp") #get cutoff points ecpOutput <- e.divisive(x, k=1) ecpOutput$estimates #plot plot(x, bty = "n") abline(h = 0, lty = "dashed", col = "grey") #add ecp estimates abline(v = ecpOutput$estimates, col = "grey", lty = 2) #ideal line, doesn't have to be exact, anything around this line is OK abline(v = 384, col = "blue", lty = 2) Data: x is a sorted 1 column matrix (required structure by ecp). x <- structure(c(-27.0409169663486, -26.129156710088, -24.7600585044449, -24.3953228174759, -24.1577613311647, -23.5016667274094, -20.6947912955816, -20.5608424516568, -20.2274448352933, -20.1776769950718, -20.0154244013066, -19.9185729879804, -18.6495729388285, -18.5966280348446, -18.4877201244377, -17.8697488852, -17.6964369055135, -17.4580050047899, -17.4503603253745, -17.2138236467553, -17.1978137674216, -17.0883917900212, -17.0780609255085, -16.5936774343097, -16.5302509987677, -16.5047064149008, -16.3610339293733, -16.3179953827084, -15.8098489669017, -15.8017464582135, -15.7931978631991, -15.7048014947664, -15.6438615495371, -15.5724025176269, -15.4769417976187, -15.4566078151486, -15.3683766952941, -15.3598144860889, -15.2872530572521, -15.2615773975834, -15.1553721281872, -15.1253479156971, -14.8574803029005, -14.7886609612358, -14.7052679457918, -14.6700476095839, -14.4967591359077, -14.3902100635321, -14.1344579537429, -14.1122694462137, -13.6977777268339, -13.5002575880219, -13.3931536856711, -13.2720061859572, -13.1630633420915, -13.120694599871, -13.0989354290794, -13.0305773443162, -13.0247860189105, -12.9679198987695, -12.9339256928714, -12.7503935672128, -12.6086380226913, -12.5204925937268, -12.5018027956008, -12.3362734240611, -12.2633206830352, -12.2389866512024, -12.2261511983906, -12.2082248950284, -12.1988063383678, -12.1625438078306, -12.105137364671, -12.0283612849999, -12.0207914207455, -11.9569828730108, -11.9377135887775, -11.7974478043662, -11.7856404961775, -11.7070359492143, -11.685818522575, -11.6150116648869, -11.5889351441476, -11.5696939812167, -11.5218497980405, -11.4278460823336, -11.2616735602107, -11.1371735315344, -11.1101486927449, -11.0545987008828, -11.0497610649959, -10.9777305856557, -10.9538432991084, -10.8709063558819, -10.8321978567433, -10.7154060103612, -10.6904665022414, -10.6728147078525, -10.6319097418566, -10.6084139374132, -10.5435156393802, -10.4969417190754, -10.4910751521816, -10.4076974735856, -10.1987743033507, -10.1084368444001, -10.067653486032, -10.0184841375099, -10.0184804878766, -9.98796628047806, -9.92940612537163, -9.79791464687017, -9.78385633218692, -9.74746828052048, -9.5340969261009, -9.3872416240278, -9.34975526969295, -9.34350605265574, -9.33678121532548, -9.28246068708019, -9.26231844050325, -9.24219935644902, -9.22973616812829, -9.1945301757694, -9.18742543173638, -9.09818179983656, -8.84383892771356, -8.71390231428188, -8.63727799501085, -8.62365985718404, -8.57368937545283, -8.56896270190976, -8.51750651338242, -8.36994967607861, -8.34940777555791, -8.24579609778514, -8.16499004491889, -8.13648089733029, -8.12443902872708, -8.06884804631702, -8.01978044346555, -8.00857010892087, -7.98752833340474, -7.98494612290397, -7.92263788171607, -7.92262794402356, -7.91254741704133, -7.8612668717642, -7.85956255484269, -7.80614005087113, -7.78172738274975, -7.76590807725416, -7.73362312192246, -7.73353827316045, -7.73074597208869, -7.66932615651785, -7.63405189653259, -7.52008106079428, -7.4794467369495, -7.37006671254996, -7.33891732414829, -7.28638734342099, -7.18383241390338, -7.16967207372779, -7.12414638131948, -7.11845633549842, -7.10069950413643, -7.08453272839936, -7.06225675561229, -7.01372949292662, -6.97700431366834, -6.96221498775977, -6.95474531960413, -6.92853733102012, -6.87948984857266, -6.81875907966932, -6.80049432153244, -6.74491178906506, -6.73722594655536, -6.65241543109368, -6.64432866218849, -6.57471615362753, -6.538942870458, -6.48556582657451, -6.44344567639388, -6.44142334658235, -6.40718664187937, -6.37631310536975, -6.35766817597632, -6.33004629281548, -6.32243131413274, -6.31465060236999, -6.30957529705468, -6.20042487075657, -6.19852760812695, -6.19516991943952, -6.19169299941109, -6.14915041772936, -6.1341182105985, -6.06886854629022, -6.03316938455024, -5.92620275477516, -5.915861751696, -5.8993712054553, -5.8562854376353, -5.81203754357936, -5.81031989834777, -5.79005016179402, -5.70715392727825, -5.64380201251138, -5.61822898444235, -5.61198428778589, -5.55181215637224, -5.5414283688058, -5.51873245882438, -5.51677200116567, -5.51551938308407, -5.50995967349956, -5.47456882908066, -5.46182989367447, -5.34425037377986, -5.32571672656563, -5.24036884690065, -5.2280272754873, -5.13269699736861, -5.13115055948407, -5.09522822858288, -5.06292167413738, -5.05058297801937, -5.00080776299476, -4.99907315892117, -4.96652519349395, -4.94319578011658, -4.93410325981468, -4.88778233710964, -4.86817149761772, -4.86068237590916, -4.86018697766406, -4.79260202993216, -4.78704006512903, -4.7697286436275, -4.74319640834353, -4.66791717712299, -4.63451063153309, -4.55913300698176, -4.54773156325591, -4.5029917001588, -4.50232432311584, -4.48448651461267, -4.48195952916376, -4.45942294767531, -4.43684117621408, -4.39862573806896, -4.39218230499561, -4.32218627745706, -4.29986813130089, -4.25622220689577, -4.24164586680005, -4.1312719357839, -4.12513288512985, -4.07946940297387, -4.07261512152973, -4.01165511465604, -3.95381138375493, -3.95044337911054, -3.92340302872436, -3.91833355363622, -3.87865234740553, -3.84667242505411, -3.78315737709957, -3.76505984684618, -3.76018864171568, -3.71684064078827, -3.70873189126336, -3.69375597807388, -3.69325959119626, -3.6505984611436, -3.62183744181462, -3.58883235361055, -3.52391205093927, -3.51617596119693, -3.51388800083065, -3.33813297717772, -3.26837985172665, -3.25102638292739, -3.24658212799339, -3.22891542458543, -3.17892565704276, -3.1283260157199, -3.04352634415322, -3.02299584335501, -3.01373331291241, -2.99552385674378, -2.86372198270148, -2.83811475137176, -2.77463274263238, -2.69783066358124, -2.69434624147968, -2.65941589188957, -2.6221506974122, -2.57311913722599, -2.56672727866588, -2.56667581533302, -2.55574357522681, -2.50395283367281, -2.49786830801457, -2.46604172470746, -2.42877871397163, -2.4017493435186, -2.369794488014, -2.30769529142191, -2.28289171086166, -2.24736457553032, -2.22224835097905, -2.21993628534018, -2.21938775070459, -2.21330765240871, -2.1970203297687, -2.18405609540363, -2.1707971627096, -2.16975015841871, -2.11020976431672, -1.75392661111203, -1.73701872449349, -1.7094653013083, -1.68198644925752, -1.67745819232374, -1.65515644561234, -1.57194744043552, -1.57116047214388, -1.51000042083035, -1.50463279855355, -1.46346551065156, -1.44224216231154, -1.37311564470336, -1.32779620730326, -1.32592791352896, -1.31204307149482, -1.27756472934721, -1.23603794634302, -1.1702376900797, -1.16378397319292, -1.12499060545068, -1.1088125112075, -0.939262072448041, -0.862163030101959, -0.858354175324213, -0.654474645495292, -0.628257109630334, -0.606705081751156, -0.550295255225927, -0.497332185765383, -0.482929007849059, -0.440957523688129, -0.360777543733516, -0.305426972877309, -0.199639436822714, -0.108018704644053, 0.0346309488381769, 0.034746934017077, 0.0493559949320308, 0.192914632754347, 0.218667918037225, 0.245737147003821, 0.247527541956785, 0.333222558419853, 0.557256844844099, 0.669063496448389, 0.720955292473698, 0.767660102407662, 0.878291398784322, 0.946178076488395, 0.946467111772845, 1.11121506783806, 1.22835778244999, 1.24961769756564, 1.29790330264223, 1.30574614563616, 1.30823862002444, 1.35802473804966, 1.48779920673317, 1.6470804669896, 1.75657725379367, 1.91434060426954, 3.12793082392592, 4.05818631097523, 5.87762107232264, 7.87360999893622, 54.7844606150857), .Dim = c(389L, 1L))
Try: e.divisive(diff(x), k = 1, min.size = 2)
How to plot multiple graphs in one figure in r
I have a problem when plotting two datasets in one figure. The second dataset (B(57,4)) were derived from the first one (2000+,10)(average, std). In the end, I want to get figure like this: Now I use the code following to plot the second dateset: my.data<-read.table(paste(i,"myTS.dat",sep = ""),header = TRUE) x<-my.data$time y<-my.data$wl sd<-my.data$wlsd tiff(paste(i,".tiff",sep = ""),height=3815,width=4305,unit='px',compression="lzw",res=360) gg<-qplot(x,y,xlab = "time",ylab = "Elevation") gg_type1<-geom_line(colour = "blue",size = 0.5) gg_type2<-geom_point(size = 3,shape=21,fill="white") gg_bar<-geom_errorbar(aes(x = x,ymin = y-sd,ymax=y+sd),colour = "red",width=0.05) gg_theme<-theme_set(theme_bw())+ theme(panel.grid.major=element_line(colour=NA)) p<-gg+gg_type1+gg_type2+gg_bar+gg_theme print(p) dev.off() And get figure like this: How to add the first dataset to the figure just like the grey points in first picture? I tried this but it didn't work. origin<-read.table(paste("origin_",i,".txt",sep = ""),header = TRUE) xo<-(origin$time) yo<-(origin$height) p<-gg+gg_type1+gg_type2+gg_bar+gg_theme+geom_point(aes(xo,yo)) Any suggestions or help are greatly appreciated.Thanks. Okay, I put the my.data here: structure(list(time = c(2010.586, 2010.74, 2010.819, 2010.822, 2010.901, 2011.052, 2011.132, 2011.205, 2011.285, 2011.364, 2011.444, 2011.518, 2011.597, 2011.677, 2011.748, 2011.827, 2011.83, 2012.06, 2012.063, 2012.142, 2012.213, 2012.292, 2012.372, 2012.525, 2012.604, 2012.683, 2012.757, 2012.836, 2013.066, 2013.068, 2013.148, 2013.219, 2013.299, 2013.381, 2013.452, 2013.46, 2013.532, 2013.611, 2013.69, 2013.844, 2013.923, 2013.997, 2014.077, 2014.156, 2014.23, 2014.307, 2014.389, 2014.46, 2014.468, 2014.54, 2014.622, 2014.701, 2014.773, 2014.852, 2014.855, 2014.934, 2015.085), wl = c(4716.69614519141, 4717.18695721942, 4716.95137413031, 4716.95215915847, 4716.95617293713, 4716.73451112085, 4716.91538177926, 4717.00588936267, 4716.78311524661, 4716.88238213472, 4716.98192878285, 4716.97499735093, 4716.96400457306, 4717.15611670712, 4716.99386029174, 4717.05634753127, 4716.96808398258, 4717.3385179692, 4716.69473283737, 4717.0563764012, 4716.97307380063, 4717.54419855758, 4716.6528308359, 4716.79914374548, 4716.87207534116, 4716.70372924768, 4716.88957602414, 4716.77689686401, 4717.089005203, 4716.79885280683, 4717.32157811021, 4716.4542772104, 4716.57303829829, 4716.69165719355, 4716.75878030774, 4716.51425619761, 4716.69628661921, 4716.76718193149, 4716.83711216341, 4716.56437245363, 4716.80095589741, 4716.92953229352, 4716.54242002516, 4719.15933244319, 4716.60029813372, 4716.77020818021, 4716.46140477099, 4716.89015101807, 4717.00917071744, 4716.45796269575, 4716.71523494857, 4716.42773085329, 4716.16425299646, 4716.56107921007, 4716.89280970058, 4716.72261405892, 4716.88387012439 ), wlsd = c(0.216549886343437, 0.0482189681060723, 0.0588960842643573, 0.175719434105253, 0.0512158233301561, 0.0392292465112816, 0.0595950831354654, 0.0607877904822251, 0.0370930552408838, 0.617268490833093, 0.0383914957042668, 0.605527813866314, 0.0543574451035527, 0.0545768826476366, 0.0507742835767385, 0.0583394912905697, 0.0563566145080252, 0.0912149956407483, 0.0448705108316624, 0.069484057343461, 0.0458673635595506, 0.0758663652549518, 0.0379866112968593, 0.706702525314332, 0.0424187676989381, 0.0371769559424733, 0.0593394645898105, 0.0502308178338169, 0.0539188048527388, 0.0557205808317756, 0.0960199790307439, 0.0377344405056613, 0.623137480604024, 0.0450269480801559, 0.0638249721374399, 0.0375489717974975, 0.0376544472258395, 0.622074959650495, 0.186283259878619, 0.0492906734226584, 0.0523743622696856, 0.0486222624919726, 0.115848182732971, 0.115018243869508, 0.0427547194026263, 0.0702039197853462, 0.0414918973327205, 0.0520070741917287, 0.0585758170986699, 0.0377079876736141, 0.0392247467180624, 0.616261504979872, 0.263302559470029, 0.0486800241034257, 0.0514939409350517, 0.0509628426691605, 0.0480276613429565)), .Names = c("time", "wl", "wlsd"), class = "data.frame", row.names = c(NA, -57L)) The original data are quite long to post. Just similar to my.data, but contains more rows.