Description Usage Arguments Details Value Warning Note Author(s) References See Also Examples
This function estimates CWR models via EM algoritms. An object of class cwrObj is returned containing posterior probabilities and group parameters.
1 2 3 4 |
X |
X data matrix |
Y |
Y data matrix |
nc |
Number of clusters |
max_iter |
Max iterations. Default 1000 |
thresh |
threshold to assess numerical convergence. Default 0.01 |
cov_typeX |
Type of covariance of groups in X space. May be: "full" (default), "spherical", "diagonal" |
cov_typeY |
Type of covariance of groups in Y space. May be: "full" (default), "spherical", "diagonal" |
clamp_weights |
Fixed weights |
create_init_params |
Creates initial parameters |
cwrStart |
|
cov_priorX |
Prior X covariance if not autostart. See |
cov_priorY |
Prior Y covariance if not autostart. See |
verbose |
Prints details of estimation process |
regress |
Regression model. Default TRUE |
clamp_covX |
Fixed covX matrix. |
clamp_covY |
Fixed covY matrix. |
This is the main function to estimate CWR models
A CWR object with the following component:
muX |
Means matrix of X component |
muY |
Means matrix of X component |
aic |
AIC of model |
X |
X matrix |
Y |
Y matrix |
SigmaY |
Array containing Y Variances |
SigmaX |
Array containing X Variances |
weightsY |
Matrix containing posterior probabilities |
Estimation can be slow. Convergence is not guaranteeted.
This is the main function. X and Y may be vectors or matrices. cwrObj objects containing parameters and posterior probabilities are returned.
Giorgio Spedicato
Murphy
1 2 3 4 5 6 7 |
Loading required package: MASS
iteration 1 logLik -3201.346
iteration 2 logLik -1419.224
iteration 3 logLik -1404.442
iteration 4 logLik -1401.795
cwrObj : cwrEmExample
-------------
Number of groups: 2
Relative weights (priors): 0.6603206 0.3396794
-------------
logLik : -1401.795
AIC : 2827.59
BIC : 2871.995
-------------
computation time : 0.653
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.