% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/PFC.R
\name{PFC}
\alias{PFC}
\title{Power Fuzzy Clustering}
\usage{
PFC(
  Y,
  K,
  m = 2,
  q = 2,
  distance = "Minkowski",
  p = 2,
  alpha = 0.5,
  beta = 10^15,
  threshold = 0.01,
  max.iter = 100
)
}
\arguments{
\item{Y}{An \verb{n x dy} data frame or matrix of observations.}

\item{K}{Number of clusters (positive integer).}

\item{m}{Fuzzifier, must be strictly greater than 1. Default \code{2}.}

\item{q}{Distance exponent, must be strictly greater than 0. Default \code{2}.}

\item{distance}{Either \code{"Minkowski"} or \code{"Mahalanobis"}.}

\item{p}{Minkowski exponent (\verb{>= 1}). Ignored when
\code{distance = "Mahalanobis"}. Default \code{2}.}

\item{alpha}{Regularisation weight for the Mahalanobis covariance.
Default \code{0.5}.}

\item{beta}{Eigenvalue ratio bound for the Mahalanobis covariance.
Default \code{1e15}.}

\item{threshold}{Convergence tolerance. Default \code{0.01}.}

\item{max.iter}{Maximum number of iterations. Default \code{100}.}
}
\value{
A list with elements \code{B} (or \code{C}) for cluster centres, \code{d}
(distances), \code{p} (memberships), \code{JDF} (objective history), and \code{l}
(hard labels). For Mahalanobis, also \code{rho} and \code{cov}.
}
\description{
Clusters the rows of \code{Y} into \code{K} groups using Minkowski or adaptive
regularised Mahalanobis distance.
}
\references{ P.T. Nguyen, C. Tortora, and A. Punzo. (2026)
"Power fuzzy clustering: flexible distance metrics and inclusion of covariates". 
IEEE Transactions on Fuzzy Systems 10.1109/TFUZZ.2026.3683998

D. E. Gustafson and W. C. Kessel, “Fuzzy clustering with a fuzzy
covariance matrix,” in 1978 IEEE conference on decision and control
including the 17th symposium on adaptive processes. IEEE, 1979, pp.
761–766.

}
\examples{

Y <- iris[, 1:4]
l <- iris[, 5]

# --- 2a. Mahalanobis distance ---
resMahC <- PFC(Y, K = 3, distance = "Mahalanobis")
table(resMahC$l, l)
pairs(Y, col = resMahC$l)
\donttest{
# --- 2b. Minkowski distance (default p=2) ---
resMinC <- PFC(Y, K = 3)
table(resMinC$l, l)
pairs(Y, col = resMinC$l)

# --- 2c. Minkowski distance (p=1, Manhattan) ---
resMin1C <- PFC(Y, K = 3, p = 1)
table(resMin1C$l, l)
pairs(Y, col = resMin1C$l)
}
}
