  Group number selection is a key question for group panel data modelling. In
this work, we develop a cross validation method to tackle this problem.
Specifically, we split the panel data into a training dataset and a testing
dataset on the time span. We first use the training dataset to estimate the
parameters and group memberships. Then we apply the fitted model to the testing
dataset and then the group number is estimated by minimizing certain loss
function values on the testing dataset. We design the loss functions for panel
data models either with or without fixed effects. The proposed method has two
advantages. First, the method is totally data-driven thus no further tuning
parameters are involved. Second, the method can be flexibly applied to a wide
range of panel data models. Theoretically, we establish the estimation
consistency by taking advantage of the optimization property of the estimation
algorithm. Experiments on a variety of synthetic and empirical datasets are
carried out to further illustrate the advantages of the proposed method.
