# \donttest{
#Using a small dataset as an example; this will generate several warnings due to its small size.
#Note that this example is run sequentially instead of parallel,
# and consequently will print some intermediate information in the console.
#This example uses the classical algorithm instead of the robust algorithm
# to limit its running time.
set.seed(1)
original_data <- create_data_dgp2(30, 10)
#define the number of subsets used to estimate the optimal number of groups and factors
indices_subset <- define_number_subsets(2)
#define the candidate values for C (this is a parameter in the information criterium
# used to estimate the optimal number of groups and factors)
C_candidates <- define_C_candidates()
S_cand <- 3:3 # vector with candidate number of groups
k_cand <- 0:0 # vector with candidate number of common factors
kg_cand <- 1:2 # vector with candidate number of group specific factors
#excluding parallel part from this example
#cl <- makeCluster(detectCores() - 1)
#registerDoSNOW(cl)
output <- parallel_algorithm(original_data, indices_subset, S_cand, k_cand, kg_cand,
C_candidates, robust = FALSE, USE_DO = TRUE, maxit = 3)
#stopCluster(cl)
# }
Run the code above in your browser using DataLab