The HPJ bias-corrected empirical CDF estimation
hpjecdf.Rd
The `hpjecdf()` function enables to implement the HPJ 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")`.
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::hpjecdf(data = data, R = 50)
#> $mean
#>
#> $acov
#>
#> $acor
#>
#> $mean_func
#> function (x)
#> {
#> hpjecdfest1(x = x, X = mean_est, X1 = mean_est1, X2 = mean_est2)
#> }
#> <bytecode: 0x563088609f28>
#> <environment: 0x563088616270>
#>
#> $acov_func
#> function (x)
#> {
#> hpjecdfest1(x = x, X = acov_est, X1 = acov_est1, X2 = acov_est2)
#> }
#> <bytecode: 0x563088609b38>
#> <environment: 0x563088616270>
#>
#> $acor_func
#> function (x)
#> {
#> hpjecdfest1(x = x, X = acor_est, X1 = acor_est1, X2 = acor_est2)
#> }
#> <bytecode: 0x563088609748>
#> <environment: 0x563088616270>
#>
#> $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: 0x563087a7d4f8>
#>
#> $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: 0x563087a83b18>
#>
#> $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: 0x563087a86298>
#>
#> $quantity
#> mean autocovariance autocorrelation
#> [1,] 0.670151851 0.62190356 0.295048326
#> [2,] -0.220357361 0.45877499 0.015320090
#> [3,] 2.551064893 0.33135677 -0.050968445
#> [4,] 0.053262408 0.14901101 0.353207379
#> [5,] -1.125825698 0.23447472 0.392072594
#> [6,] -0.056269748 0.23410135 0.172811030
#> [7,] -0.458183647 0.27638439 0.701030077
#> [8,] -0.708414842 0.19284746 0.122633313
#> [9,] -1.413967331 0.17688468 0.726335330
#> [10,] 0.285922926 1.09952522 -0.175517872
#> [11,] -0.915341972 0.28325212 0.213450079
#> [12,] 0.338650205 0.28644634 0.184127826
#> [13,] -0.274572770 0.22095737 0.118120543
#> [14,] 0.627042590 0.28660454 0.265621260
#> [15,] 0.447703709 0.19404118 0.435368371
#> [16,] -1.226195638 0.37452987 0.067382438
#> [17,] -1.802384085 0.58940881 -0.013212842
#> [18,] 1.511325056 1.06629772 0.068332120
#> [19,] 0.596399990 0.31224862 0.077442903
#> [20,] 2.317594313 0.64678877 0.128192722
#> [21,] -0.313491555 0.17068442 0.377767188
#> [22,] 0.044252242 0.79076091 -0.022737844
#> [23,] -0.180478611 0.44665334 0.272610355
#> [24,] -0.170521189 0.14323712 0.770004075
#> [25,] -1.080928743 0.46805280 0.057383565
#> [26,] 0.528571403 0.61220769 0.111459277
#> [27,] -1.834712332 0.12419626 0.291113992
#> [28,] 0.498783245 0.43305071 -0.031221525
#> [29,] -0.763056704 0.19112054 0.339314040
#> [30,] 2.479643467 0.11628637 0.026035602
#> [31,] 0.072272246 0.24281903 0.179276860
#> [32,] 0.722641501 1.02990926 0.029263682
#> [33,] 0.786250934 0.23010311 0.409880383
#> [34,] -1.111122729 0.38711188 0.199682260
#> [35,] 0.807595108 0.29566603 0.189504729
#> [36,] -1.103930844 0.38751037 -0.040769674
#> [37,] -0.580456851 0.46551631 0.125101151
#> [38,] 0.672963330 0.79315347 0.121146907
#> [39,] -0.758338667 0.21360441 0.594169826
#> [40,] 1.581086312 0.32891673 0.051489285
#> [41,] -1.269140639 0.15422969 0.496011229
#> [42,] 0.485787551 0.10543760 0.188295653
#> [43,] 1.512528708 0.30450607 0.248212510
#> [44,] 0.153803257 0.51678535 0.283491824
#> [45,] 0.403599848 0.76898622 0.079121565
#> [46,] 0.565330036 0.27374445 0.373462217
#> [47,] -0.997568647 0.36324796 0.227365944
#> [48,] -0.814048788 0.21098455 0.111839379
#> [49,] -0.612503877 0.61138045 -0.179345916
#> [50,] -0.234190106 0.30380939 0.600473628
#> [51,] -0.163108356 0.14931121 0.454133292
#> [52,] 0.951293677 0.16516478 0.171117070
#> [53,] -1.173967367 0.26742922 0.138203065
#> [54,] 1.032364536 0.42041977 -0.111823655
#> [55,] 1.338002536 0.44532390 -0.132693397
#> [56,] -0.498366867 0.55383650 0.130391529
#> [57,] -0.545969707 0.55371712 0.365224598
#> [58,] -1.496625646 0.17057646 -0.060423632
#> [59,] 0.044932452 0.29140694 0.548738545
#> [60,] -0.248981075 0.20389201 -0.043021300
#> [61,] -0.855657294 0.13953905 0.079425656
#> [62,] -0.022814426 0.88625115 0.237431477
#> [63,] -0.277945107 0.32472338 0.244735415
#> [64,] 0.203186120 0.46956158 0.060096438
#> [65,] -0.429319105 0.32238616 0.045085536
#> [66,] 0.499977162 0.33293912 0.290553438
#> [67,] -1.186573897 0.46339512 0.261965101
#> [68,] -0.654697195 0.50165747 0.025805293
#> [69,] 0.565862265 0.22135831 0.195323932
#> [70,] 0.003799783 0.19855462 0.166413240
#> [71,] 1.088200473 0.40502401 0.058675325
#> [72,] -0.768744327 0.26802165 0.298967844
#> [73,] 0.438522253 0.25098497 0.263674040
#> [74,] 0.772849716 0.07285505 0.561277610
#> [75,] -1.863273703 0.20090704 0.481397263
#> [76,] 1.628141555 0.13264613 0.607701266
#> [77,] -1.714028955 0.18310912 0.091155232
#> [78,] -2.488576293 0.23767322 0.454627689
#> [79,] 0.845511000 0.81574472 0.497751291
#> [80,] -0.664897395 0.10119808 0.152130774
#> [81,] -0.068592551 0.28131825 0.322160778
#> [82,] -0.783663635 0.35203494 0.335127300
#> [83,] 0.857849929 0.08069482 0.501363998
#> [84,] -0.874039700 0.19091116 0.468878963
#> [85,] 1.210541837 0.31264764 0.232669482
#> [86,] 0.222370067 0.15223112 0.151231265
#> [87,] -0.275237601 0.23130382 0.187444344
#> [88,] 0.856664970 1.22833753 -0.171568057
#> [89,] -0.166052288 0.28291551 0.218455846
#> [90,] 0.823425303 0.13914227 0.460275738
#> [91,] -0.873080770 0.80474670 0.091203428
#> [92,] 2.103436257 0.27395998 0.693748845
#> [93,] -1.078970532 0.29950998 0.201194228
#> [94,] 0.286774361 0.43874973 0.320630326
#> [95,] 0.165502231 0.32774631 0.213252950
#> [96,] -0.858588998 0.50776930 0.258036884
#> [97,] 0.181156422 0.41456589 0.278873156
#> [98,] -1.298578233 0.43251053 0.065565454
#> [99,] 0.445714215 0.17960640 0.173641073
#> [100,] 1.951610591 0.59271093 0.051951337
#> [101,] -0.509757893 0.43511639 0.216039216
#> [102,] 1.412639538 0.07575733 0.110719830
#> [103,] -0.172625396 0.71835815 0.132675685
#> [104,] -0.107093978 0.17648000 0.377488193
#> [105,] 0.840592888 0.22832379 0.442386450
#> [106,] 0.497730774 0.28334651 0.089252680
#> [107,] -2.151598764 0.27485748 0.381207613
#> [108,] 0.479332809 0.32947382 -0.009511300
#> [109,] 1.311182697 0.19030272 0.284186254
#> [110,] -2.436823451 0.25373671 0.003771477
#> [111,] -0.765835602 0.16806139 0.387221033
#> [112,] -0.005583225 0.17881335 0.417101894
#> [113,] 0.099740877 0.46222428 0.505203713
#> [114,] -0.717445175 0.40097930 0.519974662
#> [115,] 0.714359152 0.45477755 0.325203798
#> [116,] 1.919453497 0.27696592 0.314897121
#> [117,] -1.108196540 0.20181373 0.115256891
#> [118,] 0.289261547 0.28810882 0.434085420
#> [119,] -1.982738460 0.86466668 -0.020227977
#> [120,] -0.055006516 0.55062870 0.105852103
#> [121,] -0.248389862 0.10711502 0.242477314
#> [122,] 0.017580558 0.46941400 0.049603968
#> [123,] 2.222967112 0.22781328 0.141921189
#> [124,] 0.009008831 0.07480488 0.581192345
#> [125,] -0.605361805 0.33460295 0.138241856
#> [126,] -1.718629710 0.11416724 0.141067319
#> [127,] -0.306240157 0.32742607 0.288853468
#> [128,] 0.073730496 0.64901268 0.337204479
#> [129,] -0.548670947 0.32520488 0.240515305
#> [130,] -1.062168333 0.36680460 0.101572580
#> [131,] -0.370252778 0.26701200 0.525681936
#> [132,] 0.478483688 0.19115136 0.413939248
#> [133,] 0.379693651 0.54907001 0.233750018
#> [134,] 1.307128746 0.05736282 0.479612239
#> [135,] 1.312136085 0.55912895 -0.006157101
#> [136,] -0.097877836 0.28478799 0.085038677
#> [137,] -0.149591077 0.27945439 0.198620028
#> [138,] -0.787890748 0.58478373 0.425154332
#> [139,] -1.335399806 0.23152048 -0.119182592
#> [140,] -1.453053003 0.23408288 -0.071323305
#> [141,] -0.443373980 0.35486604 0.402693194
#> [142,] 0.668661590 0.60342068 0.334520768
#> [143,] -0.514908993 0.15380415 0.239957628
#> [144,] 0.126568591 0.14625604 0.469361048
#> [145,] 0.327282339 0.13951251 0.517616469
#> [146,] -0.469805708 0.26660084 0.621429812
#> [147,] -0.050437363 0.46525568 0.234089541
#> [148,] -0.858335474 0.19562783 0.441784124
#> [149,] -0.002068417 0.47690621 0.115755918
#> [150,] -0.317274981 0.49447804 0.253646764
#> [151,] -0.383759498 0.38635032 0.126223923
#> [152,] -0.101650159 0.39231164 0.306746492
#> [153,] 0.080094465 0.34964755 0.095945090
#> [154,] 0.173119803 0.07315794 0.296398700
#> [155,] -0.435481567 0.36053009 -0.078794006
#> [156,] -0.313373092 0.11801138 0.193378223
#> [157,] -0.796566528 0.13716722 0.478071594
#> [158,] -2.405619698 0.41229126 -0.055708235
#> [159,] -0.051062098 0.83619405 0.264975341
#> [160,] 0.730233573 1.45210140 0.091980621
#> [161,] -1.631458492 0.32292468 0.293689208
#> [162,] -0.896316248 0.58251633 0.012380186
#> [163,] 1.106667736 0.05899766 0.558185960
#> [164,] 0.588270563 0.25073932 0.366262454
#> [165,] 0.286870875 0.50069559 0.139855287
#> [166,] 0.025158199 0.31090114 0.350494292
#> [167,] 1.897919373 0.55098010 -0.003000556
#> [168,] -0.634942600 0.23548723 0.134811054
#> [169,] 1.230325836 0.21743223 0.129891449
#> [170,] -2.125207658 0.14574816 0.618434445
#> [171,] -0.253316912 0.23597342 0.242018033
#> [172,] -0.739906084 0.34988613 -0.013472473
#> [173,] 1.102624108 0.19707855 0.379959109
#> [174,] 1.344195353 0.49706610 0.260145612
#> [175,] -0.167896673 0.16453589 0.354094699
#> [176,] 1.198236271 0.11574303 0.394776257
#> [177,] 0.242949047 0.63754376 0.196855826
#> [178,] 0.009860083 0.14949995 0.378110606
#> [179,] 0.508197616 0.18219383 0.382691494
#> [180,] 1.475665077 0.24597112 0.030078982
#> [181,] -0.708572352 0.20708895 0.014427369
#> [182,] 0.327320017 0.30837289 0.337958337
#> [183,] -0.290968495 0.39511110 0.447667819
#> [184,] -0.141002636 0.32120466 0.454315235
#> [185,] 0.200539237 0.49912476 0.331239068
#> [186,] 1.594284622 0.29756293 0.471955130
#> [187,] 0.042473748 0.14998148 0.334259883
#> [188,] -0.795929649 0.18325514 0.328239897
#> [189,] 0.165562628 1.11376392 0.280578633
#> [190,] -1.078373763 0.22971940 0.390561868
#> [191,] 1.785989391 0.12626912 0.568926101
#> [192,] -2.096067778 0.33770501 0.094635234
#> [193,] -1.508908038 0.06658688 0.513217809
#> [194,] -1.892239134 0.31184611 0.074625822
#> [195,] -0.617064204 0.18908645 0.303603745
#> [196,] -0.892857151 0.22873137 0.548040920
#> [197,] 0.593313162 0.20382381 0.275204761
#> [198,] -0.147557450 0.31962268 0.325801753
#> [199,] 1.589413691 0.34236043 0.042243124
#> [200,] -1.853065718 0.13162239 0.066254828
#> [201,] -0.061191917 0.14324459 0.286749819
#> [202,] 0.150244241 0.49445626 0.200535582
#> [203,] 0.642877080 0.18997750 0.582530157
#> [204,] -0.870582274 0.21552193 0.080576239
#> [205,] -1.632682330 0.33681364 0.168841316
#> [206,] 0.377537874 0.29571544 0.143732603
#> [207,] 0.279086531 0.41152623 0.259716633
#> [208,] -0.944363417 0.17876160 0.626870779
#> [209,] 1.033372543 0.17281084 0.321087348
#> [210,] 0.972042604 0.33304880 0.147088546
#> [211,] 0.800180700 0.32596517 0.167686641
#> [212,] -0.406868782 0.67686459 0.310897270
#> [213,] -0.635233798 0.16201076 0.646777072
#> [214,] 1.372030916 0.10420869 0.375659550
#> [215,] -1.081681591 0.38548082 0.106388517
#> [216,] -0.399600540 0.31154996 0.257301469
#> [217,] 0.834141845 0.46897882 0.622286577
#> [218,] 0.969397834 0.10855274 0.456761502
#> [219,] 0.143996020 0.35215253 0.137381696
#> [220,] -0.189494836 0.18525293 0.148201176
#> [221,] 0.268327105 0.24020096 0.244941234
#> [222,] -0.222229395 0.25719750 0.153688268
#> [223,] -1.825048667 0.30622440 0.173705830
#> [224,] 1.402707737 0.22412576 0.304822985
#> [225,] 0.593893369 0.95160670 0.073452155
#> [226,] -0.613947143 0.70598636 0.463510899
#> [227,] 0.371243555 0.31362306 0.076687450
#> [228,] 3.138119158 0.26250773 0.251969788
#> [229,] 0.064256557 0.07844921 0.515672744
#> [230,] 1.208593547 0.20338172 0.244073231
#> [231,] -0.632192987 0.18102366 0.596367446
#> [232,] 1.037803076 0.25905681 0.124070596
#> [233,] -0.792421992 0.67607968 0.344866248
#> [234,] -0.966153368 0.24928350 0.382774590
#> [235,] -0.312455474 0.09995581 0.433102705
#> [236,] 1.584550870 0.33909525 0.008770473
#> [237,] -0.547718853 0.30999914 0.052358245
#> [238,] 0.871584969 0.16523888 0.362769785
#> [239,] -0.103062258 0.25405558 0.118345684
#> [240,] -0.790883896 0.60071597 0.101693507
#> [241,] -0.108865785 0.36040780 0.293883101
#> [242,] 0.378781011 0.18231168 0.331118848
#> [243,] -0.301134691 0.40760985 0.303785720
#> [244,] -0.474649200 0.54847780 0.504896787
#> [245,] 0.577533000 0.13504962 0.209448731
#> [246,] -0.690765155 0.25538913 0.500748434
#> [247,] 0.791214092 0.25942920 0.186626826
#> [248,] -0.094613428 0.41222037 0.055667918
#> [249,] 0.587106259 0.62311747 0.475714326
#> [250,] -0.664259094 0.09738410 0.277826446
#> [251,] 0.797625574 0.33356651 0.213975703
#> [252,] -0.499410101 0.33787296 0.448112094
#> [253,] 0.265776348 0.24838731 0.081381820
#> [254,] 0.890696741 0.56315621 0.117130090
#> [255,] 0.375185097 0.26145571 0.377473350
#> [256,] 0.890677586 0.67220628 0.324107663
#> [257,] 0.171305550 0.21642183 0.478389443
#> [258,] 1.359868639 0.10198571 0.430579899
#> [259,] 0.431232813 0.33761025 0.171803025
#> [260,] 0.079547836 0.72902654 0.454458735
#> [261,] -0.280312636 0.18859458 0.478848574
#> [262,] 0.024633181 0.11129751 0.596152033
#> [263,] 0.799203595 0.25398882 0.246363557
#> [264,] 0.464046612 0.52307584 -0.157446282
#> [265,] 0.250614754 0.23431378 0.314026299
#> [266,] 0.394010573 0.29866807 0.250233363
#> [267,] -0.955341931 0.50497931 0.505400974
#> [268,] -1.724197717 0.24106999 0.299552643
#> [269,] -0.029159519 0.61052063 0.022935251
#> [270,] 1.024875255 0.45413450 0.411314673
#> [271,] -0.359376499 0.51788341 -0.109327034
#> [272,] -0.200233867 0.24949586 0.400326444
#> [273,] -1.431634840 0.27266690 0.228829409
#> [274,] -1.535525934 0.27572900 0.069960780
#> [275,] -0.852347554 0.24711544 0.064609218
#> [276,] -0.341913033 0.34222771 0.389776015
#> [277,] 0.109003873 0.38332616 0.056315999
#> [278,] -0.822106701 0.93414436 0.252605396
#> [279,] -1.573524237 0.38553615 0.359725780
#> [280,] 2.787303591 0.45652256 0.015014898
#> [281,] 2.155672546 0.49765288 0.180422604
#> [282,] 2.516553041 0.11777438 0.390406895
#> [283,] -0.294647424 0.26382624 0.142163277
#> [284,] -1.125638993 0.18500389 0.522264891
#> [285,] 0.641997704 0.16389272 0.811978738
#> [286,] -0.088585357 0.31770439 0.074112198
#> [287,] -0.084604127 0.79246055 0.409171378
#> [288,] -0.665813501 0.15521820 0.426521249
#> [289,] 0.613120576 0.58249769 -0.061929186
#> [290,] 0.223399103 0.26559517 0.372763450
#> [291,] 2.014057797 0.21180153 0.284761201
#> [292,] 2.333095603 0.49683745 0.334039642
#> [293,] 0.652151447 0.22583286 -0.062058487
#> [294,] -0.459255967 0.45545739 0.158394368
#> [295,] -0.832207028 0.16312826 -0.053234319
#> [296,] 0.520827207 0.16505885 0.355082166
#> [297,] 0.228182174 0.12614649 0.635351190
#> [298,] 1.238899667 0.17491541 0.285703785
#> [299,] 0.609274697 0.24068769 0.247725302
#> [300,] 0.176964297 0.44888481 -0.092939453
#>
#> $acov_order
#> [1] 0
#>
#> $acor_order
#> [1] 1
#>
#> $N
#> [1] 300
#>
#> $S
#> [1] 50
#>
#> $R
#> [1] 50
#>