gaussianKde#
- swordfish.function.gaussianKde()#
Estimate the probability density of the random variable using the Gaussian kernel from kernel density estimation (KDE).
The generated model can be used as the input for the gaussianKdePredict function.
- Parameters:
X (Constant) – A numeric vector, matrix, tuple, or table indicating the input dataset. Each row in X corresponds to a data point with consistent dimensions and a minimum of 2 elements (i.e., a data point must have at least 2 dimensions). The dataset must contain more rows than columns. Distributed tables are currently not supported.
weights (Constant, optional) – A numeric vector indicating the weight of each data point. By default, all data points are equally weighted. The values in weights must be non-negative and not all zeros. The length of weights must be the same as the number of rows in X.
bwMethod (Constant, optional) –
Indicates the method for generating the bandwidth. It can be:
A STRING scalar, “scott” (default) or “silverman”
A numeric scalar indicating the bandwidth size
A function used to calculate the bandwidth based on X and return a numeric scalar.
- Returns:
A dictionary with the following keys:
X is a floating-point vector or matrix indicating the input dataset X.
cov is a floating-point matrix indicating the Cholesky decomposition of the covariance matrix generated from weights, X, and bandwidth.
weights is a floating-point vector indicating the corresponding weight of each data point.
predict is a function pointer indicating the corresponding prediction function. It is used with the syntax model.gaussianKdePredict(model, X). For details, see gaussianKdePredict.
bandwidth is a floating-point scalar indicating the generated bandwidth.
- Return type: