Skip to contents

The `neecdf()` function enables to implement the naive estimation of the cumulative distribution function (CDF) of the heterogeneous mean, the heterogeneous autocovariance, and the heterogeneous autocorrelation. The method is developed by Okui and Yanagi (2019). For more details, see the package vignette with `vignette("panelhetero")`.

Usage

neecdf(data, acov_order = 0, acor_order = 1, R = 1000, ci = TRUE)

Arguments

data

A matrix of panel data. Each row corresponds to individual time series.

acov_order

A non-negative integer of the order of autocovariance. Default is 0.

acor_order

A positive integer of the order of autocorrelation. Default is 1.

R

A positive integer of the number of bootstrap repetitions. Default is 1000.

ci

A logical whether to estimate the confidence interval. Default is TRUE.

Value

A list that contains the following elements.

mean

A plot of the corresponding CDF

acov

A plot of the corresponding CDF

acor

A plot of the corresponding CDF

mean_func

A function that returns the corresponding CDF

acov_func

A function that returns the corresponding CDF

acor_func

A function that returns the corresponding CDF

mean_ci_func

A function that returns the 95 percent confidence interval for the corresponding CDF

acov_ci_func

A function that returns the 95 percent confidence interval for the corresponding CDF

acor_ci_func

A function that returns the 95 percent confidence interval for the corresponding CDF

quantity

A matrix of the estimated heterogeneous quantities

acov_order

The order of autocovariance

acor_order

The order of autocorrelation

N

The number of cross-sectional units

S

The length of time series

R

The number of bootstrap repetitions

References

Okui, R. and Yanagi, T., 2019. Panel data analysis with heterogeneous dynamics. Journal of Econometrics, 212(2), pp.451-475.

Examples

data <- panelhetero::simulation(N = 300, S = 50)
panelhetero::neecdf(data = data, R = 50)
#> $mean

#> 
#> $acov

#> 
#> $acor

