estimate_algorithm {RCTS} | R Documentation |
This function is a wrapper around the initialization and the estimation part of the algorithm, for one configuration. It is only used for the serialized algorithm.
Description
This function is a wrapper around the initialization and the estimation part of the algorithm, for one configuration. It is only used for the serialized algorithm.
Usage
estimate_algorithm(Y, X, S, k, kg, maxit = 30, robust = TRUE)
Arguments
Y |
Y: NxT dataframe with the panel data of interest |
X |
X: NxTxp array containing the observable variables |
S |
number of estimated groups |
k |
number of common factors to be estimated |
kg |
number of group specific factors to be estimated |
maxit |
maximum limit for the number of iterations |
robust |
TRUE or FALSE: defines using the classical or robust algorithm to estimate beta |
Value
list with
estimated beta
vector with group membership
matrix with the common factor(s) (contains zero's if there are none estimated)
loadings to the common factor(s)
list with the group specific factors for each of the groups
data.frame with loadings to the group specific factors augmented with group membership and id (to have the order of the time series)
Examples
set.seed(1)
original_data <- create_data_dgp2(60, 30)
Y <- original_data[[1]]
X <- original_data[[2]]
estimate_algorithm(Y, X, 3, 0, c(3,3,3), maxit = 2, robust = TRUE)