% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/nmfkc.R
\name{nmfkc.kernel.gaussian}
\alias{nmfkc.kernel.gaussian}
\title{Create a Gaussian kernel matrix from covariates}
\source{
Mesquita, D., Gomes, J. P., & Rodrigues, L. R. (2019).
Gaussian kernels for incomplete data. \emph{Applied Soft Computing}, 77, 356--365.
}
\usage{
nmfkc.kernel.gaussian(
  U,
  V = NULL,
  beta = 0.5,
  na.method = c("pds", "egk"),
  ...
)
}
\arguments{
\item{U}{Covariate matrix \eqn{U(K,N) = (u_1, \dots, u_N)}. Each row may be normalized in advance.}

\item{V}{Covariate matrix \eqn{V(K,M) = (v_1, \dots, v_M)}, typically used for prediction. If \code{NULL}, the default is \code{U}. May contain \code{NA} values.}

\item{beta}{Bandwidth parameter for the Gaussian kernel. Default is \code{0.5}.}

\item{na.method}{Method for handling \code{NA} values in \code{V}. Either \code{"pds"} or \code{"egk"}. Ignored if \code{V} has no \code{NA}.}

\item{...}{Additional arguments for EGK method:
\describe{
\item{\code{gmm.G}}{Number of GMM components for EGK. Default is \code{3} (Mesquita et al., 2019).}
}}
}
\value{
Kernel matrix \eqn{A(N,M)}.
}
\description{
\code{nmfkc.kernel.gaussian} constructs a Gaussian (RBF) kernel matrix from covariate matrices.
The kernel is defined as \eqn{K(u,v) = \exp(-\beta \|u - v\|^2)}.
When \code{V} contains \code{NA} values, two methods are available via \code{na.method}:
\describe{
\item{\code{"pds"}}{Partial Distance Strategy. Computes the kernel using only observed (non-NA) rows,
with beta adjusted by \eqn{\beta_{adj} = \beta \times K / K_{obs}} where \eqn{K} is the total number of rows
and \eqn{K_{obs}} is the number of observed rows.}
\item{\code{"egk"}}{Expected Gaussian Kernel (Mesquita et al., 2019). Uses a Gaussian Mixture Model (GMM)
to estimate the conditional distribution of missing values given observed values,
then computes the expected kernel value via a Gamma approximation.
Requires \code{gmm.means}, \code{gmm.sigmas}, and \code{gmm.weights} passed through \code{...}.}
}
}
\examples{
U <- matrix(c(5,10,15,20,25),nrow=1)
V <- matrix(1:25,nrow=1)
A <- nmfkc.kernel.gaussian(U,V,beta=28/1000)
dim(A)

# PDS example: V with NA in first row
U2 <- matrix(rnorm(20), nrow=2)
V2 <- matrix(rnorm(10), nrow=2)
V2[1, c(2,4)] <- NA
A2 <- nmfkc.kernel.gaussian(U2, V2, beta=0.5, na.method="pds")
}
\seealso{
\code{\link{nmfkc.kernel}}, \code{\link{nmfkc.kernel.beta.cv}}, \code{\link{nmfkc.kernel.beta.nearest.med}}
}