#> 
#> $mean_func
#> function (x) 
#> {
#>     ecdfest(x = x, X = mean_est)
#> }
#> <bytecode: 0x56308f4fa260>
#> <environment: 0x56308f4faf10>
#> 
#> $acov_func
#> function (x) 
#> {
#>     ecdfest(x = x, X = acov_est)
#> }
#> <bytecode: 0x56308f4fa500>
#> <environment: 0x56308f4faf10>
#> 
#> $acor_func
#> function (x) 
#> {
#>     ecdfest(x = x, X = acor_est)
#> }
#> <bytecode: 0x56308f4fa7a0>
#> <environment: 0x56308f4faf10>
#> 
#> $mean_ci_func
#> function (x) 
#> {
#>     args <- lapply(as.list(match.call())[-1L], eval, parent.frame())
#>     names <- if (is.null(names(args))) 
#>         character(length(args))
#>     else names(args)
#>     dovec <- names %in% vectorize.args
#>     do.call("mapply", c(FUN = FUN, args[dovec], MoreArgs = list(args[!dovec]), 
#>         SIMPLIFY = SIMPLIFY, USE.NAMES = USE.NAMES))
#> }
#> <environment: 0x56308ee14208>
#> 
#> $acov_ci_func
#> function (x) 
#> {
#>     args <- lapply(as.list(match.call())[-1L], eval, parent.frame())
#>     names <- if (is.null(names(args))) 
#>         character(length(args))
#>     else names(args)
#>     dovec <- names %in% vectorize.args
#>     do.call("mapply", c(FUN = FUN, args[dovec], MoreArgs = list(args[!dovec]), 
#>         SIMPLIFY = SIMPLIFY, USE.NAMES = USE.NAMES))
#> }
#> <environment: 0x56308ee0c8d0>
#> 
#> $acor_ci_func
#> function (x) 
#> {
#>     args <- lapply(as.list(match.call())[-1L], eval, parent.frame())
#>     names <- if (is.null(names(args))) 
#>         character(length(args))
#>     else names(args)
#>     dovec <- names %in% vectorize.args
#>     do.call("mapply", c(FUN = FUN, args[dovec], MoreArgs = list(args[!dovec]), 
#>         SIMPLIFY = SIMPLIFY, USE.NAMES = USE.NAMES))
#> }
#> <environment: 0x56308ee05e68>
#> 
#> $quantity
#>                mean autocovariance autocorrelation
#>   [1,]  0.796661430     1.23206480    0.1854803763
#>   [2,]  0.699254422     1.57847573   -0.0607565917
#>   [3,]  0.987663683     0.38189181    0.2992817492
#>   [4,] -0.210890385     0.67500096    0.1701693971
#>   [5,] -0.584719784     0.18026581    0.3120747984
#>   [6,]  0.184464566     0.25963899    0.1225625404
#>   [7,]  0.331575289     0.20114001    0.0988132051
#>   [8,] -1.633438296     0.27068129    0.2561380872
#>   [9,]  1.405913010     0.91681446    0.1272054662
#>  [10,] -0.770957652     0.74988551   -0.0936286625
#>  [11,] -1.097408637     0.50700916    0.1955226362
#>  [12,]  0.216804036     0.26406762    0.1474422767
#>  [13,] -0.472553052     0.33942898    0.0921264929
#>  [14,] -0.711413875     0.31968645    0.2993077808
#>  [15,]  0.278931336     0.11908503    0.7025123784
#>  [16,] -1.680996572     0.21538438    0.2865247758
#>  [17,]  0.034923199     0.45466853    0.3821059878
#>  [18,] -0.280490210     0.20845675    0.0500947461
#>  [19,]  1.475642596     0.40192994    0.0136060880
#>  [20,] -1.814054638     0.24674921    0.2690250230
#>  [21,]  0.038083508     0.38969747   -0.2145734551
#>  [22,]  0.378789881     0.39358756    0.2459068036
#>  [23,] -2.636596748     0.11491909    0.1116624693
#>  [24,] -1.447133842     0.30055871    0.1706793691
#>  [25,] -0.708203114     0.70664506   -0.0274119183
#>  [26,] -0.438211326     0.55738953    0.2471014244
#>  [27,]  0.808219519     0.16296926    0.3500593838
#>  [28,]  0.505894719     0.85138762    0.3606926006
#>  [29,] -1.222507489     0.30518068    0.4899290193
#>  [30,] -0.554653244     0.27859375    0.1921147958
#>  [31,] -0.370511216     0.31995910    0.5095993694
#>  [32,]  2.598221486     0.26111561    0.5159197474
#>  [33,] -2.401668603     0.51317378    0.0694247945
#>  [34,]  0.658325856     0.49580429    0.3690131395
#>  [35,]  0.261454382     0.93173515   -0.0410053022
#>  [36,] -0.353156775     1.06294451   -0.0878148764
#>  [37,]  0.164838756     0.24893963    0.2006146118
#>  [38,] -0.863844986     0.25082936    0.1428119237
#>  [39,]  0.548845110     0.25560025    0.2251950853
#>  [40,]  0.202911670     0.18868088    0.1346885085
#>  [41,]  0.293991518     0.13097729    0.4880339322
#>  [42,] -0.355220135     0.24304832    0.2961024934
#>  [43,]  1.173168254     0.17999638    0.6129406722
#>  [44,] -0.552777692     0.50062560    0.3271371010
#>  [45,] -0.988649786     0.39507983    0.2787228339
#>  [46,]  1.220611043     0.18360172    0.2330687287
#>  [47,]  1.467289672     0.79610396   -0.0423172403
#>  [48,]  0.886490881     0.25037448    0.1478153583
#>  [49,]  1.320006090     0.58283853    0.0515908860
#>  [50,] -0.678295754     0.38964960    0.3715482625
#>  [51,] -1.607617229     0.09925485    0.4071939056
#>  [52,]  1.655711343     0.59692398    0.2056142885
#>  [53,] -0.009527425     0.12678968    0.5497267255
#>  [54,]  0.976128485     0.22999903    0.1865988723
#>  [55,]  0.608351176     0.33557804    0.2710244430
#>  [56,] -0.282875270     0.17724273    0.6152150102
#>  [57,] -2.400537320     1.83689841   -0.0287697502
#>  [58,] -0.226512797     0.38078772    0.3940380833
#>  [59,] -0.540361175     0.52349709    0.2883917360
#>  [60,] -1.069434290     0.30774110    0.1568681144
#>  [61,] -0.123247861     0.45844689    0.2302569593
#>  [62,]  1.413553185     0.07888666    0.6610657807
#>  [63,] -0.213896640     0.46713869    0.3253258228
#>  [64,] -2.206746206     0.44345836    0.1330593237
#>  [65,] -0.435016102     0.43085829   -0.1660969215
#>  [66,] -0.830175175     0.81841786    0.0742379210
#>  [67,]  0.704577816     0.51327329    0.4332513071
#>  [68,] -1.881096239     0.23238251    0.2955608831
#>  [69,]  0.843283260     0.57558894    0.3271188491
#>  [70,]  0.538372123     0.61300912    0.2457736809
#>  [71,]  0.585443745     0.92654117    0.4181486485
#>  [72,] -1.051047273     0.21225357    0.2076502146
#>  [73,]  0.275939731     0.81126636    0.2749839155
#>  [74,]  0.822336284     0.14353161    0.4869669123
#>  [75,]  1.517665066     0.26503287    0.4508192953
#>  [76,] -0.298552782     0.28592359    0.6869173320
#>  [77,] -1.126444980     0.17901073    0.4054929179
#>  [78,]  1.513611640     1.11434973   -0.0081114523
#>  [79,] -1.316620641     0.33194117    0.0091208701
#>  [80,] -1.678510951     0.10160198    0.3536082842
#>  [81,]  0.449196076     0.22924573    0.4095902067
#>  [82,]  0.146453340     0.33799577    0.6232106712
#>  [83,]  1.812092704     0.45491528    0.0629663439
#>  [84,] -0.586964360     0.53581475    0.2708955928
#>  [85,] -1.836018005     0.37369639    0.4011315279
#>  [86,]  0.569819014     0.37927856    0.1356733677
#>  [87,]  0.803178900     0.27601664    0.4174030954
#>  [88,] -1.049276643     0.22677576    0.4148772861
#>  [89,]  1.201387280     0.40010617    0.1430392037
#>  [90,]  0.761635621     0.20064533    0.1444755424
#>  [91,] -0.393495562     0.39311436    0.1811395411
#>  [92,]  0.326901617     0.16613577    0.3400869205
#>  [93,] -0.637939788     0.23872045    0.6925648202
#>  [94,] -0.264145998     0.27075569    0.2953341001
#>  [95,] -1.925837806     0.36552198   -0.0732416807
#>  [96,] -0.862258272     0.35652849    0.2949490215
#>  [97,]  0.005071905     0.22354457    0.1333668865
#>  [98,]  1.131420150     0.42260699    0.3222653255
#>  [99,] -0.103163772     0.16942791    0.5606350462
#> [100,] -0.328430297     0.34360053    0.3555192732
#> [101,]  0.095924608     0.73061230    0.1585397593
#> [102,] -1.280257342     0.33116365    0.0297005724
#> [103,]  1.094569772     0.20175459    0.4910003380
#> [104,]  0.861730409     0.31175784    0.2116838130
#> [105,]  0.404971015     0.15816356    0.2189222651
#> [106,]  1.449802704     0.37018693   -0.1148518834
#> [107,] -0.365213606     0.30366714    0.5650857983
#> [108,]  0.349132841     0.43155341   -0.0339822873
#> [109,] -1.595594200     0.21152359    0.0119419584
#> [110,]  0.438140503     0.41454642    0.4744229901
#> [111,] -1.104180447     0.42494152    0.3493972770
#> [112,] -0.074911110     0.34723112    0.4211696191
#> [113,]  0.146851854     0.30018857    0.4833618572
#> [114,] -0.624217924     0.37623819   -0.0724094036
#> [115,] -0.361434204     0.89706036    0.2038096074
#> [116,] -1.129892193     0.30867707    0.0285024994
#> [117,]  0.536845877     0.19361473    0.5949804322
#> [118,] -0.587858323     0.67847304    0.3338691908
#> [119,] -1.180711413     0.06992428    0.8004659482
#> [120,]  0.128111781     0.41670316    0.0061324105
#> [121,]  1.359296698     0.48911418    0.3572021398
#> [122,]  1.882973648     0.36937271    0.3783580127
#> [123,]  0.527195720     0.43432483    0.0536783353
#> [124,]  1.642616374     0.25643956    0.2459253771
#> [125,] -0.618364012     0.25019950    0.4205577042
#> [126,] -0.426987201     0.47554580    0.1765639935
#> [127,]  0.083115953     0.20980954    0.3603783653
#> [128,]  0.620395377     0.21929967    0.3552080094
#> [129,] -0.912396601     0.44673325   -0.1500344264
#> [130,] -0.471755100     0.61071261    0.1441149708
#> [131,] -0.347430299     0.43117553   -0.0006354884
#> [132,]  0.376411053     0.20972459    0.1653168710
#> [133,] -2.594214992     0.23505154    0.6009587556
#> [134,]  0.429933775     0.74540876    0.3905340502
#> [135,]  2.209750331     0.13611418    0.3823583662
#> [136,]  1.605480953     0.41212454    0.3319560980
#> [137,]  0.219986835     0.18713411    0.4516187646
#> [138,] -1.256197125     0.24807088    0.1716549949
#> [139,]  1.209605081     0.30462521    0.5419632462
#> [140,] -0.166699401     0.43540666    0.2682630175
#> [141,]  0.156606631     0.68097104   -0.1063896595
#> [142,] -0.464947503     0.10165329    0.5657825597
#> [143,] -0.615733629     0.47392577    0.4390817122
#> [144,]  0.539571336     0.34187912   -0.0030412305
#> [145,]  0.485323337     0.17995650    0.1805292463
#> [146,]  0.540590522     0.52466884    0.2413573397
#> [147,] -0.960717864     0.30011124    0.2773588408
#> [148,]  0.885422954     0.10456308    0.3946239229
#> [149,]  1.335419036     0.16806215    0.3781854844
#> [150,]  0.387249263     0.52393835    0.0553624242
#> [151,] -0.942733420     0.46394525    0.0705724845
#> [152,] -1.416623391     0.11657361    0.4253209080
#> [153,] -0.562178560     0.27119082    0.6253414408
#> [154,] -1.607639920     0.41312407    0.3586235293
#> [155,]  0.289083724     0.26129948    0.1421255805
#> [156,] -1.874895642     0.58273857    0.3809612895
#> [157,] -0.709672603     0.18527586    0.2228398790
#> [158,] -0.511792085     0.53114968   -0.1448995175
#> [159,] -0.388006353     0.39453210    0.1759193316
#> [160,] -1.096121159     0.31589386    0.2117504635
#> [161,] -1.410462777     0.46727949    0.0980455568
#> [162,]  0.849967964     0.69903883   -0.1625374484
#> [163,] -0.715598585     0.21766821    0.2944180083
#> [164,]  0.789408703     0.61571370    0.2995901361
#> [165,]  1.057743659     0.21581688    0.0912524140
#> [166,] -1.496902266     0.25800087    0.3040098622
#> [167,] -0.385775837     0.25777291    0.2275936318
#> [168,]  0.503273342     0.22815594    0.0231374540
#> [169,] -0.468360186     0.34677331    0.2879697514
#> [170,]  1.198643388     1.22437969    0.1737449959
#> [171,]  1.348760049     0.30098886    0.3375922608
#> [172,] -1.092815163     0.78738780    0.0711066816
#> [173,] -0.936820203     0.26419023    0.2269062922
#> [174,] -0.081857862     0.19695077    0.0932582101
#> [175,] -1.326127333     0.95927229   -0.0055349332
#> [176,] -0.851690480     0.13279011    0.3462875863
#> [177,]  0.347109886     0.50550817    0.1467044351
#> [178,]  0.293319785     0.51456626    0.2308483583
#> [179,]  1.018864340     0.04795191    0.3604329738
#> [180,]  0.046258435     0.12712321    0.3881571904
#> [181,] -0.568408171     0.17313868    0.6379460698
#> [182,] -0.126553227     0.10652734    0.7978721630
#> [183,] -0.087384586     0.30790991    0.1441068113
#> [184,] -1.563958222     0.14338657    0.1492256953
#> [185,]  0.269935192     0.52598836    0.4053566499
#> [186,] -1.143247263     0.40118368    0.0238653521
#> [187,]  1.325786071     0.40409500    0.1616748999
#> [188,] -0.720359675     0.20023726    0.4138762224
#> [189,] -0.526312144     0.55519569    0.1940398419
#> [190,] -0.832345974     0.70891145    0.1286097195
#> [191,] -0.232329865     0.62773176    0.4766503729
#> [192,] -1.709279422     0.18896836    0.5055634368
#> [193,]  1.597785984     0.29754728    0.2819120876
#> [194,]  0.539792757     0.31679826    0.1504973986
#> [195,]  1.200621954     0.55409607    0.2005430826
#> [196,]  0.685846463     0.12004922    0.1322838507
#> [197,] -0.592353106     0.35782144    0.1694623011
#> [198,] -0.564953802     0.18057835    0.5136468330
#> [199,] -0.408656918     0.46128825    0.1560436160
#> [200,]  0.317919804     0.85629042    0.1390757655
#> [201,]  1.268774605     0.06726769    0.4895755381
#> [202,]  0.016360117     0.37855396    0.3428949045
#> [203,]  0.223134384     0.62007085    0.3008443718
#> [204,]  1.546856139     0.57437577    0.1092624160
#> [205,]  0.026213016     0.15870097    0.3312633758
#> [206,]  0.561982271     0.39367346    0.1536009135
#> [207,] -1.778593640     0.40579068    0.1705971141
#> [208,]  0.620504921     0.26252979    0.2018529128
#> [209,]  1.740462203     0.33861100    0.5924553702
#> [210,] -1.155213407     0.14079842    0.3441050286
#> [211,] -0.245850412     0.41351483    0.1375475660
#> [212,]  0.130920017     0.17954556    0.3539774386
#> [213,] -0.309503847     0.49041741    0.0747815766
#> [214,] -0.242984978     0.33916652    0.3744656759
#> [215,] -0.907533382     0.28389565    0.2381657873
#> [216,]  1.360483526     0.15791212    0.5877026399
#> [217,]  1.138813661     0.58626465    0.2023300174
#> [218,] -0.369037484     0.64096128    0.1749570071
#> [219,]  1.573512907     0.38871866    0.1108228111
#> [220,] -1.928189490     0.35834253    0.4154903122
#> [221,]  1.675916613     1.18670005    0.1127619656
#> [222,] -1.269376381     0.21317134    0.1959285113
#> [223,] -0.563903356     0.38625222    0.1629117460
#> [224,]  1.298908477     0.34557850    0.0737691403
#> [225,] -0.036893812     0.42248667    0.0589070786
#> [226,] -0.095554332     0.26024995    0.4184188539
#> [227,] -0.903697382     0.52593862    0.3817709208
#> [228,] -0.345798813     0.30503128    0.1399239122
#> [229,] -2.217226492     0.36661481    0.2607339672
#> [230,] -1.365470096     0.28573429    0.6115914682
#> [231,] -0.460395556     0.30338465    0.4627609465
#> [232,] -0.413072692     0.38376203    0.4076918755
#> [233,]  0.275478323     0.38170707   -0.2669447463
#> [234,] -0.016136046     0.17724822    0.5161808561
#> [235,] -1.147488901     0.11819629    0.4436395268
#> [236,] -0.886591449     0.87962367    0.0144538502
#> [237,] -0.588264504     0.46796742    0.2153432612
#> [238,] -0.328902248     0.52582060    0.1737601136
#> [239,]  0.886548258     0.13996914    0.3408114326
#> [240,] -0.688792856     0.57805362    0.3164419346
#> [241,]  0.137632140     0.34400842    0.3245611105
#> [242,]  0.368174136     0.24350098    0.4572792637
#> [243,]  1.578342135     0.23456339    0.2278223628
#> [244,] -2.069089353     0.22736214    0.2444018871
#> [245,]  1.990446232     0.08426689    0.4736473150
#> [246,]  0.235061251     0.81052845   -0.0874861470
#> [247,]  0.074009264     0.35753340    0.1151411758
#> [248,] -1.185211243     0.49346226    0.3364926444
#> [249,] -0.711082256     0.41609411   -0.1321362105
#> [250,]  0.256708284     0.06911341    0.0989670494
#> [251,]  0.712762924     0.27080409    0.0309637193
#> [252,] -0.760826133     0.22948781    0.6375682454
#> [253,]  0.760415178     0.54656670    0.0615952878
#> [254,] -0.459911493     0.68907034   -0.0341262220
#> [255,]  0.144936202     0.55959715   -0.1829175581
#> [256,] -0.840018533     0.48087583    0.2879535708
#> [257,] -1.100900821     0.33787862    0.3194673202
#> [258,] -0.316636534     0.22993233    0.6470735259
#> [259,] -0.201295582     0.35584826   -0.0817343899
#> [260,] -0.414830295     0.65733609    0.4009144646
#> [261,] -2.400340039     0.12619125    0.6207894638
#> [262,]  1.428405361     0.10635474    0.1844981966
#> [263,] -1.131423822     0.67934504    0.2921149203
#> [264,] -1.436948387     0.32721222    0.3681692354
#> [265,]  1.499624271     0.48251466    0.2825705294
#> [266,] -0.962514821     0.14438067    0.3573330702
#> [267,] -1.400968521     0.12293987    0.5902194909
#> [268,] -2.169765584     0.55472451   -0.0842734051
#> [269,] -1.509639769     0.36107964    0.4509453912
#> [270,]  0.551242481     0.25394024    0.2593943197
#> [271,]  1.101910477     0.23409604    0.4062265901
#> [272,] -1.235922529     1.10281180   -0.1679916043
#> [273,] -1.925787344     0.28136438    0.4213112603
#> [274,]  2.091428838     0.28354705    0.0970194166
#> [275,] -1.663465175     0.80417381    0.1810478978
#> [276,]  0.415344107     0.59234547    0.2350529029
#> [277,] -1.970879762     0.31743891   -0.0033171758
#> [278,] -1.011085541     0.50852844    0.1903795695
#> [279,]  0.593217234     0.56142164   -0.0402055343
#> [280,]  0.771924791     0.45952841    0.1169243489
#> [281,] -0.080603976     0.35855566   -0.1305136057
#> [282,] -0.677792688     0.17558371    0.0301383064
#> [283,]  0.071142843     0.40205838    0.4666764239
#> [284,] -0.816197792     0.56658828    0.0830004809
#> [285,] -0.010250272     0.30182841   -0.0149689986
#> [286,]  0.006544054     0.67878319    0.3951593637
#> [287,] -0.590657705     0.51428911    0.3016494194
#> [288,]  0.192129272     0.30464117    0.5043960759
#> [289,]  0.645232491     0.30207111    0.5122290856
#> [290,] -2.726201234     0.25978197    0.0991252183
#> [291,]  0.255865973     0.16402244    0.3144438664
#> [292,] -1.550744425     0.22732273    0.1492405208
#> [293,]  0.269729869     0.19978703    0.8047533305
#> [294,]  1.078319440     0.36254818    0.0352276189
#> [295,] -2.046225300     0.17366326    0.2825260194
#> [296,]  1.027315337     0.12991365    0.5840793936
#> [297,]  0.122734332     0.46911409    0.1821583973
#> [298,]  0.760619871     0.20685310    0.5552861956
#> [299,]  0.300087784     0.55618383    0.0363933692
#> [300,] -1.533038101     0.51394490    0.2863257668
#> 
#> $acov_order
#> [1] 0
#> 
#> $acor_order
#> [1] 1
#> 
#> $N
#> [1] 300
#> 
#> $S
#> [1] 50
#> 
#> $R
#> [1] 50
#>