Statistical Inference from Financial Data with Mathematica

Jan Hurt

Charles University of Prague, Faculty of Mathematics and Physics, Czech Republic

Abstract

In the contribution financial data (mainly profits/losses, P&L) are analyzed using both new built-in statistical functions and own procedures.

Selected parametric P&L distributions that seem to be suitable for modelling but are not easily analytically tractable are investigated. It is shown that in many cases the mixture of three symmetric distributions is sufficiently flexible to fit the data successfully. For the estimation purposes the built-in EstimatedDistribution function is used. The statistical tests include tests of independence and tests for symmetry, among others.

Data

Financial Data Source

This is the procedure how to get data from the Financial Data Source. To realize real calculation it is recommended to skip this part and go directly to the next Subsection Hard copy of the data.

We tried to use data of some five companies (including two indices, DJI and S&P500) but in October data for  “^DJI” were not available from Financial Data Source. So we restrict ourselves to Apple, WalMart, General Electric, and S&P500.

returnsApple= FinancialData["AAPL","Return",{{2010,1,1},{2012,10,8}},"Value"];
returnsWalMart=FinancialData["WMT","Return",{{2010,1,1},{2012,10,8}},"Value"];
returnsGE=FinancialData["GE","Return",{{2010,1,1},{2012,10,8}},"Value"];
(* returnsDJI=FinancialData["^DJI","Return",{{2010,1,1},{2012,10,8}},"Value"]; *)
returnsSP500=FinancialData["SP500","Return",{{2010,1,1},{2012,10,8}},"Value"];

returnsAppleread=returnsApple
returnsWalMartread=returnsWalMart
returnsGEread=returnsGE
(* returnsDJIread=returnsDJI *)
returnsSP500read=returnsSP500

For an illustration we also need Apple prices

pricesApple= FinancialData["AAPL","Price",{{2010,1,1},{2012,10,8}},"Value"];

pricesAppleread=pricesApple

Hard copy of the data (needs to be activated before further calculation)

Apple

