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