qda-methods | R Documentation |
qda performs quadratic discriminant analysis of Interval Data based on classic estimates of a mixture of Gaussian models.
## S4 method for signature 'IData'
qda( x, grouping, prior="proportions", CVtol=1.0e-5, subset=1:nrow(x),
CovCase=1:4, SelCrit=c("BIC","AIC"), silent=FALSE, k2max=1e6, ... )
## S4 method for signature 'IdtMxtNDE'
qda(x, prior="proportions", selmodel=BestModel(x), silent=FALSE,
k2max=1e6, ... )
## S4 method for signature 'IdtHetNMANOVA'
qda( x, prior="proportions", selmodel=BestModel(H1res(x)),
silent=FALSE, k2max=1e6, ... )
## S4 method for signature 'IdtGenNSNMANOVA'
qda( x, prior="proportions",
selmodel=BestModel(H1res(x)@NMod), silent=FALSE, k2max=1e6, ... )
x |
An object of class |
grouping |
Factor specifying the class for each observation. |
prior |
The prior probabilities of class membership. If unspecified, the class proportions for the training set are used. If present, the probabilities should be specified in the order of the factor levels. |
CVtol |
Tolerance level for absolute value of the coefficient of variation of non-constant variables. When a MidPoint or LogRange has an absolute value within-groups coefficient of variation below CVtol, it is considered to be a constant. |
subset |
An index vector specifying the cases to be used in the analysis. |
CovCase |
Configuration of the variance-covariance matrix: a set of integers between 1 and 4. |
SelCrit |
The model selection criterion. |
silent |
A boolean flag indicating wether a warning message should be printed if the method fails. |
selmodel |
Selected model from a list of candidate models saved in object x. |
k2max |
Maximal allowed l2-norm condition number for correlation matrices. Correlation matrices with condition number above k2max are considered to be numerically singular, leading to degenerate results. |
... |
Other named arguments. |
Brito, P., Duarte Silva, A. P. (2012), Modelling Interval Data with Normal and Skew-Normal Distributions. Journal of Applied Statistics 39(1), 3–20.
Duarte Silva, A.P. and Brito, P. (2015), Discriminant analysis of interval data: An assessment of parametric and distance-based approaches. Journal of Classification 39(3), 516–541.
lda
, snda
, Roblda
, Robqda
, IData
, IdtMxtNDE
, IdtHetNMANOVA
,
IdtGenNSNMANOVA
, ConfMat
# Create an Interval-Data object containing the intervals for 899 observations
# on the temperatures by quarter in 60 Chinese meteorological stations.
ChinaT <- IData(ChinaTemp[1:8],VarNames=c("T1","T2","T3","T4"))
#Quadratic Discriminant Analysis
ChinaT.qda <- qda(ChinaT,ChinaTemp$GeoReg)
cat("Temperatures of China -- qda discriminant analysis results:\n")
print(ChinaT.qda)
cat("Resubstition confusion matrix:\n")
ConfMat(ChinaTemp$GeoReg,predict(ChinaT.qda,ChinaT)$class)
## Not run:
#Estimate error rates by ten-fold cross-validation replicated 20 times
CVqda <- DACrossVal(ChinaT,ChinaTemp$GeoReg,TrainAlg=qda,CovCase=CovCase(ChinaT.qda))
summary(CVqda[,,"Clerr"])
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.