returnsAppleread={0.0016893477240731425`,-0.015881195540148108`,-0.0018565240158041618`,0.006629149179702365`,-0.008812242384043212`,-0.011376129248123812`,0.014117874582990853`,-0.005816448152562659`,-0.016688246295497033`,0.044233113874664554`,-0.015411918550345738`,-0.0172659140499003`,-0.04961868906265077`,0.026917216861350957`,0.014144411473788532`,0.009411879449917171`,-0.04130634330160876`,-0.03628300745817381`,0.013909224011712906`,0.005776173285198638`,0.017229002153625217`,-0.03604193971166458`,0.017727344035977755`,-0.0068338300277465125`,0.01065756117750527`,-0.005426158177629925`,0.018168716866539647`,0.008593671014053283`,0.015086206896551824`,-0.004196909099886459`,0.001884172947242968`,-0.006186281302583363`,-0.00622478960211148`,-0.016736821006213654`,0.018244827234736638`,0.006706706706706589`,0.012976036591428874`,0.021349693251533797`,-0.0006727534839018334`,0.002308136180034559`,0.006572634810976696`,0.039082979838901855`,0.0005963029218842841`,0.018015953057669343`,0.008150583149457269`,0.002948007861354185`,0.004854368932038833`,-0.012188095554669154`,0.0027368987796123623`,-0.0014765761331604343`,0.0023749775945509644`,-0.010684429344181567`,0.011251694532308898`,0.016041824925153048`,0.004441903421584792`,-0.011865668374271943`,0.0187433534207726`,0.006480796833543634`,0.014866032843560806`,-0.0035769034236075026`,0.004102564102564266`,0.010682669390534416`,0.004421611150882354`,0.004402146570518184`,-0.002713194473431657`,0.007701322618449691`,0.002035221797640707`,0.0005803108808288826`,0.013463689465180728`,0.01316219751471559`,-0.00613249414992334`,-0.0013396119184866384`,-0.010040242266574406`,0.059825901289316086`,0.02797256983456653`,0.01635698940941488`,-0.004894871509622867`,-0.027687721259549103`,-0.001686340640809414`,0.026911855036855004`,-0.02811320049347632`,0.020156171865984396`,-0.028807360205120425`,-0.010366114066079124`,-0.03805413887799147`,-0.042210440456769915`,0.07685756866084748`,0.009964412811387824`,0.021728917077754595`,-0.014216193432195379`,-0.017608644950633523`,0.0015827167332727043`,-0.007308497609923692`,-0.015918497293855416`,-0.042623746360401116`,0.01917715637408124`,0.018360411140583732`,-0.006267551178218422`,-0.004505057951427194`,0.037849179248776066`,0.013913663931502063`,0.01536476659629371`,0.01197489507527627`,-0.003120006087816707`,-0.02721374045801528`,-0.019617844391258243`,-0.006443350542281956`,-0.02457101425924435`,0.03006276841757516`,0.011986850545221417`,0.003010735649487062`,0.02128836051976779`,0.029120581638177878`,0.01728608470181503`,0.008089837833844316`,-0.014254305606449247`,0.013642615516151757`,-0.010525157694000309`,-0.0072643712241947656`,-0.008549561321635313`,0.0059873474920921765`,-0.04521804229833426`,-0.018112674951974106`,-0.012098223198243274`,-0.006224234095869363`,0.006873271514559853`,0.04035222361352342`,-0.0022130765646839468`,0.005914627028289043`,-0.008974507755986183`,-0.02135134080174872`,0.003709317166560311`,-0.005046691833896277`,-0.006190590302739829`,-0.01728087449262561`,0.025681920418762605`,0.009329771540209642`,0.01880308117716778`,0.0035671358225735084`,-0.0025499362515936097`,0.01851493202153609`,-0.011827343601445217`,-0.010891317733990102`,-0.0033461733006497907`,0.017880148350575942`,0.00030683082115601223`,0.004025919251562371`,-0.004888108149392889`,-0.006140148898610698`,0.0063711483512238765`,-0.008939876453209483`,-0.0355400696864111`,0.006382466281310117`,-0.010649754696661518`,-0.005886147395581354`,0.01747911428339677`,0.004384391566025103`,-0.012619548394777524`,-0.000964591455327346`,-0.01536790441324376`,-0.023901940755873263`,0.012348262871494153`,-0.01075046516435807`,0.005600835945663629`,0.003616110395278316`,0.0024848836246169625`,0.029744691398826628`,0.007341731525315032`,0.02616591660360834`,-0.003687029418613874`,0.019827821276927393`,0.0005729564553091926`,0.0012597824012214875`,0.013802043617508142`,0.003798420458819285`,0.008055149675920692`,0.023526350999776957`,-0.004357456697773987`,0.028556840147343054`,0.0019147578185945147`,0.014014722536806357`,0.004048582995951566`,0.011783926585094529`,-0.003950939636513495`,-0.0147971854304636`,0.001785526730385456`,-0.012581253931641778`,-0.0043533658950946075`,-0.01372151718744452`,0.03694359344025955`,0.0008689607229752649`,0.00010418475429774254`,0.0167719980554204`,0.004405587240873032`,0.010744644678680526`,0.0053824934400863444`,0.007227464364585323`,0.04109361504218989`,0.01037046491591953`,-0.02674962102071743`,0.0033423110620760532`,-0.0032341526520052177`,-0.006619078520441191`,0.004442121766396578`,-0.00256893860561902`,-0.0007172431780393396`,-0.008384718279990877`,-0.013983022965058822`,0.010644332476892782`,0.017036450079239485`,0.011102454226723735`,0.017498234123161982`,-0.0035972358082737577`,0.004718624315166009`,-0.007974531929647477`,0.006164013598957796`,-0.004326270249786823`,-0.027243894703457117`,-0.0031952006781649223`,-0.01776076930625059`,-0.0035964035964034524`,0.026368558251453678`,-0.005502914265246961`,0.021609586798506886`,-0.01477469392987607`,0.01964802706483182`,0.0006380602966979954`,0.005962059620596261`,-0.018065415821500896`,0.016880769479052482`,0.005522932867798813`,-0.0022412323621326946`,0.008542141230068356`,-0.0060543321412884765`,0.008805428436168272`,-0.003910649480665773`,0.0025126417286975844`,0.003446223252608238`,-0.004277373630147796`,0.00021949078138705502`,0.0027900561146116942`,-0.00200075028135549`,0.0049805788748276125`,0.006171492690833169`,0.002973885567361556`,-0.004787349044074407`,0.00332071255663835`,0.0024436264654024153`,-0.0005554184152061215`,-0.005001543686322885`,-0.0034131810847708444`,0.021732361915436815`,0.005210872745002426`,0.008185042592536496`,-0.000811859157470507`,0.007162202828769226`,0.01885383052468037`,-0.0023754362298014087`,0.008142747956964014`,0.0036448461874909466`,0.00810575246949452`,-0.0224790339779245`,-0.0053067602228838995`,-0.01816888467352329`,-0.01793153414236548`,0.03285995327677371`,0.011696080473795334`,0.007177737247749505`,-0.0018692680647234283`,-0.02071750453561172`,0.00959182453833729`,0.016811199573800728`,-0.002037549119487614`,-0.0025667201400029205`,0.008918911015586062`,0.01553533128514295`,0.0094183457959931`,0.008340873105632252`,-0.010122535961640922`,0.006515211602742266`,0.006529325678261699`,0.0020131976289006204`,0.008985377832347208`,-0.013302726920736752`,-0.021610561426128827`,-0.03409156019022508`,0.011863803535413497`,0.0007327939969514752`,0.015406695761694289`,0.014509475870424282`,-0.01103212965595679`,0.008021390374331583`,0.021134593993325845`,0.0012289816211386029`,-0.012888467332477949`,0.001130454442686002`,-0.0092592592592593`,-0.016440620013676743`,0.015353863089892617`,0.004450911580929473`,-0.023008095440988585`,-0.044628579735426555`,0.014029214850882488`,-0.011854386122865379`,0.02608880519953849`,0.005594198608850132`,-0.0058868546535586486`,0.01705453899449272`,0.019039301310043832`,-0.0031424980002286995`,0.0014902275462829184`,-0.006638814170434326`,-0.00034568185746386426`,-0.011324995677482685`,-0.00979334868401871`,-0.006740646984369936`,-0.002518966334755901`,0.00011883894352182622`,-0.008911861687906586`,-0.012708689266552775`,0.004827104647985747`,0.011209136503716133`,-0.011025127730138307`,-0.014924471299093689`,0.013402441268478116`,0.01812789395635983`,0.013465311218120224`,0.02419709634843814`,0.0065864833906070785`,-0.007339971550497815`,-0.0007738163475868864`,-0.009694536067689552`,0.009731514466938984`,-0.01098585893353976`,0.005539443155452295`,0.003951429148279617`,-0.008072856814525409`,-0.0002606655660786217`,0.0026942464800974175`,0.005345121493166793`,-0.006351304747671982`,-0.0019088937093276748`,-0.017531658407951345`,-0.021118452100047258`,0.008497047125467061`,0.011114430833582434`,0.001920690266532743`,-0.015572005780517206`,-0.0024566344108570837`,-0.00660720185001662`,0.013816246938960441`,-0.0052782250849883194`,0.007194891626945088`,0.03086585111765916`,-0.0066697464918866745`,0.00171496671801874`,-0.007689629156752309`,-0.015732374184870057`,-0.017736712320627346`,0.0006049240820278357`,-0.002267093887914906`,-0.016844911685400143`,0.0021262827031525156`,0.017896678966789592`,-0.017128874388254278`,-0.0048563085907485926`,-0.015072427958118473`,-0.015428517670669994`,0.03165907570787008`,-0.008273903244728542`,0.026709834075273164`,-0.014735756950971735`,0.01744883828281263`,0.009709031516544675`,-0.003654554713476754`,0.0048705691350230396`,0.02261915447446361`,0.017993504783639036`,0.006667816290164996`,0.015445668931650891`,0.007028987544634102`,-0.015858391266716843`,-0.0007092399784390802`,0.012065637065637125`,-0.0007012819433924733`,0.01998652593757022`,0.02432848965213541`,0.0081676518001077`,0.02667626052659622`,0.000986372485399123`,0.01553302388299671`,0.013227107910729785`,0.012323588709677313`,-0.02683661530035597`,-0.0019697628610165774`,-0.0034090326549442995`,0.016048969933900814`,-0.019744336159979725`,0.009399612653324674`,-0.03870654148225838`,-0.009953161592505921`,-0.054620719316165744`,0.05888541370486222`,-0.027577132730055687`,0.02750317556746018`,0.008814834721848852`,0.017022750279716448`,-0.007648584226104593`,-0.0001055826844398311`,-0.03780259232860805`,-0.02738072375099454`,0.0011565259090011715`,0.048123520793418084`,0.00690860215053779`,-0.006540833489067421`,0.02638933677308386`,0.01665183013038707`,0.00005150656708718948`,-0.013236505974454027`,-0.009864815491414047`,-0.018318397469688996`,0.015223519935561924`,0.011028245001586834`,0.0005493211959506361`,-0.017333333333333423`,0.006518211083619274`,0.012317614717699321`,0.012167737218653496`,0.009390155814673395`,0.01919341647924777`,0.027784046741392787`,0.004416034352355602`,-0.0031577924601632335`,-0.02504995370144747`,0.006173456635841124`,-0.002782124847852563`,-0.009714783908332247`,-0.005634511382216156`,-0.01621512230907396`,-0.02368218050912818`,-0.017619637072348482`,-0.00560321715817691`,0.01542153082958131`,-0.0023099593765764093`,-0.02006599957419619`,0.05140948346097418`,0.02952344052692757`,0.00474183350895685`,0.015506779534047332`,0.033244811645519734`,-0.004783436458829171`,0.005356416939668707`,-0.05591894013272125`,-0.008314017938123586`,-0.00617346679538644`,0.03284848794703343`,-0.01972576972576978`,0.007119953543565538`,0.010203314196896462`,0.0006452253325393009`,-0.00042160607112740056`,-0.02044411363354426`,0.002279577518299769`,0.014252861944353157`,-0.007026286283792427`,-0.0012797029081875744`,0.016255464549520315`,-0.026947514153625507`,-0.025457963871033273`,-0.0015381807753472865`,-0.013943286855710668`,0.025235674187056523`,-0.010434692770617593`,-0.019131887348941667`,-0.006546035125066685`,-0.015830074462955923`,0.02033040306997247`,-0.025286743131501588`,-0.009304362103880526`,0.03450085630628141`,-0.007770152999919899`,0.024138858988159262`,0.014977533699450651`,0.004556398374194304`,0.008504497074968365`,-0.005238545473130185`,-0.004752363337443333`,0.0040265338254652505`,0.007583742512660807`,-0.0045415114558349234`,-0.0077147836784909884`,-0.02218778251323772`,-0.003275570583262888`,0.005486059578077018`,0.003136614038324659`,0.035945136370802544`,0.0012681986506366538`,0.005294356064444283`,0.011994456343706661`,0.007918129528647233`,-0.009560512858519221`,0.006160830090791158`,-0.00029747886660558276`,0.015374314975078907`,0.005372798984052629`,0.011101124687249442`,0.010450701518354588`,-0.0015692241850732147`,0.0035720239087466688`,-0.00163728258548268`,-0.0027332794599992383`,-0.003741747896756298`,0.011626237979044163`,0.010404842981460494`,-0.003182924545965138`,-0.017421111945905454`,0.016917562724014346`,-0.01637764932562602`,0.06244475765031887`,-0.004541877459246724`,0.005963002281299978`,0.012798347441453028`,0.0076706497882812474`,-0.0006380216927374116`,-0.00235558295174354`,0.010018315422468227`,0.009350899040877492`,0.01047641723846815`,0.016729858835121902`,0.03459464014832281`,0.0005091027573005391`,0.018603325802446502`,0.013647717054650732`,-0.02314303737580825`,0.009121362553981438`,-0.00017997840259165176`,0.025361521691301236`,-0.003511167463181475`,0.006518547518841178`,0.01166906530786882`,0.006401630204929232`,0.01835686042291451`,0.01313025210084029`,0.0037399096497074957`,0.0013096248201571736`,-0.02205029013539661`,-0.0054437914406267884`,0.0008144093638136063`,0.02128988304757584`,0.005873960012600543`,0.012526711369832633`,0.029164544065206188`,0.037813566213516614`,-0.006813613599972679`,0.000017150893561579394`,0.026514826693192717`,0.008086478539087505`,-0.005717884548453012`,-0.00523403120416055`,-0.0054961627400381685`,0.018348778433024293`,0.0123430235444002`,0.005115632916564472`,-0.012569514455754716`,-0.016895841910251064`,0.03182632874922531`,0.017273007678695995`,-0.007963231891227607`,0.015008686699697682`,0.004025547965830212`,-0.012249214692743648`,-0.003563723531761931`,-0.005468950474724066`,-0.028172421022076732`,-0.04146754281162879`,0.05096511728555364`,-0.0022237230064735547`,-0.03435467362234634`,-0.024618330398509247`,-0.002226000385606275`,-0.01999086533394223`,0.08874668387466822`,-0.0037702300004938127`,-0.007734258800198401`,-0.031544585456846796`,-0.0031643392722019437`,0.006607549513491184`,-0.007095480487428696`,-0.0284811765315105`,0.007497823499102552`,-0.0022925667930516758`,0.0017675651789659241`,0.0023467137185708697`,-0.006671595549922582`,-0.014992291197788221`,-0.00903153842002069`,-0.01281748697372942`,-0.029241379310344873`,0.0004925641754287557`,0.0582643767396942`,-0.007676066418551342`,0.024396400944842078`,-0.00918819967612483`,-0.005347308580564869`,0.01773562664094741`,0.012056438875434505`,-0.0024796684527216284`,-0.028978201161213968`,0.005889829749905928`,-0.002598419591371859`,0.015345633631919098`,0.0004569259428490735`,0.015036537380550996`,-0.015765609857399943`,0.008738768835827138`,-0.006954854453547155`,-0.0010882729809902347`,0.004551125481030871`,0.020291071928351556`,0.0027773967905637686`,-0.0028380919815351735`,-0.013785062752897592`,0.007666898470097383`,-0.019461361950276923`,0.0021994263895976918`,0.004318971874012423`,-0.009474861897769249`,0.026260986198863412`,0.014600171969045617`,0.011627315717215536`,0.0175588506324873`,-0.006652067245155213`,0.01322746937625352`,-0.009259410735027007`,-0.006208616106074816`,-0.009155105092630955`,0.010128450212965712`,0.003220558451475952`,0.00004964257347106482`,-0.0011251758087201802`,0.013285404277171509`,-0.016299105756183763`,-0.0007810941966364116`,-0.004823284823284757`,-0.043185426589788634`,-0.00015720249427964017`,0.017888962649802664`,0.0168709024130711`,0.02643082583672296`,-0.006462221491408293`,0.001605375525470798`,0.013020704241643033`,0.01112434142920038`,-0.0026294987820419946`,-0.0016983146249149872`,0.009996597592391465`,0.0015626762038245534`,0.013350490590316788`,0.0026825396825398418`,-0.0013614272823695428`,0.008734524356799778`,0.018496401294905374`,0.026291833176466994`,-0.01366609035555899`,0.019525653141481136`,-0.009329167102725466`,0.0008903913194393542`,0.018787129459304497`,-0.0013023916646933698`,-0.001970954356846355`,-0.014254532495879602`,0.0020636570412881916`,0.01462630028260481`,-0.007022534334859443`,0.009011831759246913`,0.006166176231386933`,-0.02601258009523255`,-0.00324410779491191`,0.013926944095429716`,0.01969273951537054`,0.01215262525989047`,0.012296030552019444`,0.0030438137700419254`,0.000270689974498195`,-0.004842615012106477`,0.0019894089022469696`,-0.013284006342041743`,-0.024971409545592738`,-0.012412031950589486`,0.024264108962987585`,-0.020871249926613045`,-0.011557487633038543`,0.0029117821016393375`,0.015333202280322533`,-0.0069253108943333475`,-0.02131073785242943`,-0.022096569055609305`};

pricesAppleread={212.13`,212.49`,209.11`,208.73`,210.11`,208.26`,205.89`,208.8`,207.59`,204.12`,213.15`,209.87`,206.24`,196.01`,201.28`,204.13`,206.05`,197.54`,190.37`,193.02`,194.14`,197.48`,190.36`,193.74`,192.41`,194.46`,193.4`,196.92`,198.62`,201.61`,200.77`,201.14`,199.89`,198.66`,195.33`,198.89`,200.22`,202.82`,207.15`,207.01`,207.49`,208.86`,217.02`,217.15`,221.06`,222.86`,223.52`,224.61`,221.87`,222.47`,222.15`,222.67`,220.29`,222.77`,226.35`,227.35`,224.65`,228.87`,230.34`,233.77`,232.93`,233.89`,236.39`,237.43`,238.48`,237.84`,239.66`,240.16`,240.3`,243.53`,246.73`,245.22`,244.9`,242.44`,256.94`,264.12`,268.45`,267.13`,259.73`,259.3`,266.28`,258.79`,264.01`,256.4`,253.74`,244.08`,233.78`,251.75`,254.26`,259.78`,256.09`,251.59`,251.98`,250.14`,246.15`,235.67`,240.19`,244.59`,243.06`,241.96`,251.12`,254.62`,258.53`,261.63`,260.8`,253.71`,248.73`,247.14`,241.06`,248.3`,251.28`,252.04`,257.4`,264.9`,269.48`,271.66`,267.79`,271.44`,268.58`,266.63`,264.35`,265.94`,253.92`,249.32`,246.29`,244.77`,246.44`,256.39`,255.82`,257.33`,255.03`,249.58`,250.51`,249.24`,247.7`,243.42`,249.67`,252.`,256.74`,257.65`,257.`,261.76`,258.66`,255.84`,254.99`,259.55`,259.62`,260.67`,259.4`,257.8`,259.45`,257.13`,247.99`,249.57`,246.91`,245.46`,249.75`,250.84`,247.68`,247.44`,243.64`,237.82`,240.75`,238.16`,239.49`,240.37`,240.96`,248.13`,249.95`,256.49`,255.54`,260.61`,260.75`,261.09`,264.69`,265.7`,267.84`,274.14`,272.95`,280.74`,281.27`,285.22`,286.38`,289.75`,288.6`,284.33`,284.84`,281.25`,280.03`,276.19`,286.4`,286.64`,286.67`,291.48`,292.76`,295.91`,297.5`,299.65`,311.97`,315.2`,306.77`,307.8`,306.8`,304.76`,306.12`,305.34`,305.12`,302.55`,298.33`,301.5`,306.64`,310.05`,315.47`,314.34`,315.82`,313.3`,315.23`,313.86`,305.32`,304.34`,298.94`,297.85`,305.72`,304.03`,310.6`,306.01`,312.03`,312.23`,314.08`,308.41`,313.61`,315.35`,314.65`,317.33`,315.41`,318.18`,316.95`,317.74`,318.84`,317.47`,317.54`,318.42`,317.79`,319.37`,321.35`,322.3`,320.75`,321.82`,322.61`,322.43`,320.81`,319.72`,326.67`,328.37`,331.06`,330.79`,333.16`,339.44`,338.63`,341.39`,342.64`,345.41`,337.65`,335.86`,329.75`,323.84`,334.48`,338.39`,340.82`,340.19`,333.14`,336.33`,341.99`,341.29`,340.42`,343.45`,348.78`,352.07`,355.01`,351.42`,353.71`,356.02`,356.73`,359.93`,355.15`,347.47`,335.63`,339.6`,339.86`,345.1`,350.1`,346.24`,349.02`,356.4`,356.83`,352.23`,352.63`,349.37`,343.62`,348.89`,350.45`,342.39`,327.11`,331.69`,327.76`,336.31`,338.2`,336.2`,341.93`,348.45`,347.36`,347.87`,345.56`,345.44`,341.53`,338.19`,335.91`,335.06`,335.1`,332.11`,327.89`,329.47`,333.17`,329.49`,324.58`,328.93`,334.89`,339.4`,347.61`,349.9`,347.34`,347.07`,343.7`,347.05`,343.23`,345.14`,346.49`,343.7`,343.61`,344.54`,346.37`,344.17`,343.52`,337.5`,330.37`,333.18`,336.88`,337.53`,332.27`,331.46`,329.27`,333.82`,332.05`,334.44`,344.77`,342.47`,343.05`,340.42`,335.06`,329.12`,329.32`,328.57`,323.03`,323.73`,329.51`,323.87`,322.3`,317.44`,312.54`,322.44`,319.77`,328.31`,323.48`,329.12`,332.31`,331.1`,332.72`,340.24`,346.35`,348.66`,354.06`,356.54`,350.88`,350.64`,354.87`,354.62`,361.71`,370.51`,373.53`,383.49`,383.88`,389.84`,394.99`,399.86`,389.13`,388.37`,387.04`,393.26`,385.49`,389.11`,374.05`,370.33`,350.1`,370.72`,360.49`,370.41`,373.67`,380.04`,377.13`,377.09`,362.83`,352.9`,353.3`,370.31`,372.87`,370.43`,380.2`,386.54`,386.56`,381.44`,377.68`,370.76`,376.4`,380.55`,380.76`,374.16`,376.6`,381.23`,385.87`,389.5`,396.97`,408.01`,409.81`,408.51`,398.28`,400.74`,399.62`,395.75`,393.52`,387.13`,377.96`,371.3`,369.22`,374.92`,374.05`,366.54`,385.39`,396.77`,398.65`,404.83`,418.29`,416.29`,418.52`,395.11`,391.83`,389.41`,402.2`,394.27`,397.07`,401.13`,401.39`,401.22`,393.02`,393.91`,399.52`,396.72`,396.21`,402.65`,391.8`,381.83`,381.23`,375.92`,385.41`,381.38`,374.09`,371.64`,365.76`,373.2`,363.76`,360.37`,372.81`,369.91`,378.84`,384.52`,386.27`,389.55`,387.51`,385.67`,387.22`,390.16`,388.39`,385.39`,376.84`,375.6`,377.67`,378.85`,392.46`,392.96`,395.04`,399.78`,402.95`,399.1`,401.55`,401.44`,407.61`,409.8`,414.35`,418.68`,418.02`,419.51`,418.83`,417.68`,416.11`,420.96`,425.33`,423.98`,416.6`,423.65`,416.71`,442.73`,440.72`,443.34`,449.02`,452.46`,452.17`,451.11`,455.63`,459.89`,464.7`,472.48`,488.83`,489.08`,498.18`,504.98`,493.29`,497.79`,497.7`,510.32`,508.52`,511.84`,517.81`,521.13`,530.7`,537.67`,539.68`,540.38`,528.47`,525.59`,526.02`,537.22`,540.37`,547.14`,563.1`,584.39`,580.41`,580.42`,595.81`,600.63`,597.2`,594.06`,590.8`,601.64`,609.07`,612.18`,604.49`,594.27`,613.18`,623.78`,618.81`,628.1`,630.63`,622.91`,620.69`,617.29`,599.9`,575.02`,604.33`,602.99`,582.27`,567.94`,566.67`,555.35`,604.63`,602.35`,597.69`,578.84`,577.01`,580.82`,576.7`,560.27`,564.47`,563.18`,564.17`,565.5`,561.72`,553.31`,548.3`,541.27`,525.45`,525.71`,556.34`,552.07`,565.54`,560.34`,557.34`,567.23`,574.07`,572.64`,556.05`,559.32`,557.88`,566.43`,566.69`,575.21`,566.14`,571.09`,567.12`,566.5`,569.08`,580.62`,582.24`,580.58`,572.59`,576.98`,565.75`,566.99`,569.44`,564.04`,578.86`,587.3`,594.13`,604.57`,600.55`,608.49`,602.86`,599.11`,593.63`,599.64`,601.57`,601.6`,600.92`,608.91`,598.98`,598.51`,595.63`,569.91`,569.82`,580.01`,589.79`,605.38`,601.47`,602.44`,610.28`,617.07`,615.44`,614.4`,617.91`,618.87`,627.14`,628.82`,627.96`,633.45`,645.16`,662.13`,653.08`,665.83`,659.62`,660.2`,672.61`,671.73`,670.41`,660.85`,662.22`,671.9`,667.18`,673.2`,677.35`,659.73`,657.59`,666.74`,679.87`,688.14`,696.6`,698.72`,698.91`,695.52`,696.91`,687.65`,670.48`,662.16`,678.22`,664.07`,656.39`,658.3`,668.4`,663.77`,649.62`,635.27`};

WalMart

returnsWalMartread={-0.0098755678451512`,-0.0021942948334330303`,0.0005997600959615212`,-0.0051948051948051965`,0.01667001405904789`,0.00948241801659444`,0.0050880626223090974`,-0.014408099688473675`,-0.009877518767285598`,0.006584197924980106`,-0.0031714568880080174`,-0.017498508649831046`,0.0004047763610606214`,-0.0012138377503541076`,0.013976098845452922`,-0.003995205753096309`,-0.014841556357801822`,0.015675895765472347`,0.0008017638805373206`,0.00020028039254937902`,0.014617541049259275`,-0.023880007894217514`,0.00909826122118873`,-0.009817671809256634`,0.006070416835289416`,-0.0002011263073209424`,-0.0030175015087507973`,-0.0034301856335755554`,0.012553148410609394`,0.009398120375924801`,-0.010895404120443652`,0.00020028039254937902`,0.006407689227072577`,-0.0037803422204536474`,0.005592170960655007`,0.004170804369414194`,-0.001384493670886111`,-0.0031689443454150368`,-0.005761970991456367`,0.0011990407673863057`,0.005588822355289569`,0.003374354902738963`,0.0001978239366964285`,-0.0015822784810127777`,0.0036251980982568988`,0.006354249404289192`,-0.0013812154696132284`,0.028255285516696205`,0.010184473481936962`,-0.0011413353623740408`,0.0003808798324129725`,-0.010850942318675116`,0.0051963048498844255`,0.004786521156423529`,-0.005525914634146423`,0.0005748227629813751`,-0.0019149751053236796`,0.004221028396009352`,0.003056935422239171`,-0.005523809523809375`,-0.0021068760773796935`,0.`,0.0007677543186179747`,-0.004411200613732236`,0.001733769986515199`,-0.005576923076923035`,-0.0009669309611295418`,-0.005420054200541813`,-0.0013623978201635634`,-0.009354901578639718`,-0.00039346842415899363`,0.005117102932493678`,0.0023497160759740066`,-0.0007814026176987676`,0.0001955034213096951`,0.0007818608287726292`,-0.008984374999999933`,0.`,-0.00788332676389436`,0.001589193484306639`,-0.0009916699722334332`,0.0017867778439548676`,0.005152596115735264`,0.013998422712933722`,-0.028193661287186478`,-0.015606242496998712`,0.0034552845528454945`,-0.002228073728985147`,0.01224116930572472`,-0.0014124293785310327`,-0.005455647605577041`,0.011783827712312123`,0.01867469879518069`,-0.012615809185885896`,-0.032741066081054204`,0.0014447884416926016`,-0.007213520197856482`,-0.014116670126634867`,-0.00526426616129716`,0.013547840812870415`,-0.0027151211361737815`,0.00712041884816772`,0.01580370139322107`,-1.1102230246251565`*^-16,-0.025588536335721668`,0.006722689075630228`,0.0008347245409014992`,0.004170141784820558`,0.0043604651162789665`,-0.007029150299772469`,0.007495315427857641`,0.007852862161603635`,-0.012712733237646212`,0.008307372793354029`,0.0028836251287331915`,-0.010474430067775709`,-0.006641760066417701`,0.002716255745925711`,-0.015419879141487791`,-0.024550264550264544`,0.015838576697765117`,-0.01366937206322083`,-0.016890428757037723`,0.005506607929515406`,-0.007009857612267356`,0.011912640635340921`,0.007194244604316724`,0.005411255411255533`,0.0049515608180839`,0.013924592973436178`,0.00845129938728073`,-0.0037712130735385596`,0.0012618296529969264`,-0.014702793530770975`,-0.002984438286079527`,0.02736797092153065`,-0.010405827263267442`,0.010094637223974745`,0.016031646887362028`,-0.010450819672131018`,-0.003313315386208271`,0.0033243299397465176`,-0.001449575481466181`,0.0026959767731231654`,0.004136504653567741`,-0.0022657054582904124`,0.005986787778695213`,0.0004104247896572488`,0.0032820512820512793`,0.005315886321815677`,0.003050640634533197`,-0.011090835360908491`,-0.01155353827109551`,-0.0006261740763932044`,0.00020885547201321408`,0.012111087909793206`,-0.0033010109345986693`,-0.015731732560546607`,0.0033648790746583224`,0.0182351708237265`,0.00308769040757495`,0.004925097475887652`,-0.01123136614253617`,0.0006195786864930941`,-0.008875128998967918`,-0.008121615993336162`,0.02120512282175091`,0.010896381578947567`,0.005287777099857616`,-0.003439206959336527`,-0.0004060089321964444`,0.0014216084484159897`,0.0012167917258161243`,0.004658699615150974`,0.008467741935483941`,0.0037984806077568933`,0.0055765783708423555`,-0.002574767280649648`,0.00992851469420164`,0.0005898545025559976`,0.004716054234623623`,-0.0033248582045765085`,0.008045525902668826`,-0.011095970410745504`,0.006496062992126017`,-0.008801095247408575`,0.0031570639305447123`,-0.002950432730133845`,0.0039455513908068784`,0.008056592650815375`,0.010331384015594525`,-0.0036658306000384444`,0.0009682416731215948`,0.0036757593344942663`,-0.012721665381650094`,-0.0017571261226082546`,-0.010756894191277122`,0.0019770660340054924`,0.007695343330702542`,-0.008224006265909578`,0.0027640671273445605`,0.010632014176018778`,0.0003896356906294418`,-0.0019474196689387435`,0.011317073170731717`,-0.012733937873818157`,0.003908540160250107`,0.0017519953280125122`,0.0025262339681306756`,0.008916456677650508`,0.0021133525456291657`,0.008243865030674868`,-0.0028522532800913103`,-0.005339435545385185`,0.0024923312883435855`,-0.009753298909925379`,-0.0030899961375049356`,-0.0038744672607515795`,-0.0033061065733177575`,0.005658536585365859`,-0.008925106713232434`,0.003915426781519349`,0.007605304212168651`,-0.00019353590090964712`,-0.0131629887727448`,0.0064731267163593564`,-0.005067238355096593`,0.0019588638589618235`,0.0044965786901272065`,0.011288439081354573`,0.0009622786759044821`,-0.002307248606037371`,-0.002505299672383998`,0.011012364760432769`,0.00043951844066492107`,-0.0026897214217098675`,-0.0011558466576767623`,-0.0013500482160077043`,0.004441869447663116`,-0.004037685060565344`,0.007335907335907388`,-0.00402453047144502`,-0.011737540888974385`,-0.0021417445482866393`,-0.006439024390243908`,0.0054988216810683`,-0.0005859374999999112`,0.0031268321282000855`,0.006428988895382792`,-0.00019357336430503302`,-0.002710551790900406`,0.011842360706658894`,0.0038372985418266836`,-0.0066896024464833115`,-0.008274004233211452`,0.002328288707799775`,-0.006581494386372344`,0.010522213561964033`,0.010219822599305983`,-0.0011452567283832815`,0.0003821899484044433`,0.006112702960840544`,-0.0020884754129484318`,0.017503805175038023`,-0.004674644727000743`,0.00582378358068758`,0.021479267837130944`,0.0010970927043336687`,0.004383561643835687`,-0.015093653391525796`,-0.01107828655834553`,0.004667662434652664`,-0.008362757851700375`,0.0009370314842578331`,0.002059539412095246`,0.0007473841554557215`,0.005414488424197117`,0.006313834726090928`,-0.02011441225318311`,0.0016949152542371504`,-0.01598044745252869`,0.0028658769583491672`,-0.007239474185559258`,0.0036461331798118835`,0.011472275334607929`,-0.03081285444234394`,-0.012092841817827327`,-0.017571569595261627`,-0.006631832797427628`,0.004450738417964839`,0.0018126888217522286`,-0.002010454362685876`,0.0008058017727639033`,0.0012077294685990392`,-0.0010052271813429936`,0.00804990943851891`,0.01866640047913748`,-0.000394788787998257`,-0.000987361769352213`,-0.0051393556038744626`,-0.004967216371945193`,-0.01317891373801916`,-0.00020234722784295833`,0.0030358227079538835`,0.007667473769168653`,0.0016019223067682553`,-0.006997201119552265`,0.018522246829071998`,-0.0047440205574225125`,-0.002979145978152853`,0.0013944223107569265`,0.001790332206087042`,-0.005758538522636969`,0.0013980427401636408`,0.009972078181093025`,0.0017772511848341832`,0.004533806426177955`,0.0003924646781789942`,-0.008630835621812438`,0.005342303126236736`,0.013186380633733563`,0.002136752136752351`,-0.0025198681915100662`,0.0009716284492808924`,-0.004465152397592709`,0.0007800312012480326`,0.00623538581449723`,-0.0019364833462433007`,-0.0038804811796662175`,0.01012855473315133`,0.009448515233320576`,0.004966571155682997`,0.005132104162706819`,0.0011346444780633291`,0.007744616547034511`,-0.0016869728209935042`,-0.005444986856928291`,-0.0009439305267131548`,0.0015117157974300355`,0.0077358490566037386`,0.007021157086688046`,0.009921377761138217`,0.`,0.006116774791473434`,-0.009211495946941706`,-0.006507995537374467`,0.005427662361968899`,-0.0035368577810871438`,-0.0011208668036616354`,-0.008041892650084148`,-0.0039592760180996445`,0.0011357183418512218`,0.0013235016071091454`,0.009629909365558742`,-0.016644847578081157`,-0.01388360593381499`,0.002121504339440694`,0.0017321016166280678`,0.0013448607108550448`,-0.0024942440521871223`,-0.001346412771686789`,-0.01675654853620967`,-0.0019588638589617124`,0.005495583905789747`,-0.01112629318758529`,0.009672325305961404`,-0.00019550342130991716`,0.00430191630817367`,0.004672897196261738`,-0.005232558139534937`,0.005260081823495133`,-0.016472868217054293`,-0.002364532019704324`,0.004542761208769397`,0.0021627998427053985`,0.009417304296645224`,0.006997084548105104`,-0.0023161551823973614`,0.006190752563358437`,0.014420303787733069`,-0.007581501137225222`,-0.0038197097020628012`,0.0013420245398771957`,0.0013402259237984548`,-0.007074569789674912`,-1.1102230246251565`*^-16,-0.005777007510109788`,0.01220220801859373`,-0.001530807500956688`,0.01073208125718672`,0.0009480470231324478`,-0.010039780261413167`,-0.007079984691924834`,-0.006359606860666833`,-0.004848719937936452`,-0.005262132137984876`,-0.001763322884012375`,-0.017860647693817566`,-0.007793764988009544`,-0.02296072507552871`,0.015048443619872343`,-0.037977254264825455`,0.03884314967278879`,-0.03322495427758576`,0.02732471933912306`,0.0004123711340207059`,0.004534212695795681`,0.03898235535494465`,-0.0073064770932068646`,0.004774219216232112`,0.0098990298950703`,-0.0021564399137422585`,0.01944990176817285`,0.003083445750626135`,-0.012487992315081575`,0.003696498054474695`,0.005427408412483015`,-0.006940427993059606`,0.006988934187536211`,-0.010025062656641603`,-0.011879259980525858`,-0.006700827749310245`,0.014285714285714235`,-0.00391236306729259`,-0.016300078554595365`,0.00898382910760609`,-0.004550850811238516`,0.011926058437686349`,0.005892751915144379`,0.0027338410466706264`,-0.003894839337877487`,-0.0029325513196480912`,-0.0186274509803922`,-0.02017982017982023`,0.010195758564437218`,0.020387565603552593`,0.0037586547972305873`,-0.013795821836815159`,0.011990407673861059`,-0.0003949447077409296`,0.0009877518767287263`,0.01776198934280626`,-0.00426604615086279`,0.0017526777020446804`,0.018079315707620447`,0.020622493794157037`,-0.0014967259120673981`,0.008619074386359449`,-0.003158090284228199`,0.008013417815877721`,-0.012386762802736206`,0.02040434294271809`,0.006420840212804979`,0.0021873860736418838`,0.009639869043288618`,-0.0025220680958386588`,-0.0010836192884232654`,0.01157114445850671`,0.007685433422698784`,-0.011351543100390216`,-0.00753498385360607`,-0.008676789587852451`,0.011123267687819238`,0.009918845807033394`,0.0014285714285713347`,0.007667617689015804`,0.023712617235887468`,-0.02143474503025078`,0.001413177883766048`,0.018521785147292302`,-0.005368895046761302`,-0.024203378025422273`,-0.013561741613133393`,0.0009044862518088337`,0.00867522139887944`,-0.00985486471958441`,0.0032573289902280145`,-0.003607503607503504`,0.004344677769731797`,0.006308579668349079`,0.016120365394948877`,0.012515423937951686`,-0.004874651810584996`,-0.008922323303009017`,0.0044130626654899086`,0.007557117750439435`,0.007936507936507908`,-0.009056078021595249`,0.005799648506151112`,-0.0038441376900225643`,-0.008419575513067934`,0.000707588890854316`,0.0053031642213186014`,0.005451028661860313`,-0.008394543546694666`,0.024514991181657786`,0.0032707867102772514`,-0.0032601235415236074`,0.013427440179032413`,-0.0027178528962119586`,-0.0015329586101175963`,0.004264756055953667`,-0.003737047732291554`,0.009377664109122108`,-0.01013513513513531`,-0.004948805460750827`,-0.0070313839821644075`,0.0031088082901553626`,-0.002410468319559267`,0.006040731791508547`,0.001715560130382654`,0.0006850488097276397`,0.005134348793428112`,0.0027243316873830636`,0.01001867889285113`,0.006556825823806234`,-0.00167028561884075`,0.00786347666053211`,0.0013280212483399723`,-0.008123342175066273`,-0.004178505766338048`,0.009734810339040001`,0.0009973404255319007`,0.013284623048821054`,-0.003933136676499638`,0.0014807502467915068`,-0.002299983571545816`,-0.0031286020088917565`,-0.0011562603237528224`,0.005457251529684237`,-0.000822368421052655`,-0.0018106995884772381`,0.006926121372031746`,-0.007369800196527998`,0.004454710443821064`,0.007063074901445532`,-0.038492904909476544`,-0.02442748091603064`,-0.0010432968179446833`,0.004177545691905982`,-0.005546888542208417`,0.008018127941432862`,0.002593809441466366`,-0.004484304932735439`,0.00329175329175313`,0.00656190640649279`,-0.0072053525476067914`,0.015033696215655867`,0.012053115423901861`,0.00508044030482635`,0.010109519797809607`,0.005170975813177492`,0.001327580484566937`,0.0024859131587668948`,-0.0064473466688709236`,-0.0014975041597338201`,-0.00233294450924848`,-0.0006681142475363222`,0.0015042620758816128`,0.0016688918558076526`,0.0073308897034320974`,-0.0018193847171683597`,0.001657000828500399`,-0.005955334987593042`,0.006157430520885354`,0.0026463777704266445`,-0.01154734411085434`,-0.006508678237650223`,0.006887283722492699`,-0.009009009009008917`,-0.0031986531986532007`,-0.002195575071778477`,0.005585646580907211`,-0.006059585928294808`,0.013547840812870415`,0.021219715956557916`,0.003108638743455572`,-0.0050562714076007875`,0.011475409836065653`,-0.046677471636953016`,-0.02975178510710641`,-0.00700893639390221`,0.027704252691018283`,0.0013736263736263687`,-0.002057613168724215`,0.0027491408934705586`,-0.0010281014393421772`,-0.00034305317324179185`,-0.004975978037062401`,0.008277289187790915`,-0.0022233624080724157`,0.013164209804593652`,0.002725259751320097`,0.003906913538304746`,-0.005922165820642977`,0.004765957446808633`,-0.002710486193461037`,0.0421267198912858`,0.012061939690301449`,0.009824448381381856`,0.011004784688995128`,0.01325130146710829`,0.007628833878249974`,0.003708281829418958`,0.005695812807881895`,-0.0036736568192253793`,0.005838070364111214`,-0.00412402627157471`,0.006748466257668673`,-0.007464960390005992`,0.0066001534919415406`,-0.0009149130832571961`,0.03556166056166066`,-0.010022107590272444`,0.002828643739764658`,-0.009649643705463173`,0.008394543546694777`,0.0017838561022744948`,0.005342038878171973`,-0.0044280442804427445`,0.010378057820607856`,-0.011885546588407903`,-0.005940005940005988`,0.012996713474753507`,0.00589883498009125`,0.00014660606949123967`,-0.004250952799765395`,0.02075666126895337`,-0.00519180847995393`,0.020150768338648817`,0.004689498365780809`,0.003960396039603964`,0.005494505494505475`,0.004904021297463812`,0.0020914668153932947`,0.0006957005704744113`,0.012096774193548487`,-0.002747630168979276`,0.0016531202644991527`,-0.003438316600192559`,-0.0180789401048852`,0.009978917779339458`,-0.005566379070414795`,0.0040582143856704445`,-0.0008362369337979736`,0.02203933603012964`,0.011600928074245953`,0.006206152185644687`,-0.007374631268436516`,-0.01094151019856815`,0.005872712373668376`,0.006788866259334725`,-0.0036412677006070204`,-0.00392528424472105`,0.015192281559994525`,-0.006190283945633257`,-0.002301963439404031`,-0.003800217155266017`,0.008310626702997315`,0.005945142548304139`,-0.030893216924110067`,-0.0022176022176023658`,0.004306153632448906`,-0.012033195020746734`,0.004759904801903803`,-0.0029260136547303306`,0.007685858021240888`,0.005408403827485753`,-0.0012413793103448478`,0.00497168899323297`,-0.007145801841418109`,0.0048442906574392985`,0.012534435261708055`,0.0005441436539246336`,0.01713120326308637`,-0.013233524929822327`,-0.004199403955567393`,0.0074819752414636564`,0.00013502565487422125`,0.014445794518698651`,-0.008517434122970458`,-0.006845637583892672`,-0.0005406135964318715`,0.005679513184584151`,0.005109587199139343`,-0.004013377926421424`,0.0038952316991267555`,-0.00642226384800626`,-0.000942633988688435`,-0.0028305701577031606`,-0.0024330900243310083`,0.003387533875338855`,-0.004051316677920247`,0.006101694915254141`,0.007008086253369239`,0.0054871520342612`,0.0015972314654599806`};

