Skip to contents

The `tojecdf()` function enables to implement the TOJ bias-corrected 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

tojecdf(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::tojecdf(data = data, R = 50)
#> $mean

#> 
#> $acov

#> 
#> $acor

#> 
#> $mean_func
#> function (x) 
#> {
#>     tojecdfest2(x = x, X = mean_est, X21 = mean_est21, X22 = mean_est22, 
#>         X31 = mean_est31, X32 = mean_est32, X33 = mean_est33, 
#>         X34 = mean_est34, X35 = mean_est35, X36 = mean_est36, 
#>         X37 = mean_est37, X38 = mean_est38, X39 = mean_est39)
#> }
#> <bytecode: 0x563093f95868>
#> <environment: 0x563093f1c238>
#> 
#> $acov_func
#> function (x) 
#> {
#>     tojecdfest2(x = x, X = acov_est, X21 = acov_est21, X22 = acov_est22, 
#>         X31 = acov_est31, X32 = acov_est32, X33 = acov_est33, 
#>         X34 = acov_est34, X35 = acov_est35, X36 = acov_est36, 
#>         X37 = acov_est37, X38 = acov_est38, X39 = acov_est39)
#> }
#> <bytecode: 0x563093f96240>
#> <environment: 0x563093f1c238>
#> 
#> $acor_func
#> function (x) 
#> {
#>     tojecdfest2(x = x, X = acor_est, X21 = acor_est21, X22 = acor_est22, 
#>         X31 = acor_est31, X32 = acor_est32, X33 = acor_est33, 
#>         X34 = acor_est34, X35 = acor_est35, X36 = acor_est36, 
#>         X37 = acor_est37, X38 = acor_est38, X39 = acor_est39)
#> }
#> <bytecode: 0x563093f96c18>
#> <environment: 0x563093f1c238>
#> 
#> $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: 0x563094f3f188>
#> 
#> $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: 0x563096829338>
#> 
#> $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: 0x56309606c828>
#> 
#> $quantity
#>                 mean autocovariance autocorrelation
#>   [1,] -0.9262876406     0.34939475     0.175608385
#>   [2,]  0.6763047731     1.39351890     0.496323392
#>   [3,]  2.1526114807     0.23782987     0.310848296
#>   [4,] -0.5321177959     0.28972250     0.159517560
#>   [5,]  0.9536379941     0.25264020     0.555010191
#>   [6,] -0.3712116519     0.41950023     0.270310077
#>   [7,] -0.8118713916     0.14972202     0.241391904
#>   [8,]  0.7144362126     0.35440253     0.126982452
#>   [9,] -0.7158457846     0.39985078     0.307067717
#>  [10,]  1.8074632502     0.85973909     0.096610271
#>  [11,]  0.3243361785     0.15470235     0.137868715
#>  [12,]  0.1074939205     0.20132438     0.555798468
#>  [13,] -1.2326732823     0.79423391    -0.137612763
#>  [14,]  0.0499597515     0.52088670     0.293977746
#>  [15,]  0.1270539232     0.21610127     0.354471217
#>  [16,] -0.3885392174     0.16682043     0.461837618
#>  [17,]  0.7492399312     0.32251245     0.060451914
#>  [18,]  0.7594942040     0.33946285     0.402508676
#>  [19,]  0.6519905139     0.78401784     0.292622213
#>  [20,]  0.3076956367     0.17135224     0.597366701
#>  [21,] -1.8881869825     0.29260038     0.369363623
#>  [22,]  1.0753792189     0.56739576     0.237122943
#>  [23,]  1.1709788465     0.58522289     0.006751810
#>  [24,] -1.0154256472     0.37252289     0.284925747
#>  [25,] -1.0575506194     0.28289278     0.324137036
#>  [26,]  0.8856601236     0.31764815     0.112962216
#>  [27,] -0.5376299292     0.40305814     0.260151872
#>  [28,]  0.8123313039     0.16010656     0.136267896
#>  [29,]  1.3164499429     0.33939818     0.065318628
#>  [30,]  0.1371489578     0.26391485     0.077726996
#>  [31,] -1.1824409583     0.27249165     0.355412407
#>  [32,] -0.0192766907     0.27515882     0.186488969
#>  [33,] -0.7360687398     0.29342458     0.338976601
#>  [34,]  0.6773015509     0.26791042     0.062184934
#>  [35,] -1.1225597134     0.38431777     0.243253099
#>  [36,] -0.3274688119     0.26067337     0.455926835
#>  [37,]  1.5884320388     0.24180951     0.050367810
#>  [38,]  1.0100830064     0.23639331     0.438169935
#>  [39,] -0.7236553852     0.04267870     0.897230235
#>  [40,] -0.9997598697     0.21450285     0.149043221
#>  [41,] -0.4485029475     0.26380921     0.425152716
#>  [42,] -0.3714713887     0.26473287     0.394740351
#>  [43,] -0.2914812007     0.19220330     0.449505800
#>  [44,] -0.8013376381     0.18815155     0.094440065
#>  [45,]  1.2374131685     0.29802090     0.184289207
#>  [46,]  1.5944563630     0.34642636     0.384026458
#>  [47,] -0.0018701215     0.39763437     0.338641956
#>  [48,] -0.2519835218     0.09746520     0.307358163
#>  [49,] -1.0729906889     0.23842549     0.370140897
#>  [50,]  0.4217091069     0.32343430     0.316953814
#>  [51,] -0.5165932762     0.03482342     0.589742731
#>  [52,]  0.1948331167     0.52053452     0.633705804
#>  [53,] -0.9981687255     0.32594182     0.080288290
#>  [54,] -0.4361260471     0.87083289     0.185870339
#>  [55,] -0.1817442934     0.18222120     0.469976638
#>  [56,] -0.7270635807     0.10288853     0.492439968
#>  [57,] -0.0458704124     0.16640302     0.178370157
#>  [58,]  0.7010152680     0.18295837     0.606570325
#>  [59,] -1.8485941287     0.18740246     0.302806786
#>  [60,] -1.4477913683     0.54915278     0.034814061
#>  [61,] -0.0267450182     0.48487892     0.003589912
#>  [62,] -0.0936822138     0.33403642     0.165917732
#>  [63,] -1.3319617495     0.07810282     0.566706149
#>  [64,] -1.7657162167     0.54211421     0.026852846
#>  [65,]  0.4760780565     0.37763692     0.127069376
#>  [66,] -0.7417764871     0.44800834     0.101037646
#>  [67,]  1.3958519255     0.15833040    -0.013673017
#>  [68,] -0.2343373024     0.45741260     0.030210529
#>  [69,] -0.2407424045     0.30009382     0.246988569
#>  [70,] -0.5661422285     1.27441913    -0.059547626
#>  [71,] -0.4814230680     0.27017040     0.782000070
#>  [72,] -0.4397049129     0.41333385     0.066250806
#>  [73,] -1.3267840267     0.55251275     0.464255674
#>  [74,]  0.1904150870     0.35389574     0.414981866
#>  [75,]  0.3279284170     1.23755652     0.434182913
#>  [76,] -0.1450008855     0.40745223     0.244145985
#>  [77,]  0.0818424784     0.52411871     0.071677603
#>  [78,]  0.9449225027     0.47586979     0.156948850
#>  [79,]  1.7780741885     0.36372488     0.179285730
#>  [80,] -1.1774964864     0.23342971     0.174335562
#>  [81,]  1.5241672955     0.14956032    -0.024865697
#>  [82,]  0.1099181492     0.31581846     0.290902426
#>  [83,] -1.1605477310     0.13345320     0.235882147
#>  [84,]  1.2854430994     0.66482067     0.284130832
#>  [85,] -0.0943346259     0.07531572     0.583282542
#>  [86,] -1.0502126363     0.15955808     0.303496292
#>  [87,] -0.1816898624     0.17121516     0.191738455
#>  [88,]  1.0264616838     0.30944498     0.016018233
#>  [89,]  0.0844908308     0.24057059     0.480298218
#>  [90,]  1.4919736922     0.22106549     0.196087292
#>  [91,] -0.7645942627     0.46253296     0.029357343
#>  [92,]  0.6526195157     0.53222689    -0.080292224
#>  [93,]  0.9774169592     0.34667264     0.341474094
#>  [94,] -1.2379232424     0.31280104     0.157470676
#>  [95,]  1.0248784461     0.34759156     0.328961082
#>  [96,] -0.3090776506     0.25841957     0.299462548
#>  [97,]  0.6630567165     0.37382460     0.489653996
#>  [98,] -2.4875160376     0.75254711     0.171478605
#>  [99,] -0.3622386033     0.21842478     0.463963412
#> [100,]  1.9959130476     0.30262456     0.298184694
#> [101,] -0.8651478142     0.64216417     0.355170147
#> [102,]  0.5268520509     0.22865363     0.131422862
#> [103,]  0.0333422495     0.18596112    -0.060741564
#> [104,] -1.3292843218     0.87100802     0.275688655
#> [105,] -1.0588720046     0.21649738     0.432269609
#> [106,] -2.5509932929     0.20903085     0.335967237
#> [107,]  0.1045999018     0.33606924     0.008873681
#> [108,]  0.3558491847     0.76326406     0.016810986
#> [109,] -0.9676579932     0.55007069    -0.058978131
#> [110,] -0.9441831189     0.47227979     0.099185438
#> [111,]  0.9404319795     0.22279069     0.223295566
#> [112,] -0.7688126336     0.22129979     0.280343595
#> [113,]  0.8440086676     0.29178557    -0.019156741
#> [114,]  0.6958518521     0.47730889     0.179948931
#> [115,]  0.3161501435     0.36555652     0.484311190
#> [116,] -0.7453987351     0.65666055     0.128865641
#> [117,]  0.5790067807     0.31432488     0.103444808
#> [118,]  0.0162995659     0.45467432     0.081457716
#> [119,]  1.2423398958     0.51714053     0.378895659
#> [120,] -1.7174198837     0.31277616     0.368548522
#> [121,] -0.7959449843     0.15805277     0.355426368
#> [122,]  0.0259122396     0.29401016    -0.091015406
#> [123,]  0.0841761839     0.68560096     0.055054025
#> [124,] -1.4666713020     0.44351451     0.081412036
#> [125,] -1.4641149380     0.17822861     0.555464624
#> [126,]  0.5519367916     0.57047840    -0.020155539
#> [127,]  0.4022648426     0.20673746     0.144312984
#> [128,]  1.2625437569     0.11152978     0.161461765
#> [129,] -0.1035825952     0.73318728     0.330155761
#> [130,]  0.5618760998     0.66890439     0.148266403
#> [131,]  0.2930950756     0.54943181    -0.136983998
#> [132,]  2.2698527771     0.20976323    -0.055958444
#> [133,]  0.1354894807     0.47662374     0.382801162
#> [134,] -0.5899333295     0.36832266     0.226654459
#> [135,] -2.0987309521     0.34138519     0.130499426
#> [136,] -0.1747866569     0.28035603     0.453040676
#> [137,]  0.9645061760     0.38385924     0.124359865
#> [138,]  0.5693808152     0.55538883     0.383101408
#> [139,]  0.1512246716     0.72584621     0.085489070
#> [140,]  1.5562646744     0.38002220     0.373305667
#> [141,]  0.2739045908     0.54909105     0.395949528
#> [142,]  0.3687534238     0.25399458     0.278176948
#> [143,] -0.3143135554     0.28373239     0.301857735
#> [144,] -0.9453876484     0.55959724    -0.089355110
#> [145,]  0.0288090892     0.25864412     0.504311174
#> [146,]  0.1635059466     0.11623414     0.390892515
#> [147,]  1.4775696431     0.30289440     0.301320775
#> [148,] -0.4318483321     0.15748257     0.062205526
#> [149,]  1.2513965795     0.56343861     0.358623966
#> [150,]  1.2342144498     0.28617146     0.250161805
#> [151,] -0.3256371311     0.27829933     0.014153946
#> [152,] -0.4597414432     0.32932992     0.540835265
#> [153,]  1.0628720999     0.48894754     0.604712172
#> [154,] -0.0585986583     0.21084362     0.617232903
#> [155,] -0.5134099239     0.31140947     0.493111234
#> [156,]  0.7535236061     0.38231972    -0.087220382
#> [157,]  0.0463121540     0.33676393     0.211591210
#> [158,]  0.9483691509     0.20047318     0.432762146
#> [159,] -0.4573830265     0.86312181     0.165759284
#> [160,]  0.9772943114     0.06849904     0.653481503
#> [161,] -1.5490702117     0.64065109     0.202715191
#> [162,]  1.2279704497     0.26100090    -0.049240714
#> [163,] -0.0750990635     0.32156600     0.205064718
#> [164,] -0.3357700599     0.30465261     0.370108872
#> [165,]  2.4659184795     0.43145489     0.285351956
#> [166,] -1.1471613096     0.22320227     0.396981832
#> [167,]  0.3320420041     0.26185449     0.366223981
#> [168,] -0.7397034764     0.92763428     0.223206088
#> [169,] -0.0019597700     0.45130520     0.101513891
#> [170,]  1.2456731032     0.47011026     0.278819635
#> [171,] -1.8942634846     0.27734651     0.357787094
#> [172,]  1.8324795828     0.23017158     0.155907824
#> [173,] -0.7999225300     0.12420137     0.194657263
#> [174,]  1.2228300595     0.17326470     0.247411673
#> [175,] -1.0309544441     0.49336782     0.135096518
#> [176,]  0.3183935148     0.54516398     0.369595111
#> [177,]  0.0563599022     0.29936856     0.434919265
#> [178,] -0.9065551192     0.38781215    -0.110343295
#> [179,]  1.2979967575     0.28148103     0.028430264
#> [180,]  1.0791584082     0.42209643     0.324169834
#> [181,]  1.2017339224     0.15949960     0.330895297
#> [182,]  0.1185586240     0.22434554    -0.010986766
#> [183,]  0.3648377548     0.25977611     0.617700162
#> [184,]  0.0748076479     0.25983640     0.021114088
#> [185,] -0.5337043324     0.23021568     0.409802195
#> [186,] -0.6537981762     0.31137134     0.102923917
#> [187,]  0.7812010520     0.53188030    -0.285751951
#> [188,] -0.3429014733     0.12022577     0.214461944
#> [189,]  1.0518359556     0.54103129     0.062334573
#> [190,] -1.5086616565     0.59464454     0.499303343
#> [191,] -0.3578514898     0.16235730     0.579216745
#> [192,] -2.0060984077     0.17903068     0.565536389
#> [193,] -0.1031194713     0.30902965    -0.012729927
#> [194,] -1.0008826617     0.26592410    -0.053305678
#> [195,]  0.3187296362     0.81100028     0.360144186
#> [196,]  1.0656950073     0.30501281    -0.089092846
#> [197,] -0.1333788984     0.27702375     0.112592867
#> [198,]  1.6689328395     0.16300573     0.207919955
#> [199,] -1.2748718286     0.14812634     0.367688910
#> [200,] -1.2800300587     0.01728024     0.832944825
#> [201,]  0.3658085895     0.27663372     0.282774009
#> [202,]  0.4367922969     0.30023928     0.480741965
#> [203,] -1.6988556271     0.42481819    -0.176622570
#> [204,]  0.0286379931     0.17996801     0.283398209
#> [205,] -1.3331250035     0.70758198     0.079336598
#> [206,] -0.4263091363     0.29924819     0.382781704
#> [207,] -1.4071750277     0.16096377     0.332487544
#> [208,]  1.2568542614     0.22463430     0.215421942
#> [209,]  0.2683114263     0.60500705     0.220398341
#> [210,] -0.6127582764     0.33804593    -0.190069685
#> [211,] -0.7244384166     0.19660963     0.394854968
#> [212,] -1.5772039898     0.16743123     0.315150992
#> [213,] -1.4033421970     0.02643180     0.320280441
#> [214,] -0.6722801163     0.34773113     0.466214485
#> [215,] -1.4695235421     0.77664344     0.070733936
#> [216,]  0.4490242631     0.24177386     0.195167596
#> [217,] -0.9390078397     0.33450180     0.409354266
#> [218,] -0.5381434848     0.31296590     0.200397287
#> [219,]  0.6989781293     0.47099901    -0.005887686
#> [220,]  1.2174099695     0.72801732    -0.033016586
#> [221,] -0.1173895208     0.42433062     0.110477727
#> [222,] -1.1951328200     0.62706932    -0.026326161
#> [223,] -0.3732926348     0.35126745     0.345039915
#> [224,]  0.8508219351     0.27615474     0.060417213
#> [225,]  0.0204326469     0.60354049    -0.131362423
#> [226,]  0.3494133194     0.20644389     0.097752285
#> [227,]  0.4901154979     0.17025763     0.403546889
#> [228,]  1.5621669861     0.26371075     0.050605124
#> [229,]  0.0840483019     0.19772963     0.183947552
#> [230,]  0.0219745611     0.08087418     0.588294183
#> [231,]  0.3216248767     0.33156821     0.147882742
#> [232,] -1.7055511791     0.41893370     0.139463793
#> [233,]  1.9172158728     0.40447393     0.294745737
#> [234,]  1.0960813555     0.48741823     0.037399294
#> [235,] -2.7937488619     0.38723779     0.153671579
#> [236,]  0.4724844843     0.08991652     0.324365113
#> [237,] -0.0007278013     0.18491455     0.220482201
#> [238,]  0.4285246743     0.21715556     0.367507041
#> [239,] -1.7782603364     0.46562788     0.203174307
#> [240,] -0.0826892621     0.34825127     0.112741347
#> [241,]  0.2039490610     0.62633242     0.144782428
#> [242,] -0.3833633955     0.13104109     0.414247415
#> [243,] -1.1063839112     0.19989802     0.417428643
#> [244,] -0.6010860078     0.28501154     0.213212137
#> [245,] -0.0433248205     0.21200870     0.271170495
#> [246,]  1.3920380488     0.19030770     0.499629925
#> [247,] -0.5462715611     0.20695822     0.303345353
#> [248,]  1.1509389143     0.22554267     0.824439031
#> [249,] -0.8729517978     0.26411481     0.404132986
#> [250,]  0.1363991102     0.41503758    -0.172980483
#> [251,] -1.4691152421     0.14919317     0.115168126
#> [252,] -0.3268303938     0.43863920     0.163164617
#> [253,]  0.6966470108     0.19125281     0.536399638
#> [254,] -0.6113589150     1.38027479     0.308922000
#> [255,] -0.8500891116     0.14487611     0.262248628
#> [256,] -0.6392116967     0.22726628     0.383114244
#> [257,] -0.2639417163     0.22185419     0.295118756
#> [258,] -0.6724657725     0.34960304     0.121138113
#> [259,]  1.3803811288     0.12974934     0.388751145
#> [260,]  1.0360568022     0.33338103     0.185184378
#> [261,] -0.5184057421     0.75793957    -0.152382991
#> [262,]  0.4226212485     0.13089832     0.245613855
#> [263,]  1.4087937623     0.49827429     0.348304675
#> [264,] -0.0047323996     0.40412962     0.447954706
#> [265,] -0.0113267160     0.18927138     0.609037569
#> [266,]  0.8526045155     0.29555096     0.333546033
#> [267,]  0.4262779125     0.53534169     0.241617322
#> [268,] -0.7303363619     0.59045043     0.138801981
#> [269,]  0.1854035272     1.07265036     0.177682034
#> [270,]  2.0067188764     0.18934085     0.350339466
#> [271,]  0.9704035278     0.23544612     0.309659568
#> [272,]  0.1261205995     0.21011327     0.357809028
#> [273,]  0.0795196358     0.49764667    -0.251295305
#> [274,]  0.1805632412     0.26525646    -0.024646876
#> [275,]  0.6793295926     0.98801476     0.128810518
#> [276,] -0.1214725225     0.41197426     0.094837181
#> [277,]  2.0254155512     0.55183397     0.182255400
#> [278,]  0.9961292352     0.19097195     0.202812586
#> [279,] -0.1893219774     0.19569833     0.278550065
#> [280,]  0.4533913799     0.41783680     0.153929999
#> [281,] -0.9318309609     0.20628593     0.069982834
#> [282,]  0.0813970810     0.25437928    -0.039271734
#> [283,]  0.3745327645     0.49543924    -0.092071263
#> [284,]  0.4411927314     0.28878086     0.179243709
#> [285,] -0.5904404686     0.25144024     0.589833347
#> [286,]  0.1713338986     0.23836997     0.216793223
#> [287,] -1.7994285719     0.34298694     0.355497161
#> [288,] -1.6750288305     0.23549500     0.603057791
#> [289,]  0.3004892597     0.32496583     0.517222257
#> [290,] -0.1188241950     0.26730139     0.343614799
#> [291,]  1.9813748793     0.16681295     0.247054618
#> [292,]  0.7525154042     0.32682287     0.027103186
#> [293,] -0.4222142087     0.16137883     0.189022517
#> [294,] -0.5592799816     0.22357827     0.321143588
#> [295,]  1.3124071411     0.72089443    -0.011273085
#> [296,]  0.9173614959     0.24903731     0.503800826
#> [297,] -0.2172807431     0.10527823     0.354925561
#> [298,]  0.7562787111     0.15926410     0.131209110
#> [299,] -0.0247364563     0.27770896     0.621668782
#> [300,] -1.4103920714     0.32317262     0.170914835
#> 
#> $acov_order
#> [1] 0
#> 
#> $acor_order
#> [1] 1
#> 
#> $N
#> [1] 300
#> 
#> $S
#> [1] 50
#> 
#> $R
#> [1] 50
#>