Title: | Multiple-Scaled Clustering |
---|---|
Description: | Model based clustering using the multivariate multiple Scaled t (MST) and multivariate multiple scaled contaminated normal (MSCN) distributions. The MST is an extension of the multivariate Student-t distribution to include flexible tail behaviors, Forbes, F. & Wraith, D. (2014) <doi:10.1007/s11222-013-9414-4>. The MSCN represents a heavy-tailed generalization of the multivariate normal (MN) distribution to model elliptical contoured scatters in the presence of mild outliers (also referred to as "bad" points) and automatically detect bad points, Punzo, A. & Tortora, C. (2021) <doi:10.1177/1471082X19890935>. |
Authors: | Cristina Tortora [aut, cre, cph] , Antonio Punzo [aut] , Louis Tran [aut] |
Maintainer: | Cristina Tortora <[email protected]> |
License: | GPL (>= 2) |
Version: | 1.0.4 |
Built: | 2024-12-01 08:36:34 UTC |
Source: | CRAN |
Fits a mixture of multiple scaled contaminated normal distributions to the given data.
mscn(X,k,ini="km",sz=NULL,al=c(0.5,0.99),eta.min=1.01,m="BFGS",stop=c(10^-5,200),VB=FALSE)
mscn(X,k,ini="km",sz=NULL,al=c(0.5,0.99),eta.min=1.01,m="BFGS",stop=c(10^-5,200),VB=FALSE)
X |
A matrix or data frame such that rows correspond to observations and columns correspond to variables. |
k |
The number of clusters. |
ini |
Using kmeans by default or |
sz |
If initialization is |
al |
2-dimensional vector containing minimum and maximum proportion of good points in each group for the contaminated normal distribution. |
eta.min |
Minimum value for inflation parameter for the covariance matrix for the bad points. |
m |
Method for the optimization of the eigenvector matrix, see |
stop |
2-dimensional vector with the Aitken criterion stopping rule and maximum number of iterations. |
VB |
If |
X |
Data used for clustering. |
n |
The number of observations in the data. |
d |
The number of features in the data. |
k |
Value corresponding to the number of components. |
cluster |
Vector of group membership as determined by the model. |
detect |
Detect if the point is bad or not per each principal component given the cluster membership. |
npar |
The number of parameters. |
mu |
Either a vector of length |
Lambda |
Orthogonal matrix whose columns are the normalized eigenvectors of Sigma. |
Gamma |
Diagonal matrix of the eigenvalues of Sigma. |
Sigma |
A symmetric positive-definite matrix representing the scale matrix of the distribution. |
alpha |
Proportion of good observations. |
eta |
Degree of contamination. |
z |
The component membership of each observations. |
v |
The indicator if an observation is good or bad with respect to each dimension; 1 is good, and 0 means bad. |
weight |
The matrix of the expected value of the characteristic weights; corespond to the value of |
iter.stop |
The number of iterations until convergence for the model. |
loglik |
The log-likelihood corresponding to the model. |
AIC |
The Akaike's Information Criterion of the model. |
BIC |
The Bayesian Information Criterion of the model. |
ICL |
The Integrated Completed Likelihood of the model. |
KIC |
The Kullback Information Criterion of the model. |
KICc |
The Bias correction of the Kullback Information Criterion of the model. |
AWE |
The Approximate Weight of Evidence of the model. |
AIC3 |
Another version of Akaike's Information Criterion of the model. |
CAIC |
The Consistent Akaike's Information Criterion of the model. |
AICc |
The AIC version which is used when sample size |
CLC |
The Classification Likelihood Criterion of the model. |
Cristina Tortora and Antonio Punzo
Punzo, A. & Tortora, C. (2021). Multiple scaled contaminated normal distribution and its application in clustering. Statistical Modelling, 21(4): 332–358.
## Not run: ## Not run: data(sim) result <- mscn(X = sim, k = 2) plot(result) summary(result) ## End(Not run) ## End(Not run)
## Not run: ## Not run: data(sim) result <- mscn(X = sim, k = 2) plot(result) summary(result) ## End(Not run) ## End(Not run)
Fits the mixture of multiple scaled Student-t distributions to the given data.
mst(X,k,ini="km",sz=NULL,df.min=1,dfU="num",frm="dir",m="BFGS",stop=c(10^-5,200),VB=FALSE)
mst(X,k,ini="km",sz=NULL,df.min=1,dfU="num",frm="dir",m="BFGS",stop=c(10^-5,200),VB=FALSE)
X |
A matrix or data frame such that rows correspond to observations and columns correspond to variables. |
k |
The number of clusters. |
ini |
Using kmeans by default or |
sz |
If initialization is manual, this matrix contains the starting value for |
df.min |
Minimum proportion of good points in each group for the contaminated normal distribution. |
dfU |
Criterion to update the degrees of freedom. |
frm |
Direct by default or indirect, technique used to compute the density function. |
m |
Method for the optimization of the eigenvector matrix, see optim for other options. |
stop |
2-dimensional vector with the Aitken criterion stopping rule and Maximum number of iterations. |
VB |
If true, tracing information on the progress of the optimization is produced; see optim() for details and plotting of the log-likelihood versus iterations. |
X |
Data used for clustering. |
n |
The number of observations in the data. |
d |
The number of features in the data. |
k |
Value corresponding to the number of components. |
cluster |
Vector of group membership as determined by the model. |
detect |
Detect if the point is bad or not per each principal component given the cluster membership. |
npar |
The number of parameters. |
mu |
Either a vector of length |
Lambda |
Orthogonal matrix whose columns are the normalized eigenvectors of Sigma. |
Gamma |
Diagonal matrix of the eigenvalues of Sigma. |
Sigma |
A symmetric positive-definite matrix representing the scale matrix of the distribution. |
df |
vector containing the degrees of freedom for each component. |
z |
The component membership of each observations. |
v |
The indicator if an observation is good or bad with respect to each dimension; 1 is good, and 0 means bad. |
weight |
The matrix of the expected value of the characteristic weights; corespond to the value of |
iter.stop |
The number of iterations until convergence for the model. |
loglik |
The log-likelihood corresponding to the model. |
AIC |
The Akaike's Information Criterion of the model. |
BIC |
The Bayesian Information Criterion of the model. |
ICL |
The Integrated Completed Likelihood of the model. |
KIC |
The Kullback Information Criterion of the model. |
KICc |
The Bias correction of the Kullback Information Criterion of the model. |
AWE |
The Approximate Weight of Evidence of the model. |
AIC3 |
Another version of Akaike's Information Criterion of the model. |
CAIC |
The Consistent Akaike's Information Criterion of the model. |
AICc |
The AIC version which is used when sample size |
CLC |
The Classification Likelihood Criterion of the model. |
Cristina Tortora and Antonio Punzo
Forbes, F. & Wraith, D. (2014). A new family of multivariate heavy-tailed distributions with variable marginal amounts of tailweight: application to robust clustering. Statistics and Computing, 24(6), 971–984.
## Not run: ## Not run: data(sim) result <- mst(X = sim, k = 2) plot(result) ## End(Not run) ## End(Not run)
## Not run: ## Not run: data(sim) result <- mst(X = sim, k = 2) plot(result) ## End(Not run) ## End(Not run)
MSclust Plotting
## S3 method for class 'MSclust' plot(x, ...)
## S3 method for class 'MSclust' plot(x, ...)
x |
A |
... |
Arguments to be passed to methods, such as graphical parameters. |
No return value, called to visualize the fitted model's results
## Not run: ## Not run: data(sim) result <- mscn(X = sim, k = 2) plot(result) ## End(Not run) ## End(Not run)
## Not run: ## Not run: data(sim) result <- mscn(X = sim, k = 2) plot(result) ## End(Not run) ## End(Not run)
Probability density function and pseudo random number generation for the multiple scaled contaminated normal distribution.
dmscn(x, mu = NULL, L = NULL, G = NULL, Sigma = NULL, alpha = NULL, eta = NULL) rmscn(n,d=2,mu=rep(0,d),L=NULL,G=NULL,Sigma=diag(d),alpha=rep(0.99,d),eta=rep(1.01,d))
dmscn(x, mu = NULL, L = NULL, G = NULL, Sigma = NULL, alpha = NULL, eta = NULL) rmscn(n,d=2,mu=rep(0,d),L=NULL,G=NULL,Sigma=diag(d),alpha=rep(0.99,d),eta=rep(1.01,d))
x |
A matrix or data frame such that rows correspond to observations and columns correspond to variables. |
n |
The number of random vectors to be generated. |
d |
A number specifing the dimenstion. |
mu |
Either a vector of length |
L |
Lambda diagonal |
G |
Gamma orthogonal |
Sigma |
A symmetric positive-definite |
alpha |
|
eta |
|
dmscn |
returns a vector of density values. |
rmscn |
returns a matrix of |
Cristina Tortora and Antonio Punzo
Punzo, A. & Tortora, C. (2021). Multiple scaled contaminated normal distribution and its application in clustering. Statistical Modelling, 21(4): 332–358.
x <- matrix(c(0,0),1,2) alpha <- c(0.8,0.6) eta <- c(2,4) density <- dmscn(x = x, alpha = alpha, eta = eta) density n <- 100 random <- rmscn(n = n, alpha = alpha, eta = eta) plot(random)
x <- matrix(c(0,0),1,2) alpha <- c(0.8,0.6) eta <- c(2,4) density <- dmscn(x = x, alpha = alpha, eta = eta) density n <- 100 random <- rmscn(n = n, alpha = alpha, eta = eta) plot(random)
Probability density function and pseudo-random number generation for the multiple scaled Student-t distribution.
dmst(x, mu = NULL, L = NULL, G = NULL, Sigma = NULL, theta = NULL, formula = "direct") rmst(n,d=2,mu=rep(0,d),L=NULL,G=NULL,Sigma=diag(d),theta=rep(100,d),n.dens="dmnorm")
dmst(x, mu = NULL, L = NULL, G = NULL, Sigma = NULL, theta = NULL, formula = "direct") rmst(n,d=2,mu=rep(0,d),L=NULL,G=NULL,Sigma=diag(d),theta=rep(100,d),n.dens="dmnorm")
x |
A matrix or data frame such that rows correspond to observations and columns correspond to variables. |
n |
The number of observations to be generated. |
d |
A number specifing the dimension. |
mu |
Either a vector of length |
L |
Lambda diagonal |
G |
Gamma orthogonal |
Sigma |
A symmetric positive-definite |
theta |
Vector of dimesion |
n.dens |
|
formula |
|
dmscn |
returns a vector of density values. |
rmscn |
returns a matrix of |
Cristina Tortora and Antonio Punzo
Punzo, A., & Tortora, C. (2021). Multiple scaled contaminated normal distribution and its application in clustering. Statistical Modelling, 21(4): 332–358.
Forbes, F. & Wraith, D. (2014). A new family of multivariate heavy-tailed distributions with variable marginal amounts of tailweight: application to robust clustering. Statistics and Computing, 24(6), 971–984.
x <- matrix(c(0,0),1,2) theta <- c(5,20) density <- dmst(x = x, theta = theta) density n <- 100 random <- rmst(n = n, theta = theta) plot(random)
x <- matrix(c(0,0),1,2) theta <- c(5,20) density <- dmst(x = x, theta = theta) density n <- 100 random <- rmst(n = n, theta = theta) plot(random)
A simulated mixture of two normal distributions with mean (0,0) and (2,4), respectively, the fist covariance matrix has diagonlas equal to 2 and covariance 1.5, the second 0.5 and 0.1 respectively. Moreover, 18 observations have been transformed in outliers. For details, see Punzo, A. & Tortora, C. (2021). Multiple scaled contaminated normal distribution and its application in clustering. Statistical Modelling, 21(4): 332–358.
data(sim)
data(sim)
A matrix with 600 observations (rows) and 2 variables (columns). The first 180 rows belong to cluster 1, and the last 420 rows belong to cluster 2.
variable 1.
variable 2.
Punzo, A. & Tortora, C. (2021). Multiple scaled contaminated normal distribution and its application in clustering. Statistical Modelling, 21(4): 332–358.
Summarizes main information regarding a MSclust
object.
## S3 method for class 'MSclust' summary(object, ...)
## S3 method for class 'MSclust' summary(object, ...)
object |
A |
... |
Arguments to be passed to methods, such as graphical parameters. |
Information includes clustering table, total outliers, outliers per cluster, mixing proportions, component means and variances.
No return value, called to summarize the fitted model's results
## Not run: ## Not run: data(sim) result <- mscn(X = sim, k = 2, initialization = "kmeans", method = "BFGS") summary(result) ## End(Not run) ## End(Not run)
## Not run: ## Not run: data(sim) result <- mscn(X = sim, k = 2, initialization = "kmeans", method = "BFGS") summary(result) ## End(Not run) ## End(Not run)