GE

returnsGEread={0.005649717514124353`,-0.00561797752808979`,0.052259887005649874`,0.021476510067114152`,0.009198423127463773`,0.0006510416666667407`,0.0039037085230970714`,-0.00777705767984449`,-0.015676028739385894`,0.005972130059721303`,-0.0019788918205804196`,-0.029081295439524313`,0.00544588155207637`,0.016249153689911866`,-0.0013324450366422047`,-0.0033355570380253496`,-0.00870147255689424`,-0.004726536124240455`,0.01085481682496603`,0.03691275167785224`,-0.010355987055016058`,-0.038587311968606985`,-0.015646258503401178`,-0.011748445058742174`,-1.1102230246251565`*^-16,0.005594405594405494`,0.0055632823365785455`,-0.014522821576763656`,0.03157894736842093`,0.006802721088435604`,0.0060810810810809635`,-0.004701141705842793`,0.005398110661268607`,-0.018791946308724827`,0.0109439124487003`,0.0006765899864680236`,0.008168822328114445`,-0.00945307224848091`,0.`,0.008179959100204526`,0.0047329276538201626`,0.014804845222072816`,-0.004641909814323553`,0.013324450366422491`,0.0013149243918475495`,-0.001969796454366568`,0.03421052631578947`,0.014631043256997378`,0.045141065830721194`,-0.001799640071985631`,0.008413461538461453`,-0.006555423122765136`,0.`,0.014397120575884825`,0.006505026611472342`,-0.008225616921269108`,0.0023696682464455776`,0.002955082742316595`,-0.005303476723629852`,-0.005331753554502439`,0.007147111375819026`,0.010644589000591287`,0.0040959625511995945`,-0.005827505827505908`,0.003516998827667317`,-0.00233644859813098`,0.010538641686182793`,0.012746234067207318`,0.02116704805491998`,0.007843137254901711`,-0.027237354085603016`,-0.0017142857142857792`,0.0034344590726962387`,0.0011409013120364797`,-0.0039886039886039`,0.0062929061784895435`,0.011938601478112654`,-0.030898876404494402`,0.01333333333333342`,0.028604118993134975`,-0.032258064516129226`,0.021264367816091978`,-0.03545301069217777`,-0.025670945157526326`,-0.043712574850299335`,-0.02504696305572951`,0.06872190109184317`,-0.0024038461538461453`,0.024698795180722932`,-0.021164021164021385`,-0.022822822822822775`,-0.004302397049784967`,-0.01913580246913571`,0.0018879798615480947`,-0.057788944723618174`,0.010000000000000009`,-0.025082508250825253`,-0.004062288422478022`,0.004078857919782353`,0.040622884224779776`,-0.01886792452830177`,-0.022546419098143144`,0.023066485753052923`,0.005968169761273234`,-0.04482531311799609`,-0.019323671497584516`,0.004926108374384119`,-0.010504201680672232`,0.023354564755838636`,-0.007607192254495354`,-0.010452961672474004`,0.02605633802816909`,0.0034317089910775866`,0.017099863201094356`,0.0027081922816518667`,0.009453072248480465`,-0.019397993311036865`,-0.02523874488403821`,-0.020293911826452016`,-0.011428571428571455`,0.005780346820809301`,-0.034482758620689724`,-0.0037202380952380265`,-0.020911127707244348`,-0.01754385964912264`,0.006987577639751441`,0.04626060138781796`,0.014738393515106862`,0.007988380537400364`,-0.0014409221902017544`,0.018759018759018753`,-0.0007082152974504652`,0.003543586109142405`,-0.04590395480225984`,0.004441154700222105`,0.022107590272660183`,-0.006488824801730297`,0.02467343976777925`,0.03257790368271962`,0.027434842249657088`,0.0026702269692922`,-0.00798934753661773`,0.006040268456375841`,-0.002001334222815121`,0.018048128342245784`,-0.0006565988181221893`,0.005256241787122251`,0.002614379084967311`,-0.0045632333767926525`,-0.003929273084479212`,-0.008547008547008517`,-0.03381962864721477`,-0.012354152367879068`,-0.007644197359277238`,0.004901960784313708`,0.0076655052264809065`,0.007607192254495132`,-0.028140013726835944`,-0.014830508474576343`,-0.009318996415770497`,-0.02098408104196825`,0.`,-0.005173688100517215`,0.014858841010401136`,-0.013177159590043841`,-0.0029673590504452063`,0.03645833333333326`,0.00933237616654714`,0.016358463726884542`,0.002799160251924615`,0.016748080949057886`,0.013726835964310347`,0.004062288422477911`,0.016857720836142898`,-0.0053050397877982824`,0.011333333333333417`,0.008569545154910818`,0.0032938076416337836`,0.01641497045305318`,-0.0019379844961241455`,-0.0012944983818768963`,-0.022034996759559333`,0.03247183565275025`,-0.01412066752246477`,0.0006510416666667407`,-0.0045543266102795465`,-0.006535947712418277`,0.006578947368421018`,-0.015686274509803866`,0.025232403718459473`,0.023316062176165886`,0.008860759493670711`,0.004391468005018995`,-0.009369144284822162`,0.013871374527112179`,0.004975124378109541`,-0.0068069306930692575`,-0.05046728971962611`,-0.002624671916010568`,-0.011184210526315908`,-0.0013306719893545482`,0.0033311125916055673`,-0.0026560424966800555`,0.`,0.005992010652463353`,-0.002647253474520106`,-0.001990710019907249`,-0.003989361702127603`,-0.004005340453938633`,-0.0006702412868632157`,0.007377598926894713`,0.02796271637816239`,0.0136010362694301`,-0.0012779552715654896`,-0.0057581573896353655`,-0.0038610038610038533`,-0.012273901808785626`,-0.005886200130804542`,-0.003289473684210509`,-0.021122112211221178`,-0.003371544167228624`,0.014884979702300294`,0.011333333333333417`,-0.011865524060646115`,-0.016677785190126748`,0.011533242876526462`,-0.008718980549966449`,0.010148849797023018`,-0.008707300736771506`,0.029729729729729648`,0.023622047244094446`,0.005769230769230971`,-0.004461440407903083`,0.01984635083226638`,0.`,0.005649717514124353`,0.03433208489388262`,-0.005431502715751324`,0.00364077669902918`,-0.010882708585247869`,0.01589242053789741`,-0.004211793020457266`,0.`,0.011480362537764188`,0.02508960573476715`,-0.001175088131609825`,0.008235294117647118`,0.0075845974329054044`,-0.0028951939779965352`,-0.004645760743321681`,0.005834305717619559`,-0.000580046403712231`,0.017991874637260485`,0.0017103762827823665`,-0.004553215708594349`,-0.006861063464836947`,0.004605641911341163`,0.006303724928366838`,0.002277904328018332`,-0.003977272727272663`,0.011979463776383037`,-0.011837655016910809`,-0.01426126640045644`,0.005208333333333259`,0.07138744962579135`,0.015045674368619144`,-0.0031762837480149297`,-0.0026553372278278475`,0.0175718849840254`,-0.00366300366300365`,-0.0031512605042016695`,0.03266596417281353`,-0.0040816326530613845`,0.002049180327868827`,-0.00920245398773012`,0.014963880288957787`,0.0198271479410268`,0.0014955134596212893`,-0.0019910403185663395`,0.0024937655860348684`,0.007960199004975133`,-0.0014807502467918399`,-0.000988630746416197`,0.003463631865413319`,-0.0034516765285996787`,-0.029193468579910897`,-0.021406727828746308`,0.02447916666666683`,0.01177675371223752`,0.0045546558704454565`,-0.03173803526448382`,0.003121748178980477`,0.021265560165975028`,-0.018283392585068614`,0.0005173305742369738`,0.012409513960703`,-1.1102230246251565`*^-16,-0.025536261491317713`,0.012578616352201255`,-0.021739130434782705`,-0.015343915343915326`,-0.0338527673293928`,0.014460511679643906`,0.00164473684210531`,0.02463054187192104`,-0.01175213675213671`,0.001621621621621827`,0.012951969778737027`,-0.0015982951518381805`,0.`,0.005869797225186879`,0.012732095490716189`,-0.0031430068098480257`,0.014188124014713699`,0.00932642487046631`,-0.009753593429158158`,0.010886469673405896`,-0.009743589743589798`,-0.007767995857068777`,-0.000521920668058562`,-0.008355091383811963`,-0.0036861506055816395`,0.003171247357293794`,0.0021074815595363283`,-0.003154574132492094`,0.014767932489451185`,0.006237006237006293`,-0.022210743801652888`,-0.002641310089804505`,0.010593220338983134`,0.027253668763102867`,-0.0025510204081633514`,-0.007161125319693151`,0.0015455950540959051`,0.007716049382715973`,-0.01786625829504851`,-0.01819126819126815`,0.0052938062466911795`,0.003159557661927437`,0.011548556430446055`,-0.010378827192527251`,0.002097535395909622`,-0.012035583464154898`,-0.0068855932203388814`,-0.008533333333333282`,0.008606777837547153`,0.01013333333333355`,-0.0168954593453009`,-0.011815252416756294`,-0.014673913043478204`,0.006067291781577389`,0.01041666666666674`,0.0010851871947912262`,0.010298102981029844`,-0.025751072961373356`,-0.0022026431718061845`,-0.014348785871964753`,-0.01903695408734596`,0.0011415525114155667`,0.0017103762827823665`,0.0034149117814454844`,-0.013613159387407703`,0.0034502587694076325`,0.011461318051575908`,-0.011331444759206666`,0.019484240687679177`,0.0028344671201814275`,-0.0005652911249294235`,0.018099547511312153`,-0.013333333333333308`,-0.009572072072072224`,-0.022740193291642896`,0.017452006980802626`,0.00857632933104635`,0.006802721088435382`,0.0163288288288288`,0.017728531855955687`,-0.00816548720740351`,0.0005488474204171645`,0.013165112452002026`,-0.01624255549539788`,-0.01871216290588895`,-0.013460459899046429`,0.006822057987492913`,0.0011293054771315258`,-0.006204173716863992`,-0.006810442678774176`,0.016000000000000014`,0.011248593925759165`,0.01946607341490525`,-0.006001091107474044`,-0.004390779363336983`,-0.02094818081587646`,-0.02421171171171188`,0.`,-0.010963646855164266`,0.0029171528588098905`,-0.04188481675392686`,0.015179113539769196`,-0.05741626794258359`,0.002538071065989911`,-0.06582278481012671`,0.03455284552845539`,-0.05435494433529797`,0.03878116343490312`,0.012666666666666604`,0.032258064516129004`,-0.014668367346938771`,0.005177993527508251`,-0.054732775273663825`,-0.01634877384196176`,0.0013850415512466352`,0.028354080221300038`,0.011432414256892898`,-0.01728723404255328`,0.006089309878213767`,0.0322797579018157`,0.004560260586319309`,0.012321660181582317`,-0.007046764894298563`,-0.02709677419354839`,-0.0324933687002652`,0.03632625085675101`,-0.013227513227513032`,-0.03217158176943702`,-0.005540166204986097`,0.027158774373259087`,0.02440677966101701`,0.03772336201191262`,0.016097875080489432`,-0.009505703422053147`,-0.008317338451695466`,-0.041290322580645245`,-0.022207267833109`,0.011011699931176677`,0.02382573179033365`,0.01196808510638303`,-0.01905387647831802`,0.026121902210314962`,-0.04046997389033957`,-0.03469387755102038`,0.011980267794221122`,0.027158774373259087`,0.016949152542372836`,-0.0020000000000000018`,0.04141616566466255`,0.`,0.016035920461834552`,-0.010732323232323204`,0.02361199744735143`,-0.02244389027431415`,0.029336734693877542`,-0.01115241635687736`,0.006892230576441172`,-0.019290603609209755`,0.008248730964466988`,-0.013845185651353176`,0.007657945118059839`,0.06269791006966452`,-0.00715137067938032`,-0.031212484993997536`,-0.040892193308550207`,0.014211886304909438`,0.02547770700636942`,-0.016770186335403836`,-1.1102230246251565`*^-16,0.005685407454200764`,-0.03831658291457296`,0.01306335728282182`,0.01547388781431347`,-0.012698412698412653`,0.006430868167202508`,-0.015335463258785986`,-0.0194678780012979`,0.0006618133686300265`,-0.026455026455026287`,-0.01630434782608703`,-0.017265193370165632`,-0.0021082220660577633`,0.007042253521126751`,0.007692307692307665`,0.06662040249826506`,0.`,0.011060507482108184`,0.015444015444015413`,0.02344740177439797`,0.0012383900928794045`,-0.02535559678416832`,0.032360406091370475`,-0.022741241548862923`,-0.002515723270440251`,0.011979823455233296`,0.010591900311526459`,0.012946979038224393`,-0.008520998174071925`,0.024554941682013665`,0.023966446974236`,0.04037448800468124`,0.009653605905735496`,-0.011811023622047334`,-0.010244735344337008`,0.013801035077630752`,-0.009075439591605283`,0.025186033199771085`,0.010608598548297099`,-0.0005524861878453136`,0.0055279159756771445`,0.01154480483782283`,-0.007608695652173703`,0.008762322015334112`,0.0021715526601520097`,-0.004333694474539573`,-0.005440696409140355`,0.014770240700218817`,0.007008086253369239`,0.`,-0.011241970021413361`,-0.004872766648619464`,0.015233949945593128`,-0.003215434083601143`,-0.0021505376344087557`,-0.006465517241379226`,-0.010303687635574987`,0.0032876712328766544`,-0.0010922992900054274`,0.014215418261344981`,0.0016172506738543202`,0.006996770721205747`,0.003206841261357507`,-0.005860415556739551`,-0.012861736334405016`,0.009771986970684043`,-0.006989247311828151`,-0.00920411478072547`,0.013114754098360493`,0.014563106796116498`,0.006379585326953929`,-0.0010565240359218242`,0.0137493389740877`,-0.0036842105263158453`,-0.008452192287374483`,0.0042621204049013706`,-0.0053050397877985045`,0.0032000000000000917`,-0.0074428495481124735`,-0.006427423674344013`,-0.02264150943396237`,0.018753447324875827`,0.014076881429344823`,0.0005339028296849069`,0.004268943436499528`,0.02444208289054206`,0.00985477178423233`,0.019003595274781793`,0.002016129032258007`,0.0005030181086520535`,-0.007038712921065837`,0.`,-0.011139240506329084`,-0.0035842293906810374`,0.013874614594039159`,-0.0005068423720223647`,-0.0015212981744420206`,-0.003047232097511454`,0.006113092205807469`,-0.0025316455696202667`,-0.003045685279187804`,-0.011201629327902252`,-0.012358393408856916`,-0.015119916579770631`,-0.023822128110111085`,0.014642082429501047`,0.014965259219668514`,-0.021590310689836745`,0.0010764262648010892`,0.02311827956989232`,-0.012611665790856597`,0.002128791910590788`,0.011683483802442884`,-0.014698162729658848`,0.024507192328183214`,-0.004680187207488307`,0.008881922675026077`,0.00776799585706911`,-0.009763617677286729`,0.01089776855215363`,-0.0015400410677618437`,-0.007712082262210762`,-0.013989637305699465`,-0.0010509721492379942`,-0.0036822724881641067`,-0.01742344244984173`,0.00967221923696937`,-0.004257583821181354`,-0.021913415285943372`,-0.010382513661202242`,0.03257868580894541`,-0.0064171122994653995`,0.003767491926803146`,0.008579088471849738`,0.0031897926634769647`,-1.1102230246251565`*^-16,0.0037095919448859593`,-0.0026399155227032622`,0.007940709370036991`,-0.01575630252100846`,0.0026680896478121774`,-0.02927088877062267`,-0.02083333333333326`,0.0050391937290032995`,0.03509749303621179`,0.006458557588805203`,0.010160427807486716`,-0.004764425622022173`,0.019680851063829996`,-0.005738132498696147`,0.018363064008394714`,0.013910355486862258`,-0.012703252032520318`,0.01286670097786935`,0.005081300813008172`,-0.011627906976744207`,0.014447884416924683`,-0.014750762970498377`,0.014455343314403457`,0.016793893129771087`,0.003503503503503369`,0.031421446384039875`,-0.016924564796905184`,-0.0024594195769797045`,-0.004930966469428144`,-0.016352824578790837`,0.00201511335012583`,-0.021116138763197623`,0.0030816640986133237`,-0.012288786482335001`,0.017107309486780853`,-0.00917431192660545`,0.006687242798353754`,0.006131834440470163`,-0.002031488065007636`,0.003562340966921207`,0.011156186612576224`,-0.006018054162487574`,0.0015136226034309086`,0.027707808564231495`,0.01764705882352957`,-0.005780346820809301`,-0.002422480620155154`,-0.0009713453132588201`,-0.010209042294603843`,0.021611001964636722`,0.00048076923076911804`,0.007208073041806928`,-0.005248091603053395`,0.0023980815347721673`,0.00191387559808609`,-0.005253104106972439`,-0.002400384061449712`,0.0009624639076033503`,0.0043269230769229505`,-0.002393489707994245`,-0.0033589251439539725`,-0.003851709195955677`,-0.003383276945384206`,-0.006789524733268659`,0.0078125`,0.002422480620154932`,-0.0019333011116482446`,0.00048426150121083644`,-0.00871248789932233`,0.00341796875`,-0.009732360097323589`,0.006879606879606648`,0.03221083455344065`,0.013238770685579215`,-0.005132991133924403`,0.0051594746716696616`,0.013532431171255244`,0.005985267034990915`,0.004118993135011406`,-0.0027347310847767314`,0.008683729433272447`,0.008608971454463044`,0.015274034141958603`,0.004458314757021853`,-0.007545494895694782`,-0.0022361359570661765`,-0.009412819363513902`,0.02850678733031664`,-0.0008798944126704455`,0.004403346543372821`,-0.0008768084173607082`,0.005265467310223926`,0.0017459624618070269`,0.007407407407407529`,-0.00865051903114189`};

DJI

returnsDJIread=returnsDJI

SP500

returnsSP500read={0.003115649740951021`,0.0005455249357688707`,0.004001266334840103`,0.002881692928903501`,0.0017467554018411047`,-0.00938115747441104`,0.008325852387741861`,0.002426506528873551`,-0.010823189314386195`,0.012499669903083488`,-0.010597880423915185`,-0.01894485255351308`,-0.022141014617368837`,0.0045980801641385405`,-0.0042032130418131475`,0.004880192644002301`,-0.011817767653758526`,-0.009829142577891026`,0.014266158846042876`,0.012972943196320141`,-0.005474386397418596`,-0.031140638670166254`,0.002897160218604089`,-0.0088633358031871`,0.013040104472244796`,-0.0022325598774426414`,0.009680469605759523`,-0.0027446289651079647`,0.01800076242898707`,0.004237946057523034`,0.0065847513892551834`,0.0021865823356674863`,-0.0010458270598736608`,-0.012102778855786589`,0.009720445824958901`,-0.002080995982772893`,0.0014053348323570525`,0.010158534708326838`,0.0023303546620536686`,0.000429219089518984`,0.003736179265098949`,0.014007497974122263`,-0.00017563888644955838`,0.001712779973649603`,0.004524529790871812`,0.004041515000742013`,-0.00021734594519406958`,0.0004521778450246039`,0.0077791588078330864`,0.005821675607610377`,-0.00032584182951622687`,-0.005086504893509147`,0.005095266833347711`,0.007170979833763802`,-0.005493242034799062`,-0.0017041756585483014`,0.0007377351530799547`,0.005683230612297363`,0.00004261775285119285`,-0.0032729039351555578`,0.007413868294810166`,0.007928019692725607`,0.001684295627568444`,-0.005876715092816731`,0.0033743498668019622`,0.0066838609622061895`,0.001766621733633622`,0.0006853436747793484`,0.011150087697318956`,0.0008425226118200513`,-0.016126503090775568`,0.004521318983667699`,0.00805832052909361`,-0.0010189120007951802`,0.002263794218617887`,0.007123532477847583`,-0.004296464248159881`,-0.023381873685078935`,0.006462731581214909`,0.012943190975020169`,-0.016647607683256127`,0.013120528528933306`,-0.023838437609169483`,-0.0065865712338104565`,-0.032353521404616115`,-0.015308248016664416`,0.043974146622497434`,-0.0033973424848887657`,0.013739520155045426`,-0.01214505790879683`,-0.018800110588885866`,0.001109467455621349`,-0.014195999788907177`,-0.005130264097073511`,-0.03897583068023858`,0.015024402989949781`,-0.012908089621123664`,0.0003539328458992408`,-0.005660921948176467`,0.032876070977105654`,-0.012374666835892834`,-0.017165254587345524`,0.025842665147425725`,0.004051421183925097`,-0.03441146867604228`,-0.01353204116895812`,0.010976039296695772`,-0.0059416195856873966`,0.029506768085327817`,0.004379669500570449`,-0.0018046903627700894`,0.023494213632150318`,-0.0005559391336317221`,0.0012829599590888918`,0.0013171570911436614`,-0.0038567887535682077`,-0.016070786920589386`,-0.0029854561722252315`,-0.01680341379436645`,0.0028592983077051493`,-0.002033879416025841`,-0.031017057985984975`,-0.010112942261150226`,-0.0032404847144202886`,-0.0046623903754244855`,0.005358993917346178`,0.03133085617570952`,0.00941269676591805`,0.0072039243167483225`,0.000732865783517056`,0.015378910776361554`,-0.00015520295068183199`,0.001196161326552092`,-0.028819495111629845`,0.005981894673578125`,0.01141656942823821`,-0.012819802857459428`,0.022513299488589267`,0.008220029807894491`,0.011200188634755914`,-0.0010493179433369582`,-0.006921999569058257`,-0.0041586431974542926`,0.00006354797418128832`,0.02202251270878719`,-0.00479633346952546`,0.006051086161040997`,-0.0012685852169902478`,-0.0037039997868200114`,0.0054830426874932225`,-0.005967423013149675`,-0.028178688027402643`,-0.005378762150403449`,-0.004023587822186814`,0.00012045401899474228`,0.012192184402156636`,0.0014827832390578166`,-0.016935365942823633`,-0.0036629696085085373`,-0.004040347488546314`,-0.01451244191275669`,0.003289379866333375`,-0.007684800015161031`,0.016586772597925847`,-0.014719281601367595`,0.0003908782366623953`,0.02950454099282407`,0.00908089494487574`,0.013218970736629698`,-0.011471150102760563`,0.0064386723329425966`,0.004832236752300156`,0.0048633374993205525`,0.011130638547158789`,-0.0007130760317320961`,0.0035411649273036083`,-0.00036442176931195114`,0.0008269165792327282`,0.01520980108209935`,-0.0025640801253161705`,-0.004825492638930284`,-0.008331276228091822`,0.021194313807419984`,-0.005667424064352611`,0.004850458779855682`,-0.0025877842641806037`,-0.0030836965922095283`,0.00441640378548902`,-0.008034966499162577`,0.02086136689445306`,-0.0006719793237129901`,-0.0016465943084734702`,0.0061223079978585115`,0.00014590396086333612`,0.0038186935777297926`,0.007121057985757906`,-0.0036414565826330403`,0.002027585384346775`,0.007243727629039576`,-0.015877303306294333`,0.010524058667124025`,0.0017739375472130003`,0.00238930405164961`,0.002146938499509643`,0.000016868811255177363`,-0.0026905300091091267`,0.0011247832889340614`,-0.00043927081045458394`,0.0009465375319035463`,0.007759333997534368`,0.003678041505735141`,0.019282780727236215`,0.003922821155389444`,-0.002120977281070191`,-0.008052319640302397`,0.004376133179495589`,-0.004242190512919519`,-0.011808428234751145`,-0.001217468166543001`,-0.016205385097057046`,0.00021216287319436589`,0.015357333763225789`,0.002540340439044275`,-0.0015753544547524312`,-0.014284044613637858`,0.014922971382111072`,-0.00746860266199334`,-0.001378846477215534`,-0.006070249882131007`,0.02161704290373123`,0.012818493122289665`,0.0026032925920771444`,-0.0012982665284027028`,0.0005150761985741603`,0.0037017364657814245`,0.003842772006382944`,0.0060016220600163095`,0.00004837149306680111`,0.0009109523886299264`,-0.0051224639373704806`,0.006185082940019182`,0.0008367729529235035`,0.0025484158821778014`,0.006030086281553659`,0.0033795632073967408`,-0.0016443710082297835`,0.0006126817158269571`,0.0007713472334875959`,0.0010091298440217944`,-0.0015081998444171907`,-0.00019079721436077168`,0.011314843675455544`,-0.0013130272747999827`,0.005007085498346608`,-0.0021228927743309756`,-0.0018448011932330477`,-0.001376327172630809`,0.0037251427446347574`,0.009007595254535206`,-0.001710784161249257`,0.007384557861282559`,0.0013763879867618733`,-0.010115673889206311`,-0.0012949326010984752`,0.0024135722431379847`,0.0058362878404176755`,0.00026339437885414263`,0.004220945181926616`,0.002244279401216742`,-0.017852470874309412`,0.007662535061190523`,0.016693621124000968`,-0.0027225659419236603`,0.0023542403165570658`,0.002884247570958509`,0.006240130600288385`,0.004184829991281669`,-0.0027858097344797272`,0.0007495003331110528`,0.005507349436782771`,0.002384982883797848`,-0.0032349585685119697`,0.006257483000881026`,0.0030756106321840893`,0.0019247554889101348`,-0.02052851430741387`,-0.006112023353402551`,-0.0009943399112744`,0.010550493836612995`,0.005561111616207537`,-0.015739666370307992`,0.0016152120827050975`,0.017218978325334033`,-0.007378077642621439`,-0.008341217878363616`,0.008922778655553243`,-0.0013617587871268544`,-0.018870926198088056`,0.007080479650377169`,-0.006049314564357311`,-0.011200333233055138`,-0.01949495658686129`,0.01339825599898159`,0.004310209465188564`,0.014985811555569661`,-0.00355057841309947`,0.002913964615039788`,0.009340752500886396`,0.0031611257883723543`,-0.002747754604962682`,0.007060044726337367`,0.006684654095676867`,-0.0018294610994836757`,0.004962928882285`,0.00034523907806138787`,-0.00018006257174352225`,0.0021836518763647117`,-0.0015199844257752781`,-0.004004469407803413`,-0.002793317120549421`,-0.007776754299865574`,0.00019023558775188576`,0.00008368773822464703`,0.003925387213583598`,-0.011017822502424779`,0.005731185926413751`,0.013514954823178105`,0.005276767190835807`,-0.001592666257907216`,0.008979591836734802`,0.006249814435438372`,0.003555463759349786`,0.002300658591085414`,-0.001752700552210551`,-0.0033793214910154967`,-0.006855272662941614`,-0.009069857197993136`,0.003819938581379745`,0.00454409789583643`,0.008074040511331315`,-0.01111143859235475`,0.004895386266094537`,-0.008067326585845191`,-0.006204355008708418`,-0.0003685679255642782`,0.008803744224894272`,0.0021779992242740853`,-0.0076883000893122055`,-0.011925566464407122`,-0.0008274061197688365`,0.0031832132980824657`,0.003953137897869663`,0.004080893723268586`,0.010592742844264258`,-0.022784716027356655`,-0.001224753718002236`,-0.009733879689856284`,-0.010760214127492063`,-0.000956327701625681`,-0.004186965928370312`,0.0073775360280097235`,-0.013979829325058146`,0.0006687752757714716`,0.01261174842549706`,-0.017431883652853086`,0.0017543582367909316`,0.003045028557003615`,0.005395202516712327`,0.013423448793767223`,-0.006468445103124498`,-0.0028279752008329995`,-0.011725749902609994`,0.00918443769955446`,0.012944301226466726`,0.008282755057184898`,0.010119243389602461`,0.014409680155076376`,-0.001336149947375076`,0.001001584596525884`,0.010453846268723588`,-0.006961174088470412`,-0.01809048965619886`,-0.0044335311370301556`,0.0031058737553666393`,-0.006716146070485429`,0.00555440952883024`,-0.008129834212165954`,0.01630867753401155`,-0.0006708222471792924`,0.013546129246364558`,0.0009078731954159647`,-0.005643038765222763`,-0.0041048877324419974`,-0.020308722615132724`,-0.0032339890718757758`,-0.006450521654224328`,-0.004132231404958553`,-0.025556747012292713`,0.0050157489733264615`,-0.047820429407937515`,-0.0005749664602896498`,-0.06663442778769046`,0.047406785414396246`,-0.044152388425029665`,0.046290017488133106`,0.00526163187337958`,0.021784681161510333`,-0.009738561548871427`,0.000947382541332864`,-0.04459372303981102`,-0.015008986104414257`,0.00025811504810735464`,0.03428484988699254`,0.013119972469565866`,-0.01556555706521734`,0.015121585135473126`,0.028280081577158445`,0.0023469522676189403`,0.004922006397783729`,-0.0118714568172682`,-0.025281878414506576`,-0.007436305868122717`,0.028646459098554677`,-0.010612204034639583`,-0.026705455771987574`,0.006965682749538571`,0.009120083973603199`,0.01347975478953356`,0.017187131944677914`,0.005706676811869871`,-0.009802550965863799`,-0.0016610054065726576`,-0.029390478250380547`,-0.03188316363262367`,0.006082014235631705`,0.02333623716374955`,0.010688335698009421`,-0.0206911807245318`,0.00811425989957093`,-0.024974146845915257`,-0.02845097311343281`,0.022488469201167982`,0.017865563414742658`,0.018303715811648358`,-0.008163300342498014`,0.03412493725442678`,0.0005439831281539576`,0.009794737106244789`,-0.002973700559121939`,0.017380323347124582`,-0.019369906416893956`,0.020418699931715745`,-0.01264913741043594`,0.004554170661553281`,0.01880877742946696`,0.012873006258833142`,-0.020044809797558738`,0.010536593303771324`,0.03429146537842187`,0.0003892292482425841`,-0.024737567018652262`,-0.02794223250618355`,0.016104672160751177`,0.018781807900476677`,-0.0062799825556041355`,0.006295731828953821`,0.011735600101497212`,-0.036695090601291724`,0.008624196566593634`,0.01948051948051943`,-0.009550183961704262`,0.004817140392081809`,-0.016616182094274845`,-0.01679992885496928`,-0.0003946946461315104`,-0.018648459671780637`,-0.004140890878304826`,-0.022095215649304722`,-0.0026855111508963248`,0.029240422208221428`,0.002213743658546763`,0.043315288782536765`,-0.0019086418168987596`,-0.00024104517186507302`,0.01028707364901793`,0.0011057371050371412`,0.0020183238376758617`,-0.021141783173805218`,0.016883379916555308`,-0.014914076753320127`,-0.00868601745291031`,-0.011348339356954673`,0.003243055899391001`,0.0032161217355541893`,-0.011732777987308096`,0.029825361928070837`,0.001949569000241791`,0.008265526002637191`,0.009035087719298174`,0.00007903076667759024`,-0.012477971914685138`,0.01070708364008821`,-0.0042913018004465675`,0.015473918575063639`,0.00018793165552133395`,0.0029437093869881803`,-0.0025369615786926536`,0.002261682096712514`,0.00888576559693921`,0.00030957835428147007`,0.0023365932161425462`,-0.0049478965650328055`,0.003552893901899834`,0.011107933244181245`,0.004938686890309185`,0.000669456066945795`,0.00047134668308768113`,-0.001025835866261371`,0.008679116114555185`,-0.005753887456072748`,-0.0015928035618122394`,-0.0025221638950718717`,-0.0004569652934858226`,0.008899657881302314`,0.001095091723372299`,0.014605368378170613`,-0.0004238233325899454`,0.0020233127282736074`,0.0021602761590142627`,0.001474117751637083`,-0.006886349347239085`,0.006800035750461619`,-0.0009395089401303958`,-0.005383191410588628`,0.011025662023629534`,0.002348973520662101`,0.0007199371156967338`,-0.003340160474523013`,0.004272056332218721`,0.0016722162733047163`,0.0013545770058722706`,0.003356269057246841`,-0.004736987858735664`,0.006158104387557595`,-0.0032457844828212012`,-0.0038696582288648695`,-0.015370181700908092`,0.006900607432110739`,0.009817910293280496`,0.0036312787811787484`,0.00016048202966012504`,0.01813155956210033`,-0.0011963179196963214`,0.005967237570645878`,0.0011193497789818707`,0.003973877806818127`,-0.003000532009221457`,-0.0018711935796003054`,-0.007206552188696258`,0.003108890133402209`,0.013885807130433525`,-0.0028167820911960684`,-0.004941522951887434`,-0.0016079229335344003`,0.0036984778518898143`,0.007504597187018458`,-0.003988612019393267`,-0.010202493313899996`,-0.0006290387144736176`,-0.011358434424353248`,-0.017081464332224128`,0.0074488992264039044`,0.01377939811939699`,-0.012475046303970116`,-0.0005035540700304431`,0.015486612586432358`,-0.004055278333021772`,-0.005934418181555601`,0.0011692763559247865`,-0.008407506546828869`,0.003679751854507085`,0.013644613220405777`,0.0066801371980813595`,0.0024143202045741052`,-0.003883536654885278`,0.00565844725339959`,-0.0024967634547807815`,-0.007658791565345768`,-0.01614722938838875`,0.000350595281571886`,-0.00427868397610931`,-0.0067022555949901585`,0.002517385462652788`,-0.003387359258904543`,-0.011112835176852354`,-0.005745881122277363`,-0.004403829678505389`,-0.015051328502415529`,-0.007387765737320362`,0.016035885795463445`,0.000486325883935379`,0.0016937180529077445`,0.0013799796794202734`,-0.002165551079746919`,0.011078903036833676`,-0.01433481935125569`,-0.0022766728596229635`,-0.024642647272061224`,0.00010954273731655917`,0.0057268929258789125`,0.0230493971217427`,-0.00010645335442127646`,0.00811413014547635`,-0.01262012884148278`,0.011650737625388707`,-0.007023214366626895`,0.01081467510343126`,0.010337822586712786`,0.001444699294033569`,0.009815731941284156`,-0.0016863282228015697`,-0.022261726500896195`,0.0071745969475900395`,-0.015954817156297207`,0.004772706512803371`,0.008984916552398081`,-0.0021098472050155026`,0.02492024318304953`,0.002459329300522617`,0.006232103756105722`,-0.004686976899899498`,-0.009432720572105424`,-0.0016387633979980665`,-0.008125933484169567`,-0.000014909017719388906`,-0.004987140780498778`,0.016497347837813425`,-0.0023143029820602568`,0.0074096510150407635`,0.006680501880953482`,0.0027171141770712115`,-0.010061677721193374`,-0.008909045543275762`,-0.009040961999822295`,-0.0003138286346211494`,0.016540971230818657`,0.019080601755856463`,-0.0004834159469541133`,-0.004316754493611574`,-0.002899979700142108`,-0.00750370822790325`,0.019040293040293088`,0.00232927627085755`,0.005106761438213203`,0.0006208299140115781`,0.0004136298155781315`,0.0021884801824920697`,-0.0012518938450922779`,-0.00012819508443062677`,0.001139657960154583`,0.007100524357359861`,0.0018721167635693536`,-0.000021154171602644212`,-0.003497563693032335`,0.00022644126325910285`,-0.008072218409751808`,0.006454695880406369`,-0.0004889698326873138`,-0.0008082584158135564`,0.0008443908323281235`,-0.007805797985097396`,0.005073312944807951`,-0.0011659486129476093`,-0.001067661252437846`,0.0204355013395654`,0.004049939949166248`,-0.006147768999666292`,0.003134883981302794`,0.0020926923184241275`,0.01630979562287682`,0.00395893122555635`,-0.003124637562509802`,-0.001279778810421739`,0.0011854836499192167`,-0.0005407070257691382`,-0.00007532905099083553`,-0.0022326473307536787`,-0.010501822375059255`,-0.005736721259165134`,0.009648926966762561`,-0.004477766644784498`,0.002651544073243528`,0.0008722801819327497`,0.0036244163928758066`,0.007174411953218218`,-0.00032160941562886514`,-0.0034567022376158496`};

