Calculates objective function for the classical algorithm: used in iterate() and in local_search.
OF_vectorized3(
NN,
TT,
g,
grid,
Y,
beta_est,
lc,
fc,
lg,
fg,
S,
k,
kg,
method_estimate_beta,
num_factors_may_vary = TRUE
)numeric value of the objective function
number of time series
length of time series
Vector with group membership for all individuals
dataframe containing the matrix multiplications XB, FgLg and FL
Y: NxT dataframe with the panel data of interest
estimated values of beta
loadings of estimated common factors
estimated common factors
estimated grouploadings
estimated groupfactors
number of estimated groups
number of common factors to be estimated
number of group specific 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".
whether or not the number of groupfactors is constant over all groups or not