mult.reg_2level {mult.latent.reg} | R Documentation |
Selecting the best results for multivariate two level model
Description
This wrapper function runs multiple times the function mult.em_2level for fitting Zhang et al.'s (2023) multivariate response models with two-level random effect, and select the best results with the smallest AIC value.
Arguments
data |
A data set object; we denote the dimension of a data set to be |
v |
Covariate(s). |
K |
Number of mixture components, the default is |
steps |
Number of iterations within each |
num_runs |
Number of function iteration runs, the default is |
start |
Containing parameters involved in the proposed model ( |
option |
Four options for selecting the starting values for the parameters in the model. The default is |
var_fun |
There are two types of variance specifications; |
Value
The best estimated result (with the smallest AIC value) in the model x_{ij} = \alpha + \beta z_k + \Gamma v_{ij} + \varepsilon_{ij}
obtained through the EM algorithm (Zhang et al., 2023),
where the upper-level unit is indexed by i
, and the lower-level unit is indexed by j
.
p |
The estimates for the parameter |
alpha |
The estimates for the parameter |
z |
The estimates for the parameter |
beta |
The estimates for the parameter |
gamma |
The estimates for the parameter |
sigma |
The estimates for the parameter |
W |
The posterior probability matrix. |
loglikelihood |
The approximated log-likelihood of the fitted model. |
disparity |
The disparity ( |
number_parameters |
The number of parameters estimated in the EM algorithm. |
AIC |
The AIC value ( |
aic_data |
All AIC values in each run. |
Starting_values |
Lists of starting values for parameters used in each |
References
Zhang, Y., Einbeck, J. and Drikvandi, R. (2023). A multilevel multivariate response model for data with latent structures. In: Proceedings of the 37th International Workshop on Statistical Modelling, pages 343-348. Link on RG: https://www.researchgate.net/publication/375641972_A_multilevel_multivariate_response_model_for_data_with_latent_structures
See Also
Examples
##run the mult.em_2level() multiple times and select the best results with the smallest AIC value
set.seed(7)
results <- mult.reg_2level(trading_data, K=4, steps = 10, num_runs = 5,
var_fun = 2, option = 1)
## Reproduce the best result: the best result is the 2nd run in the above example.
rep_best_result <- mult.em_2level(trading_data, K=4, steps = 10,
var_fun = 2, option = 1,
start = results$Starting_values[[2]])