Example series and technicalities (needs to be activated before further calculation)

A random sequence

SeedRandom[13];
testRandomSequence=RandomVariate[UniformDistribution[],{1000}]-0.5;

Real sequences (Apple, WalMart, General Electric, S&P500)

Only returns are in this list:

assetsreturns={returnsAppleread,returnsWalMartread,returnsGEread,returnsSP500read};
assetsenames={"Apple","WalMart","GE","SP500"};

We deal with 4 series of length

Map[Length,assetsreturns]//Union//First

Technical: add the title to the data:

assetsreturnsnames={Prepend[returnsAppleread,"Apple"],
Prepend[returnsWalMartread,"WalMart"],
Prepend[returnsGEread,"GE"],
Prepend[returnsSP500read,"SP500"]};

Tests of independence (randomness)

Since the number of the observations is usually large we may often restrict ourselves to  asymptotic tests only. Some tests based on combinatorial functions may be performed as exact tests in Mathematica since the combinatorial functions work well in the system even for large samples. In commercial statistical packages the exact tests (if any) are limited to some 50 observations.

Signs of differences test

This is the simplest test that immediately shows a rude violence of independence, but it is not robust against alternatives like oscillations, &c. The test statistic C is the total number of sign differences in the sequence. Likely a monotonous trend may be discovered. It fails if the alternative are oscillating observations.

