predict.pkbc: Cluster spherical observations using a mixture of Poisson...

predict.pkbcR Documentation

Cluster spherical observations using a mixture of Poisson kernel-based densities

Description

Obtain predictions of membership for spherical observations based on a mixture of Poisson kernel-based densities estimated by pkbc

Usage

## S4 method for signature 'pkbc'
predict(object, k, newdata = NULL)

Arguments

object

Object of class pkbc

k

Number of clusters to be used.

newdata

a data.frame or a matrix of the data. If missing the clustering data obtained from the pkbc object are classified.

Value

Returns a list with the following components

  • Memb: vector of predicted memberships of newdata

  • Probs: matrix where entry (i,j) denotes the probability that observation i belongs to the k-th cluster.

See Also

pkbc() for the clustering algorithm
pkbc for the class object definition.

Examples

# generate data
dat <- rbind(matrix(rnorm(100), ncol = 2), matrix(rnorm(100, 5), ncol = 2))
res <- pkbc(dat, 2)

# extract membership of dat
predict(res, k = 2)
# predict membership of new data
newdat <- rbind(matrix(rnorm(10), ncol = 2), matrix(rnorm(10, 5), ncol = 2))
predict(res, k = 2, newdat)
 

QuadratiK documentation built on April 12, 2025, 2 a.m.