initialise_clustering {RCTS} | R Documentation |
Function that clusters time series in a dataframe with kmeans.
Description
If a time series contains NA's a random cluster will be assigned to that time series.
Usage
initialise_clustering(
Y,
S,
k,
kg,
comfactor,
robust,
max_percent_outliers_tkmeans = 0,
verbose = FALSE
)
Arguments
Y |
Y: NxT dataframe with the panel data of interest |
S |
the desired number of groups |
k |
number of common factors to be estimated |
kg |
number of group specific factors to be estimated |
comfactor |
estimated common factors |
robust |
TRUE or FALSE: defines using the classical or robust algorithm to estimate beta |
max_percent_outliers_tkmeans |
the proportion of observations to be trimmed |
verbose |
when TRUE, it prints messages |
Value
numeric vector
Examples
Y <- Y_dgp3
comfactor <- matrix(0, nrow = ncol(Y))
initialise_clustering(Y, 3, 0, c(3, 3, 3), comfactor, TRUE)
[Package RCTS version 0.2.4 Index]