| tda | R Documentation |
Implements discriminant analysis methods including traditional linear (LDA), quadratic (QDA), transformation (TDA), mixture (MDA) discriminant analysis, and their combinations such as TQDA or TLMDA. The user chooses a specific method by specifying options for common or varying transformation parameters as well as covariance matrices.
tda(x, ID, max_k, trans = TRUE, common_lambda = FALSE,
common_sigma = FALSE, iter = 50, subgroup = NULL,
tol= 0.001, lambda0 = 0.015)
x |
A frame or matrix containing a training data set |
max_k |
The maximum number of mixture components within each class to be fitted |
ID |
A variable containing class memberships for all observations |
trans |
A transformation indicator: |
common_lambda |
A parameter that regulates transformations. If |
common_sigma |
A homoscedasticity parameter: if |
iter |
A maximum number of iterations of the EM algorithm; the default value is 50 |
subgroup |
A vector containing the number of mixture components per each class to be fitted |
tol |
Tolerance level for a stopping critetion based on the relative difference in two consecutive log-likelihood values |
lambda0 |
Starting value for transformation parameters |
BIC |
Values of the Bayesian Information Criterion calculated for each evaluated model |
subprior |
Estimated component priors for each class |
mu |
Estimated component means for each class |
sigma |
Estimated component covariance matrices for each group |
lambda |
Estimated transformation parameters |
loglik |
The log-likelihood value for the model with the lowest BIC |
pred_ID |
Estimated classification of observations in the training data set |
prior |
Estimated class priors |
misclassification_rate |
Misclassification rate for the training data set |
ARI |
Adjusted Rand index value |
Z |
Matrix of posterior probabilities for the training data set |
summary.tda,
predict.tda
set.seed(123)
# Example 1:
MDA <- tda(x = iris[,1:4],ID = iris$Species, max_k = 2, trans = FALSE)
print(MDA)
summary(MDA)
# Example 2:
LDA <- tda(x = iris[,1:4], ID = iris$Species, max_k = 1, trans = FALSE,
common_sigma = TRUE)
print(LDA)
summary(LDA)
# Example 3:
QDA <- tda(x = iris[,1:4], ID = iris$Species, subgroup = c(1, 1, 1),
trans = FALSE, common_sigma = FALSE)
print(QDA)
summary(QDA)
# Example 4:
TQDA <- tda(x = iris[,1:4], ID = iris$Species, subgroup = c(1, 1, 1),
trans = TRUE, common_sigma = FALSE, common_lambda = TRUE)
print(TQDA)
summary(TQDA)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.