Skip to contents

The `hpjmoment()` function enables to implement the HPJ bias-corrected estimation of the moments 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

hpjmoment(data, acov_order = 0, acor_order = 1, R = 1000)

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.

Value

A list that contains the following elements.

estimate

A vector of the parameter estimates

se

A vector of the standard errors

ci

A matrix of the 95 percent confidence intervals

quantity

A matrix of the estimated heterogeneous quantities

acov_order

The order of autocovariance

acor_order

The order of autocovariance

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::hpjmoment(data = data)
#> $estimate
#>         E(mean)         E(acov)         E(acor)       var(mean)       var(acov) 
#>      0.09940194      0.36926029      0.28092487      1.09583883      0.03500338 
#>       var(acor) cor(mean, acov) cor(mean, acor) cor(acov, acor) 
#>      0.01856102      0.07564245      0.03085462     -0.41747452 
#> 
#> $se
#>         E(mean)         E(acov)         E(acor)       var(mean)       var(acov) 
#>     0.059396378     0.011754966     0.011987997     0.085545685     0.004415153 
#>       var(acor) cor(mean, acov) cor(mean, acor) cor(acov, acor) 
#>     0.003760836     0.056121769     0.072475245     0.061398448 
#> 
#> $ci
#>                 95% CI lower 95% CI upper
#> E(mean)          -0.01721770    0.2216830
#> E(acov)           0.34746933    0.3922490
#> E(acor)           0.25867967    0.3049867
#> var(mean)         0.92432404    1.2597706
#> var(acov)         0.02718950    0.0447497
#> var(acor)         0.01113975    0.0259475
#> cor(mean, acov)  -0.03195630    0.1907651
#> cor(mean, acor)  -0.10405633    0.1695519
#> cor(acov, acor)  -0.54112082   -0.2963990
#> 
#> $quantity
#>               mean autocovariance autocorrelation
#>   [1,] -1.26522148     0.36623478     0.069213608
#>   [2,]  0.73517956     0.51642541    -0.105782063
#>   [3,] -0.29687625     0.39777877     0.281125879
#>   [4,] -0.15930530     0.28011801     0.077102282
#>   [5,] -0.68627542     0.28757180     0.027208232
#>   [6,] -1.24720952     0.19070506     0.347300680
#>   [7,]  0.93409498     0.18368257     0.750339508
#>   [8,]  0.25368147     0.36739619     0.263348856
#>   [9,]  1.35727911     0.64982226     0.380282184
#>  [10,] -0.36255001     0.10248726     0.345142763
#>  [11,]  1.20121492     0.15856813     0.138360732
#>  [12,]  0.20815140     0.48313688     0.364511232
#>  [13,] -1.21137275     0.34608162     0.081889193
#>  [14,]  0.86491029     0.79380223    -0.050573966
#>  [15,] -0.44471806     0.23357343     0.524160556
#>  [16,]  1.86939274     0.25200454     0.330000544
#>  [17,]  1.55385602     0.23787968     0.240115125
#>  [18,] -0.27070921     0.40665790     0.456580007
#>  [19,] -1.36707854     0.24389098     0.463343247
#>  [20,] -0.01154721     0.35226795     0.489949510
#>  [21,]  0.46420104     0.55290665     0.208461611
#>  [22,]  2.03977858     0.39787896     0.121700035
#>  [23,] -0.38495479     0.40474565    -0.086368151
#>  [24,] -0.18911315     0.09464281     0.178704952
#>  [25,]  1.54072567     0.47006387     0.079698060
#>  [26,]  0.41780466     0.75782993     0.376418752
#>  [27,]  0.38502850     0.26771253     0.322365371
#>  [28,] -0.77396473     0.45846254     0.066613882
#>  [29,] -0.36866216     0.22930317     0.289762175
#>  [30,]  1.23586941     0.87604446     0.178226268
#>  [31,]  1.26038365     0.18709155     0.437489382
#>  [32,] -1.09998481     0.58899851    -0.129650334
#>  [33,] -0.44074781     0.23829233     0.411012207
#>  [34,] -0.52000154     0.16917626     0.254423344
#>  [35,] -0.50925893     0.56176506     0.147656055
#>  [36,]  0.50932078     0.31344534     0.250446968
#>  [37,] -0.16023782     0.61054399     0.269531598
#>  [38,]  0.61087025     0.51684292     0.202322103
#>  [39,] -1.55138864     0.43373837     0.383183074
#>  [40,] -0.38190418     0.53947554     0.083673900
#>  [41,]  1.63577818     0.19335780     0.422074503
#>  [42,]  0.99574317     0.25942092     0.004163398
#>  [43,]  0.64266352     0.30423101     0.065167352
#>  [44,]  0.50228930     0.18635048     0.288447257
#>  [45,] -0.98294524     0.35330408     0.066990924
#>  [46,]  0.76995439     0.34309695    -0.051600309
#>  [47,]  1.04186303     0.45863699     0.123575204
#>  [48,]  1.04762491     0.18366165     0.297361113
#>  [49,] -1.53695316     0.31041354     0.197515977
#>  [50,] -0.85657668     0.22026776     0.222212031
#>  [51,] -0.35346046     0.61062905     0.341494229
#>  [52,]  0.89052141     0.19775084     0.171070578
#>  [53,] -0.19952902     0.30751935    -0.016602313
#>  [54,] -1.01215849     0.18332656     0.276062862
#>  [55,] -0.21294002     0.32671530     0.349353085
#>  [56,] -0.63612345     0.50168879    -0.019686644
#>  [57,]  1.19565862     0.36778317     0.011880729
#>  [58,]  1.74822225     0.23824197     0.233527669
#>  [59,] -0.33266394     0.47701286    -0.097680976
#>  [60,]  1.49230232     0.61318884     0.136384288
#>  [61,]  0.53707698     0.15065805     0.310126534
#>  [62,]  0.89541611     0.58335517     0.404618788
#>  [63,] -0.34178850     0.27250513     0.205517292
#>  [64,] -0.27186560     0.13691871     0.295948727
#>  [65,]  0.76618785     0.59253669     0.209919156
#>  [66,] -0.67108633     0.11727797     0.343475601
#>  [67,]  0.28411504     0.34206369     0.511164642
#>  [68,]  1.40450072     0.28474386     0.577761128
#>  [69,]  0.76804116     1.04020342    -0.055449973
#>  [70,] -1.35774531     0.71174974     0.330993600
#>  [71,] -2.26241735     0.27277609     0.320346078
#>  [72,]  0.16121322     0.77098013     0.282299749
#>  [73,] -0.74191640     0.21448947     0.083028262
#>  [74,]  0.38728305     0.30756410    -0.004035052
#>  [75,]  1.25527586     1.00286361     0.148130754
#>  [76,]  2.70945330     0.14023465     0.316723487
#>  [77,]  0.13811545     0.34310877     0.090164521
#>  [78,] -1.04615647     0.20014230     0.030783734
#>  [79,] -0.25652598     0.48272564     0.053007061
#>  [80,] -0.44652863     0.65057468     0.132897342
#>  [81,] -2.29833992     0.36976717     0.547502065
#>  [82,]  0.32681503     0.20915995     0.669834910
#>  [83,] -0.44572230     0.39409866     0.464502413
#>  [84,] -2.01062086     0.48947154     0.370855233
#>  [85,]  0.40281277     0.69907147     0.036609984
#>  [86,]  0.29425599     0.39219392     0.498450797
#>  [87,]  0.98107865     0.12976914     0.514174460
#>  [88,]  0.73238098     0.42806868     0.186018240
#>  [89,] -0.93732584     0.08960648     0.160589480
#>  [90,]  2.44207754     0.26331297     0.300260372
#>  [91,]  0.09442029     0.28567987     0.368070631
#>  [92,]  0.21053658     0.15870822     0.548610327
#>  [93,]  2.08943317     0.34789305     0.183229685
#>  [94,]  0.11185190     0.20645928     0.619576193
#>  [95,]  1.24299013     0.07872115     0.468516248
#>  [96,] -0.24692901     0.30729492    -0.020567652
#>  [97,] -1.74994138     0.40338360     0.408227968
#>  [98,] -2.24255863     0.19782613     0.304851149
#>  [99,]  0.82284811     0.75890360     0.072174709
#> [100,] -0.66145411     0.25511353     0.047032329
#> [101,] -0.32615812     0.23552083     0.152281022
#> [102,] -0.51250841     0.10475092     0.368757227
#> [103,] -0.53376199     0.57489036     0.117458772
#> [104,]  0.63006291     0.99211102     0.067785947
#> [105,]  1.06213160     0.81259079     0.148753123
#> [106,]  1.12226133     0.17950382    -0.046667237
#> [107,] -0.24335748     0.20974329    -0.154660277
#> [108,] -1.64423370     0.25110663     0.258425732
#> [109,] -0.90410250     0.26664443     0.178588474
#> [110,] -0.17664184     0.13886637     0.313454351
#> [111,]  0.29726036     0.33895802     0.193889108
#> [112,]  1.52072063     0.56531521     0.073792227
#> [113,] -1.37847326     0.19783709     0.491715893
#> [114,]  1.10367425     0.38096730     0.037232375
#> [115,]  0.82072224     0.36102815     0.292491514
#> [116,]  1.14985783     0.11094976     0.038684485
#> [117,] -0.56351473     0.18911625     0.077765677
#> [118,]  0.48900454     0.11831585     0.274471035
#> [119,]  0.12739861     0.49678603     0.423960981
#> [120,]  1.02112906     0.30691615     0.368161532
#> [121,] -1.02469086     0.35442278     0.099080936
#> [122,] -2.34044126     0.27664068     0.542758570
#> [123,] -0.34658938     0.37893581    -0.146303245
#> [124,]  0.79792904     0.11253942    -0.074412776
#> [125,]  0.73450125     0.35690129     0.260700378
#> [126,]  1.30101967     0.24671762     0.105801640
#> [127,]  0.28762995     0.24244253     0.268321697
#> [128,]  0.93258042     0.54385915     0.215470215
#> [129,] -1.21939832     0.46293782     0.033935811
#> [130,]  0.51744190     0.61181759     0.321915864
#> [131,] -0.06900245     0.18814591     0.248903954
#> [132,]  0.27798411     0.49264959     0.150214021
#> [133,]  0.09407573     0.14000876     0.197676063
#> [134,] -0.91845804     0.47415096     0.317010289
#> [135,]  1.87490761     0.05704506     0.622795375
#> [136,] -1.14612779     0.34725075    -0.237455682
#> [137,] -0.56702103     0.13938875     0.260775112
#> [138,]  0.44542350     0.34265608    -0.096082060
#> [139,]  0.66529168     0.16891783     0.148691536
#> [140,] -0.85230505     0.16307008    -0.010386027
#> [141,]  0.07660187     0.12583364     0.564244608
#> [142,] -0.98690759     0.27692967     0.394062741
#> [143,]  0.89572496     0.45072293     0.498728588
#> [144,]  0.32524386     0.24505937     0.722034246
#> [145,]  0.15920694     0.69989608     0.307449639
#> [146,] -2.17671341     0.58715623     0.008274470
#> [147,] -1.41730080     0.25868418     0.315329969
#> [148,]  1.65787025     0.54072529     0.253183439
#> [149,]  1.29465021     0.29882188     0.528778876
#> [150,] -1.15963884     0.15586888     0.386407172
#> [151,]  1.57764518     0.78235878     0.195213221
#> [152,]  1.59153659     0.16051718     0.425244056
#> [153,] -1.27069647     0.31975038    -0.083730875
#> [154,]  2.16797223     0.38610437     0.542645185
#> [155,] -0.54483047     0.13156530     0.565621095
#> [156,]  0.01933745     0.40167307     0.210326423
#> [157,] -0.56956870     0.68181365     0.113684440
#> [158,]  2.02006885     0.69106008    -0.063623655
#> [159,]  1.50638467     0.33327505     0.073381239
#> [160,]  0.91669044     0.13981567     0.262751916
#> [161,]  3.08209356     0.23172848     0.513965201
#> [162,]  0.31260485     0.46543625     0.096949769
#> [163,]  0.06718945     0.51195898     0.294250540
#> [164,]  2.11360230     0.12634331     0.642841247
#> [165,] -0.66006042     0.32494408     0.351960006
#> [166,]  0.10173961     0.43409472     0.214062028
#> [167,]  2.13507921     0.43691286     0.272539784
#> [168,] -1.39769310     0.44469771     0.195930681
#> [169,]  1.17493713     0.15998715     0.112442503
#> [170,]  1.66326721     0.22239589     0.135802633
#> [171,]  1.48491827     0.37343324     0.414178118
#> [172,] -0.06389913     0.55354190     0.241303961
#> [173,] -0.77952617     0.47735772     0.260395988
#> [174,] -1.76347638     0.28270594    -0.058289507
#> [175,] -0.43757601     0.13943322     0.236444049
#> [176,] -0.35308217     0.09679629     0.328146672
#> [177,]  1.94335683     0.42334395     0.131623070
#> [178,] -0.99912264     0.29498502     0.318557705
#> [179,] -0.27766710     0.36696006     0.163550351
#> [180,]  0.70854845     0.05315931     0.340206103
#> [181,]  0.07663444     0.57414109     0.050369983
#> [182,]  0.92640703     0.35630600     0.021158211
#> [183,]  0.33090541     0.35695006     0.240001092
#> [184,] -0.40719696     0.47424335     0.387886647
#> [185,]  1.37398826     0.12241154     0.844438885
#> [186,] -1.36822159     0.18049069     0.198540258
#> [187,]  0.14945146     0.19601638     0.280146451
#> [188,] -1.69889881     0.22558392    -0.037430646
#> [189,] -1.03729673     0.37202206     0.049993511
#> [190,]  1.05495846     0.44169439     0.265422142
#> [191,]  0.76479510     0.39670710     0.122211819
#> [192,]  0.59765173     0.15447682     0.375545033
#> [193,] -0.25889009     0.19156714     0.437389852
#> [194,]  2.04714011     0.35160929     0.464415206
#> [195,] -0.53446941     0.22123538     0.384296534
#> [196,]  0.72457435     0.64547954     0.199619207
#> [197,] -1.75506639     0.12771338     0.157840972
#> [198,] -0.34617679     0.26196154    -0.145188390
#> [199,] -0.01233208     0.52256726     0.076140718
#> [200,]  0.70803098     0.47825680     0.342152230
#> [201,]  0.07980638     0.24188381     0.152751844
#> [202,] -0.45666289     0.42253939     0.239539418
#> [203,] -0.66042774     0.51472137     0.213676011
#> [204,]  0.22463101     0.31237333     0.490637422
#> [205,]  1.50398476     0.08805337     0.318865320
#> [206,] -0.93059348     0.28288775     0.396223163
#> [207,]  0.08960821     0.76183385     0.286566686
#> [208,] -0.50161791     0.23419635     0.448808323
#> [209,] -1.03453697     0.46116708    -0.091912120
#> [210,]  0.79646738     0.36600274     0.134036048
#> [211,] -1.43578378     0.53064476     0.644387761
#> [212,] -0.23315572     0.67170416    -0.070862671
#> [213,]  2.60074547     0.53226854     0.053371951
#> [214,] -1.85362736     0.13756753     0.491498956
#> [215,] -0.12778573     0.32461228     0.484140252
#> [216,] -0.71973397     0.42885017     0.538885077
#> [217,]  0.63404499     0.26195997     0.221983699
#> [218,]  1.16693598     0.22217062     0.464067866
#> [219,] -0.78965489     0.60689900     0.516048593
#> [220,] -0.98955868     0.32652857     0.004353589
#> [221,]  0.34758129     1.18266918     0.390996789
#> [222,] -1.82869558     0.53895367     0.050181971
#> [223,]  0.46729606     0.31059962    -0.030363833
#> [224,] -0.33365857     0.18334852     0.142167115
#> [225,] -0.03758142     0.21974264     0.419759835
#> [226,] -2.05799434     0.20185056     0.293906398
#> [227,] -1.14342640     0.60072031    -0.007181979
#> [228,] -0.54020612     0.36959552     0.245511394
#> [229,] -1.12765605     0.31998066     0.309664664
#> [230,]  0.54326657     0.20436812     0.174175977
#> [231,]  0.19485907     0.36196295     0.027507836
#> [232,] -0.52767383     0.30618330     0.262171543
#> [233,] -0.50213441     0.54687533     0.130675622
#> [234,] -1.14419669     0.44294999     0.182403711
#> [235,]  0.14793629     0.38367074     0.134581538
#> [236,]  0.13742070     0.18943444     0.615586936
#> [237,]  1.73329421     0.35304611     0.119330759
#> [238,]  0.28091951     0.19213866     0.145063853
#> [239,]  1.06592479     0.22144970     0.476277480
#> [240,]  0.55216367     0.48690699     0.336625122
#> [241,] -0.50568330     0.69990359     0.147133500
#> [242,] -0.15888848     0.57065297     0.032227789
#> [243,]  1.11129395     0.47685209     0.309205299
#> [244,] -0.17180811     0.58338577    -0.026783065
#> [245,]  0.77229859     0.39820027     0.046696092
#> [246,]  0.64388907     0.11664938     0.400841674
#> [247,] -0.57132147     0.20769281     0.436237589
#> [248,] -0.50697388     0.24114828     0.461461274
#> [249,] -1.46022126     0.21572637     0.187962547
#> [250,] -0.56083381     0.14584238     0.056804254
#> [251,] -0.68802760     0.25389621     0.429107580
#> [252,] -0.11276842     0.28184464     0.143069278
#> [253,]  1.70707805     0.27598790    -0.004624171
#> [254,]  0.13519387     0.57224970    -0.052841855
#> [255,]  1.10359068     0.04708678     0.406214025
#> [256,] -0.81044768     0.33746308     0.136106812
#> [257,]  0.97782241     0.47783851     0.370151758
#> [258,] -1.44796864     0.22984448     0.311967504
#> [259,]  0.94861055     0.76793857    -0.025159593
#> [260,] -0.80699030     0.29761295     0.260206402
#> [261,]  0.88160992     0.12492064     0.147905791
#> [262,] -0.20397844     0.21779915     0.008367611
#> [263,]  0.72994345     0.57438068     0.195454605
#> [264,]  0.38035610     0.74340262     0.431520556
#> [265,]  0.63856854     0.10907809     0.523392131
#> [266,] -1.34269377     0.13057659     0.468290503
#> [267,]  0.82864834     0.22244374     0.419033377
#> [268,] -1.02036619     0.29230320     0.317756791
#> [269,]  0.26684293     0.27470618     0.508526925
#> [270,] -0.28595694     0.58657372     0.118640659
#> [271,] -0.91578055     0.12706369     0.331257170
#> [272,]  0.76218475     0.39792072     0.053743254
#> [273,]  1.22151307     0.22059646     0.231100564
#> [274,]  0.47907685     0.99484364     0.160558852
#> [275,] -0.40512906     0.67039856     0.302245936
#> [276,]  2.29695149     0.07764267     0.381344173
#> [277,]  1.25024155     0.35283474     0.171915225
#> [278,]  1.32161545     0.89220899     0.150967723
#> [279,]  0.44388302     0.78856520     0.184843035
#> [280,] -0.08421231     0.35920913     0.255710539
#> [281,] -0.80291658     0.07287374     0.436977787
#> [282,] -1.99151755     0.25055744     0.362867876
#> [283,]  2.35625372     0.13755766     0.136097395
#> [284,] -0.29152228     0.39391821     0.548264498
#> [285,]  1.33950519     0.22339981     0.272118139
#> [286,] -1.12820755     0.35990021     0.298955894
#> [287,]  1.28316994     0.32570703     0.295621441
#> [288,] -1.45560352     0.21128106     0.612762390
#> [289,]  0.93928914     0.74289231     0.061262825
#> [290,] -0.50812360     0.14717881     0.704592476
#> [291,]  0.85955550     0.19943879     0.394496411
#> [292,]  0.15305484     0.15302870     0.327474961
#> [293,]  1.06545534     0.16575894     0.331373268
#> [294,]  0.13813037     0.21630102     0.576794828
#> [295,]  0.26752289     0.26782212    -0.071215673
#> [296,] -0.50887221     0.30858670     0.143404835
#> [297,]  0.95425501     0.45043152     0.038533487
#> [298,] -0.21396934     0.10824036     0.159173253
#> [299,] -1.38646242     0.25415870     0.286547421
#> [300,] -0.30801266     0.57091704     0.236288948
#> 
#> $acov_order
#> [1] 0
#> 
#> $acor_order
#> [1] 1
#> 
#> $N
#> [1] 300
#> 
#> $S
#> [1] 50
#> 
#> $R
#> [1] 1000
#>