The central limit theorem for finitely dependent random variables (r. v.) may apply. In the sequence of differences only the neighbours are dependent while the farther observations are independent. So the sequence consists of 1-finitely dependent r. v. We need to calculate the mean and variance and use them for the standardized test statistic. After a simple algebra (analogous approach as in the more complicated case of local extremes analyzed in the next Subsection) we get

E,C=((n-1)/2)           var C=((n+1)/12).

The procedure is straightforward:

Needs["HypothesisTesting`"];
Clear[differencesTestAsymptotic];
differencesTestAsymptotic[data_,datasource_:"General Data"]:=Module[{signs=(1/2)(Sign[Rest[data]-Most[data]]+1),n=Length[data],crit,totalofsigns},
totalofsigns=Total[signs];
(* standardized statistic: *)
crit=Abs[(Sqrt[(12/(n+1))])(totalofsigns-(1./2)(n-1))];
Text@Grid[{{"Data   ",ToString[datasource]},
{"No. of observations   ",n},{"Total number of sign differences   ",totalofsigns},{"Standardized statistic   ",crit},{"Two-sided p-value  ",TwoSidedPValue/.NormalPValue[crit,TwoSided->True]}},Frame->{False,All},Alignment->Left]
	]

Example: Simulation

differencesTestAsymptotic[testRandomSequence,"testRandomSequence"]

