This function calculates FgLg (the groupfactorstructure) for all possible groups where individual i can be placed. For each group were the groupfactors (Fg) estimated earlier. Now the grouploadings are needed for each group as well. In the classical case these are calculated by Fg*Y/T. In the robust case these are robust.
calculate_virtual_factor_and_lambda_group(
group,
solve_FG_FG_times_FG,
robust,
NN_local,
method_estimate_factors_local,
g,
vars_est,
number_of_group_factors_local,
number_of_common_factors_local,
method_estimate_beta,
factor_group,
lambda,
comfactor,
Y,
X,
beta_est,
verbose = FALSE
)NxT matrix containing the product of virtual groupfactors and virtual loadings
number of groups
This is the same as groupfactor / T. It is only used in the Classical approach
robust or classical estimation of group membership
number of time series
specifies the robust algorithm to estimate factors: default is "macro"
vector with estimated group membership for all individuals
number of variables that are included in the algorithm and have their coefficient estimated. This is usually equal to vars.
number of group factors to be estimated
number of common factors to be estimated
defines how beta is estimated. Default case is an estimated beta for each individual. Default value is "individual." Possible values are "homogeneous", "group" or "individual".
estimated group specific factors
loadings of the estimated common factors
estimated common factors
Y: NxT dataframe with the panel data of interest
X: NxTxp array containing the observable variables
estimated values of beta
when TRUE, it prints messages