Example: Real Data

Map[differencesTestAsymptotic[Rest[#],First[#]]&,assetsreturnsnames]//Partition[#,2]&//TableForm

We see that Apple reveals highly significant value. Look for the prices: the trend is obvious. We do not believe in the exponential growth, so without further analysis and comments we only show the simple linear fit:

findFitpricesAppleLinear=FindFit[pricesAppleread,model=α+β x,{α,β},x]
Show[Plot[Evaluate[model/.findFitpricesAppleLinear],{x,0,700},PlotStyle->{Red,Thick},PlotRange->All],ListPlot[pricesAppleread,Joined->True,PlotStyle->Thick]]

Test of local extremes

Note that this test is equivalent to the test of sequences and reversals (see [2]). The test statistic is the total number of local extremes (both maximum and minimum) in the data:

Preliminaries

Despite the results are well known, we show how to use built-in TransformedDistribution X-> Y for to derive the exact probabilities. For the sake of simplicity we first consider the sequence of length 5 which is the minimum length for valid considerations.

XX=Table[X[i],{i,5}];
YY=Table[Y[i]=Boole[Or[X[i]<X[i+1]>X[i+2],X[i]>X[i+1]<X[i+2]]],{i,3}]

The following results are valid for all continuous distributions but for convenience we choose the uniform distribution.

𝒟cinque=ProductDistribution[{UniformDistribution[],5}];
{Mean[𝒟cinque],Variance[𝒟cinque],Covariance[𝒟cinque]};

𝒟extreme=TransformedDistribution[YY,XX\[Distributed]𝒟cinque];
{expextreme=Mean[𝒟extreme],Variance[𝒟extreme]}
(covextreme=Covariance[𝒟extreme])//MatrixForm

Clear[n]; (* n-2 summands *)
(meanP=(n-2)expextreme[[1]])//TraditionalForm
(PvarP=((n-2) covextreme[[1,1]]+2(n-3) covextreme[[1,2]]+2(n-4) covextreme[[1,3]])//Simplify)//TraditionalForm

So if P is the total number of local extremes in the sequence then

E,P=((2(n-2))/3)           var P=((16n-29)/90).

Here we apply the central limit theorem for finitely dependent r. v. again. The sequence of Boolean indicators is a sequence of 2-finitely dependent r. v.

The procedure

To identify local extremes we use Partition with the offset to create subsequent triples.

Needs["HypothesisTesting`"];
Clear[localExtremesTestAsymptotic];localExtremesTestAsymptotic[data_,datasource_:"General Data"]:=Module[{triples,booleextreme,n=Length[data],crit,totalofextremes},
booleextreme[{x1_,x2_,x3_}]:=Boole[(x1<x2&&x2>x3)||(x1>x2&&x2<x3)];triples=Partition[data,3,1];
totalofextremes=Total[Map[booleextreme,triples]];
(* standardized statistic *)crit=Abs[(Sqrt[(90/(16n-29))])(totalofextremes-(2./3)(n-2))];
Text@Grid[{{"Data   ",ToString[datasource]},
{"No. of observations   ",n},{"Total number of local extremes   ",totalofextremes},{"Standardized statistic   ",crit},{"Two-sided p-value  ",TwoSidedPValue/.NormalPValue[crit,TwoSided->True]}},Frame->{False,All},Alignment->Left]
]

Example: Simulation

localExtremesTestAsymptotic[testRandomSequence,"testRandomSequence"]

Example: Real Data

Map[localExtremesTestAsymptotic[Rest[#],First[#]]&,assetsreturnsnames]//Partition[#,2]&//TableForm

We see that all the sequences have “reasonable” number of local extremes.

Runs test

This test is based on iterations below and above some value like mean or median, more often called runs. If we have a series of the elements of two kinds, A and B, say, then by a run we mean a contiguous sequence of the elements of the same kind. For example in the sequence A,A,B,B,B,A,A,B,A there are runs A,A, B,B,B, A,A, B, A and the total number of runs is 5. Note that the original Wald-Wolfowitz runs test was designed as a test whether two samples are from the same population, see [4] e. g.

Here we consider runs below and above median. Suppose (Subscript[X, 1]),...,(Subscript[X, n]) is the series in question, M the sample median. If we delete possible zeros in the sequence

𝒮={sign((Subscript[X, 1])-M),...,sign((Subscript[X, n])-M) }

we get the sequence of ±1’s. Let Q be the total number of runs in this sequence, i. e., the total number of contiguous subsequences plus ones and minus ones, respectively.  Note that if n is odd and there are no ties in sequence 𝒮 then there is the same number m=(n-1)/2 of plus ones and minus ones in 𝒮. Analogously, if n is even, no ties, there is the same number m=n/2 of plus ones and minus ones in 𝒮.  In [5], p. 361 (e. g.) we find that the first two moments of the number of runs are

E,Q=m+1           var Q=((m(m-1))/(2m-1)).

Since the procedure below is designed for a more general case (not only the iterations below and above median), we distinguish between the number of positive signs (Subscript[n, 1]) and negative signs (Subscript[n, 2]) in 𝒮.

Needs["HypothesisTesting`"];
Clear[runsTestAsymptotic]; (* iterations below and above median *)
runsTestAsymptotic[data_,datasource_:"General Data"]:=
Module[{signs,splitting,numberofruns,n,n1,n2,rmean,rvariance,crit,median=Median[data]},
signs=Sign[data-median]//N;
splitting=Split[DeleteCases[signs,0.]];
numberofruns=Length[splitting]; (* total number of runs *)
n1=Count[signs,1.]; (* number of positive values *)
n2=Count[signs,-1.]; (* number of negative values *)
n=n1+n2;
rmean=((2 n1 n2)/(n1+n2))+1; rvariance=((2.n1 n2(2n1 n2 -n1-n2))/((((n1+n2))^2)(n1+n2-1)));
crit=Abs[((numberofruns-rmean)/(Sqrt[rvariance]))];
Text@Grid[{{"Data   ",ToString[datasource]},
{"No. of observations   ",Length[data]},{"Median   ",median},{"Number of runs   ",numberofruns},{"Expected   ",rmean},{"Standardized statistic   ",crit},{"Two-sided p-value  ",TwoSidedPValue/.NormalPValue[crit,TwoSided->True]}},Frame->{False,All},Alignment->Left]
]

Example: Simulation

runsTestAsymptotic[testRandomSequence,"testRandomSequence"]

Example: Real Data

Map[runsTestAsymptotic[Rest[#],First[#]]&,assetsreturnsnames]//Partition[#,2]&//TableForm

We see that WalMart reveals a significant value at the 5 per cent significance level.

Test of symmetry and distribution of P&L

Test of symmetry about an unknown median

We develop a test (see [3]) based on the statistic

T=(((OverBar[X])-M)/J)

where M is the sample median and

J=(Sqrt[(π/2)])(1/n)(∑_(i=1)^n) |(Subscript[X, i])-M|

is a robust estimate of standard deviation. Let us denote μ the unknown mean of the underlying population, σ its standard error, ν the median, τ=E,D, where

D=(1/n)(∑_(i=1)^n) |(Subscript[X, i])-M| .

Denote further

(σ^2)(T)=(2/(π (τ^2)))((σ^2)  +(1/(4 (f^2)(ν)))-(τ/(f(ν))))

where f is the density. Note that these values for selected symmetric distributions vary from 0.570796 for the standard normal to 0.968946 for the Student t on 3 degrees of freedom. Its estimate is called “Asymptotic variance in the output of the procedures.

Under the null hypothesis that the underlying distribution is symmetric the distribution of  T is asymptotically normal with zero mean and the variance

(σ^2)(T,n)=(1/n)(σ^2)(T).

In the test we replace all the unknown quantities by their empirical estimates and f by the kernel estimate. We tried two bandwidth selection methods: “StandardDeviation” and “Oversmooth”. The results are similar for both methods in our examples.

Needs["HypothesisTesting`"];
Clear[symmetryStandardDeviationTestAsymptotic];
symmetryStandardDeviationTestAsymptotic[data_,datasource_:"General Data"]:=Module[{n=Length[data],median=Median[data],mean=Mean[data],tau,kernelestimate,fv,s2=Variance[data],s2T,s2Tn,j,t,crit},
tau=(1/n)Total[Abs[data-median]];j=(Sqrt[(π/2)])tau;
kernelestimate=SmoothKernelDistribution[data,"StandardDeviation"];
fv=PDF[kernelestimate,median];
s2T=(2/(π (tau^2)))(s2+(1/(4(fv^2)))-(tau/fv));s2Tn=(1/n)s2T;
t=((mean-median)/j);
crit=Abs[t/(Sqrt[s2Tn])];
Text@Grid[{{"Data   ",ToString[datasource]},{"Kernel   ","StandardDeviation"},
{"No. of observations   ",n},{"Statistic T   ",t},{"Asymptotic variance   ",s2T},{"Standardized statistic   ",crit},{"Two-sided p-value  ",TwoSidedPValue/.NormalPValue[crit,TwoSided->True]}},Frame->{None,All},Alignment->Left]
	]

Needs["HypothesisTesting`"];
Clear[symmetryOversmoothTestAsymptotic];
symmetryOversmoothTestAsymptotic[data_,datasource_:"General Data"]:=Module[{n=Length[data],median=Median[data],mean=Mean[data],tau,kernelestimate,fv,s2=Variance[data],s2T,s2Tn,j,t,crit},
tau=(1/n)Total[Abs[data-median]];j=(Sqrt[(π/2)])tau;
kernelestimate=SmoothKernelDistribution[data,"Oversmooth"];
fv=PDF[kernelestimate,median];
s2T=(2/(π (tau^2)))(s2+(1/(4(fv^2)))-(tau/fv));s2Tn=(1/n)s2T;
t=((mean-median)/j);
crit=Abs[t/(Sqrt[s2Tn])];
Text@Grid[{{"Data   ",ToString[datasource]},{"Kernel  ","Oversmooth"},
{"No. of observations   ",n},{"Statistic T   ",t},{"Asymptotic variance   ",s2T},{"Standardized statistic   ",crit},{"Two-sided p-value  ",TwoSidedPValue/.NormalPValue[crit,TwoSided->True]}},Frame->{None,All},Alignment->Left]
	]

Example: Simulation

Here are the results for “StandardDeviation” and “Oversmooth” bandwidth selection for the test sequence.

{symmetryStandardDeviationTestAsymptotic[testRandomSequence,"testRandomSequence"],symmetryOversmoothTestAsymptotic[testRandomSequence,"testRandomSequence"]}//Partition[#,2]&//TableForm

Example: Real Data (Standard deviation bandwidth selection)

Map[symmetryStandardDeviationTestAsymptotic[Rest[#],First[#]]&,assetsreturnsnames]//Partition[#,2]&//TableForm

Example: Real Data (Oversmooth bandwidth selection)

Map[symmetryOversmoothTestAsymptotic[Rest[#], First[#]] &, assetsreturnsnames]//Partition[#,2]&//TableForm

Is the distribution of losses the same as the distribution of profits?

Let L=-R denote losses. Here we use the Kolmogorov-Smirnov two-sample test for testing the null hypothesis whether the distributions (𝒟) are the same:

(Subscript[H, 0]):𝒟,(L|L>0)= 𝒟,(-L|L<0)

Needs["HypothesisTesting`"];
Clear[profitsLossesTest];
profitsLossesTest[data_,datasource_:"General Data"]:=Module[{profits,losses,np,nl,ℋ},
profits=Select[data,#>0&];
losses=-Select[data,#≤0&];
np=Length[profits]; nl=Length[losses];
ℋ=KolmogorovSmirnovTest[profits,losses,"HypothesisTestData"];
Text@Grid[{{"Data   ",ToString[datasource]},
{"No. of observations   ",np+nl},{"No. of profits   ",np},{"No. of losses   ",nl},{"K-S statistic",ℋ["TestData"][[1]]},{"P-value  ",ℋ["TestData"][[2]]}},Frame->{None,All},Alignment->Left]
	]

Example: Simulation

profitsLossesTest[testRandomSequence,"testRandomSequence"]

Example: Real Data

Map[profitsLossesTest[Rest[#], First[#]] &, assetsreturnsnames]//Partition[#,2]&//TableForm

We see that on the 5 per cent significance level we cannot reject the null hypothesis.

Estimation

Mixture of three normals

Here we study a “symmetric” mixture of three normal distribution. By the symmetric mixture we mean that the side distributions have the same weight. First we study the general case with  seven parameters but in the next Subsubsection we will see that even the mixture with equal variances possesses a very flexible model.

General case (7 parameters)

Clear[𝒟3normals,μ1,μ2,μ3,σ1,σ2,σ3,σ,ε];
𝒟3normals[μ1_,μ2_,μ3_,σ1_,σ2_,σ3_,ε_]=MixtureDistribution[{ε,1-2 ε,ε},{NormalDistribution[μ1,σ1],NormalDistribution[μ2,σ2],NormalDistribution[μ3,σ3]}];
{Skewness[𝒟3normals[μ1,μ2,μ3,σ1,σ2,σ3,ε]],kurtosis3normals=Kurtosis[𝒟3normals[μ1,μ2,μ3,σ1,σ2,σ3,ε]]}//Simplify;
({Skewness[𝒟3normals[μ1,μ2,μ3,σ1,σ2,σ3,ε]],Kurtosis[𝒟3normals[μ1,μ2,μ3,σ1,σ2,σ3,ε]]}/.{σ1->σ,σ2->σ,σ3->σ})//Simplify;

With restriction ε≥0.05 we attain the value of kurtosis 60 with equal means.

NMaximize[ {kurtosis3normals,And[σ1>0,σ2>0,σ3>0,0.05≤ε<0.5]},{μ1,μ2,μ3,σ1,σ2,σ3,ε}]

Manipulate[Column[{
Text@Style[Row[{"Mean:        ",Mean[𝒟3normals[μ1,μ2,μ3,σ1,σ2,σ3,ε]],"        Variance: ",Variance[𝒟3normals[μ1,μ2,μ3,σ1,σ2,σ3,ε]]}],Bold,16],
Text@Style[Row[{"Skewness: ",Skewness[𝒟3normals[μ1,μ2,μ3,σ1,σ2,σ3,ε]],"     Kurtosis: ",Kurtosis[𝒟3normals[μ1,μ2,μ3,σ1,σ2,σ3,ε]]}],Bold,16],
Plot[PDF[𝒟3normals[μ1,μ2,μ3,σ1,σ2,σ3,ε],x],{x,-5,5},AxesOrigin->{0,0},PlotStyle->{Black,Thick},PlotRange->All,ImageSize->Large]}],
{{μ1,-3.57},-4,4},
{{μ2,0},-4,4},
{{μ3,3},-4,4},
{{σ1,0.8},0.1,3},
{{σ2,0.2},0.1,3},
{{σ3,0.8},0.1,3},
{{ε,0.02},0.01,0.4},SaveDefinitions->True]

We see that if the side distributions have substantially higher variance than the central one, then  with very small weights of the side distributions we can attain surprisingly high values of kurtosis of the mixture. High values of kurtosis may be even attained in the case of equal variance of the three components as we will see in the following Section.

Equal variances (5 parameters)

Clear[mixture];
mixture[dist1_,dist2_,dist3_,ε_]:=MixtureDistribution[{ε,1-2ε,ε},{dist1,dist2,dist3}]
𝒟3normalsEqualVariances[μ1_,μ2_,μ3_,σ_,ε_]=mixture[NormalDistribution[μ1,σ],NormalDistribution[μ2,σ],NormalDistribution[μ3,σ],ε]

kurtosis𝒟3normalsEqualVariances=Kurtosis[𝒟3normalsEqualVariances[μ1,μ2,μ3,σ,ε]]//Simplify;

Still the kurtosis may be rather high:

NMaximize[ {kurtosis𝒟3normalsEqualVariances,And[σ>0.1,0.05≤ε<0.49]},{μ1,μ2,μ3,σ,ε}]

An example of a symmetric mixture:

Plot[PDF[𝒟3normalsEqualVariances[μ1,μ2,μ3,σ,ε]/.Thread[{μ1,μ2,μ3,σ,ε}-> {-2.5,0,2.5,0.5,0.1}],x],{x,-6,6},PlotRange->All,PlotStyle->{Black,Thick}]

Manipulate[Column[{
Text@Style[Row[{"Mean:        ",Mean[𝒟3normalsEqualVariances[μ1,μ2,μ3,σ,ε]],"        Variance: ",Variance[𝒟3normalsEqualVariances[μ1,μ2,μ3,σ,ε]]}],Bold,16],
Text@Style[Row[{"Skewness: ",Skewness[𝒟3normalsEqualVariances[μ1,μ2,μ3,σ,ε]],"     Kurtosis: ",Kurtosis[𝒟3normalsEqualVariances[μ1,μ2,μ3,σ,ε]]}],Bold,16],
(* Text@Style[Row[{"\n\n"}]], *)
Plot[PDF[𝒟3normalsEqualVariances[μ1,μ2,μ3,σ,ε],x],{x,-5,5},AxesOrigin->{0,0},PlotStyle->{Black,Thick},PlotRange->All,ImageSize->Large]}],
{{μ1,-3},-4,4},
{{μ2,0},-4,4},
{{μ3,3},-4,4},
{{σ,0.51},0.1,3},
{{ε,0.04},0.001,0.4},SaveDefinitions->True]

Example: Simulation

simulation[distribution_,numberofsimulations_,randomseed_:13]:=Module[{},SeedRandom[randomseed];RandomVariate[distribution,numberofsimulations]
	]

Here are two simulations, each of them of length 1000. Function EstimatedDistribution is used to estimate the parameters of the mixture.

simulation3normals1=simulation[𝒟3normalsEqualVariances[μ1,μ2,μ3,σ,ε]/.Thread[{μ1,μ2,μ3,σ,ε}-> {-2.5,0,2.5,0.5,0.1}],1000];
estimation3normals1=EstimatedDistribution[simulation3normals1,𝒟3normalsEqualVariances[μ1,μ2,μ3,σ,ε]]
Histogram[simulation3normals1,Automatic,"PDF",Epilog->First@Plot[PDF[estimation3normals1,x],{x,-4,4},PlotStyle->Red,PlotRange->All]]
simulation3normals2=simulation[𝒟3normalsEqualVariances[μ1,μ2,μ3,σ,ε]/.Thread[{μ1,μ2,μ3,σ,ε}-> {-2.5,0,2.5,0.5,0.1}],1000,12345];
estimation3normals2=EstimatedDistribution[simulation3normals2,𝒟3normalsEqualVariances[μ1,μ2,μ3,σ,ε]]
Histogram[simulation3normals2,Automatic,"PDF",Epilog->First@Plot[PDF[estimation3normals2,x],{x,-4,4},PlotStyle->Red,PlotRange->All]]

Example: Real Data

estimationassets=Table[EstimatedDistribution[Rest[assetsreturnsnames[[i]]],𝒟3normalsEqualVariances[μ1,μ2,μ3,σ,ε]],{i,4}]

Table[Histogram[Rest[assetsreturnsnames[[i]]],Automatic,"PDF",Epilog->First@Plot[PDF[estimationassets[[i]],x],{x,-4,4},PlotStyle->Red,PlotRange->All],PlotLabel->First[assetsreturnsnames[[i]]],ImageSize->Medium],{i,4}]//Partition[#,2]&//TableForm

Mixture of two normals and a Student t

As in the previous case we will suppose equal variances and a “symmetric” mixture again. The central part is a Student t and the side distributions are normal. This mixture has one more parameter ν, the degrees of freedom of the Student t. Note that in Mathematica ν need not be integer which increases the flexibility.

Equal variances (6 parameters)

mixture[dist1_,dist2_,dist3_,ε_]:=MixtureDistribution[{ε,1-2ε,ε},{dist1,dist2,dist3}]
𝒟2normalsStudent[μ1_,μ2_,μ3_,σ_,ν_,ε_]=mixture[NormalDistribution[μ1,σ],StudentTDistribution[μ2,σ,ν],NormalDistribution[μ3,σ],ε]
{Mean[𝒟2normalsStudent[μ1,μ2,μ3,σ,ν,ε]],Variance[𝒟2normalsStudent[μ1,μ2,μ3,σ,ν,ε]]}/.Thread[{μ1,μ2,μ3,σ,ν,ε}-> {-3,0,3,1,5,0.2}]

Here is a typical example of the above mixture:

Plot[PDF[𝒟2normalsStudent[μ1,μ2,μ3,σ,ν,ε]/.Thread[{μ1,μ2,μ3,σ,ν,ε}-> {-2.5,0,2.5,0.5,5,0.1}],x],{x,-6,6},PlotRange->All,PlotStyle->{Black,Thick}]

Flexibility is illustrated by the following manipulation.

Manipulate[Column[{
Text@Style[Row[{"Mean:        ",Mean[𝒟2normalsStudent[μ1,μ2,μ3,σ,ν,ε]],"        Variance: ",Variance[𝒟2normalsStudent[μ1,μ2,μ3,σ,ν,ε]]}],Bold,16],
Text@Style[Row[{"Skewness: ",Skewness[𝒟2normalsStudent[μ1,μ2,μ3,σ,ν,ε]],"     Kurtosis: ",Kurtosis[𝒟2normalsStudent[μ1,μ2,μ3,σ,ν,ε]]}],Bold,16],
Plot[PDF[𝒟2normalsStudent[μ1,μ2,μ3,σ,ν,ε],x],{x,-5,5},AxesOrigin->{0,0},PlotStyle->{Black,Thick},PlotRange->All,ImageSize->Large]}],
{{μ1,-3},-4,4},
{{μ2,0},-4,4},
{{μ3,3},-4,4},
{{ν,5},4,8,0.1},
{{σ,0.51},0.1,3},
{{ε,0.04},0.001,0.4},SaveDefinitions->True]

Example: Simulation

Simulation and estimation by maximum likelihood:

simulation2normalsStudent1=simulation[𝒟2normalsStudent[μ1,μ2,μ3,σ,ν,ε]/.Thread[{μ1,μ2,μ3,σ,ν,ε}-> {-2.5,0,2.5,0.5,5,0.1}],1000,1315];estimation2normalsStudent1=EstimatedDistribution[simulation2normalsStudent1,𝒟2normalsStudent[μ1,μ2,μ3,σ,ν,ε]]
Histogram[simulation2normalsStudent1,Automatic,"PDF",Epilog->First@Plot[PDF[estimation2normalsStudent1,x],{x,-4,4},PlotStyle->Red,PlotRange->All]]

Similar, also not too satisfactory results are obtained via method of moments (estimation by matching of central moments):

simulation2normalsStudent1=simulation[𝒟2normalsStudent[μ1,μ2,μ3,σ,ν,ε]/.Thread[{μ1,μ2,μ3,σ,ν,ε}-> {-2.5,0,2.5,0.5,5,0.1}],1000,1315];momentestimation2normalsStudent1=EstimatedDistribution[simulation2normalsStudent1,𝒟2normalsStudent[μ1,μ2,μ3,σ,ν,ε],ParameterEstimator->"MethodOfCentralMoments"]
Histogram[simulation2normalsStudent1,Automatic,"PDF",Epilog->First@Plot[PDF[momentestimation2normalsStudent1,x],{x,-4,4},PlotStyle->Red,PlotRange->All]]

Example: Real Data

For the real data the results are even less satisfactory. The number of iterations does not play any important role.

estimationassets2normalsStudent=Table[EstimatedDistribution[Rest[assetsreturnsnames[[i]]],𝒟2normalsStudent[μ1,μ2,μ3,σ,ν,ε]],{i,4}]

Table[Histogram[Rest[assetsreturnsnames[[i]]],Automatic,"PDF",Epilog->First@Plot[PDF[estimationassets2normalsStudent[[i]],x],{x,-0.4,0.4},PlotStyle->Red,PlotRange->All],PlotLabel->First[assetsreturnsnames[[i]]],ImageSize->Medium],{i,4}]//Partition[#,2]&//TableForm

The suspicious appearance (obviously different areas under the histogram and the estimated curve in the given range) is caused that the estimated side distributions are far from the range of actual observations and have high weights while the central part of the estimated distribution has the weight of some 1 per cent (!) in the case of the first company (Apple).

momentsApple={Mean[estimationassets2normalsStudent[[1]]],StandardDeviation[estimationassets2normalsStudent[[1]]]}

Plot[PDF[estimationassets2normalsStudent[[1]],x],{x,-0.1,3},PlotRange->All,PlotStyle->{Black,Thick},ImageSize->Medium]

The almost invisible hump at point 2 corresponds to the central part. The above estimates are obviously nonsenses. Note that the method of moments resulted in inconsistent system of equations.

momentestimationassets2normalsStudent=Table[EstimatedDistribution[Rest[assetsreturnsnames[[i]]],𝒟2normalsStudent[μ1,μ2,μ3,σ,ν,ε],ParameterEstimator->"MethodOfMoments"],{i,4}]

Kernel estimator

Example: Simulation

We use the same data set as in the previous Section.

simulation2normalsStudent1=simulation[𝒟2normalsStudent[μ1,μ2,μ3,σ,ν,ε]/.Thread[{μ1,μ2,μ3,σ,ν,ε}-> {-2.5,0,2.5,0.5,5,0.1}],1000,1315];smoothkernelestimation2normalsStudent1=SmoothKernelDistribution[simulation2normalsStudent1];
Histogram[simulation2normalsStudent1,Automatic,"PDF",Epilog->{First@Plot[PDF[𝒟2normalsStudent[μ1,μ2,μ3,σ,ν,ε]/.Thread[{μ1,μ2,μ3,σ,ν,ε}-> {-2.5,0,2.5,0.5,5,0.1}],x],{x,-4,4},PlotStyle->{Black,Thick},PlotRange->All],First@Plot[PDF[smoothkernelestimation2normalsStudent1,x],{x,-4,4},PlotStyle->{Red,Dashed,Thick},PlotRange->All]},PlotRange->{0,0.6}]

On the plot, black line is the simulated density and dashed red line is a kernel estimate with the Gaussian kernel and automatic (i. e. Silverman) choice of the bandwidth.

We can play with the bandwidth:

Manipulate[Plot[PDF[SmoothKernelDistribution[simulation2normalsStudent1,bandwidth],x],{x,-4,4},PlotStyle->{Black,Thick}],{{bandwidth,0.4},0.3,0.6},SaveDefinitions->True]

Example: Real Data

estimationassetsKernel=Table[SmoothKernelDistribution[Rest[assetsreturnsnames[[i]]]],{i,4}]

Table[Histogram[Rest[assetsreturnsnames[[i]]],Automatic,"PDF",Epilog->First@Plot[PDF[estimationassetsKernel[[i]],x],{x,-0.4,0.4},PlotStyle->Red,PlotRange->All],PlotLabel->First[assetsreturnsnames[[i]]],ImageSize->Medium],{i,4}]//Partition[#,2]&//TableForm

Test of goodness of fit

Here we study how smooth kernel distribution fits the data. For the sake of simplicity we choose the automatic options.

Needs["HypothesisTesting`"];
Clear[goodnessOfFit];
goodnessOfFit[data_,hypotheticaldistribution_,datasource_:"General Data"]:=
Module[{n,ℋ},
n=Length[data];
ℋ=KolmogorovSmirnovTest[data,hypotheticaldistribution,"HypothesisTestData"];
Text@Grid[{{"Data   ",ToString[datasource]},
{"No. of observations   ",n},{"K-S statistic",ℋ["TestData"][[1]]},{"P-value  ",ℋ["TestData"][[2]]}},Frame->{None,All},Alignment->Left]
	]

Table[goodnessOfFit[Rest[assetsreturnsnames[[i]]],estimationassetsKernel[[i]],First[assetsreturnsnames[[i]]]],{i,4}]//Partition[#,2]&//TableForm

As expected, the fit is perfect. With respect to the number of observations, i.e. 697, the number of ties is negligible:

Text@Grid[Table[{First[assetsreturnsnames[[i]]],"   ",Length[Union[Rest[assetsreturnsnames[[i]]]]]},{i,4}],Frame->True,Alignment->Left]

References

[1] Martin, E. C.: Mixture Estimation using the EM Algorithm. ~/MathSource/427/MixtureEstimation.m
[2] Campbell, J. Y., Lo, A. W., MacKinlay, A. C.: The Econometrics of Financial Markets. Princeton University Press. Princeton, 1996.
[3] Miao, W., Gel, Y. R., Gastwirth, J.: A new test of symmetry about an unknown median. In: Random Walk, Sequential Analysis and Related Topics - A Festschrift in Honour of Yuan-Shih Chow (Edited by A. Hsiung, C.-H. Zhang, and Z. Ying). pp. 199-214. Word Scientific. Singapore, 2006.
[4] Wald, A., Wolfowitz, J.: On a test whether two samples are from the same population. The Annals of Mathematical Statistics 11(1940), No. 2, pp. 147-162.
[5] Hátle, J., Likeš, J.: Elements of Probability and Mathematical Statistics. SNTL/ALFA. Praha, 1974. (In Czech)