icp.torus.score {ClusTorus}R Documentation

Conformity score for inductive prediction sets

Description

icp.torus.score prepares all values for computing the conformity score for specified methods.

Usage

icp.torus.score(
  data,
  split.id = NULL,
  method = c("all", "kde", "mixture", "kmeans"),
  mixturefitmethod = c("circular", "axis-aligned", "general", "Bayesian"),
  kmeansfitmethod = c("homogeneous-circular", "heterogeneous-circular", "ellipsoids",
    "general"),
  init = c("kmeans", "hierarchical"),
  additional.condition = TRUE,
  param = list(J = 4, concentration = 25),
  kmax = 500,
  THRESHOLD = 1e-10,
  maxiter = 200,
  verbose = TRUE
)

Arguments

data

n x d matrix of toroidal data on [0, 2π)^d or [-π, π)^d

split.id

a n-dimensinal vector consisting of values 1 (estimation) and 2(evaluation)

method

A string. One of "all", "kde", "mixture", and "kmeans" which determines the model or estimation methods. If "kde", the model is based on the kernel density estimates. It supports the kde-based conformity score only. If "mixutre", the model is based on the von Mises mixture, fitted with an EM algorithm. It supports the von Mises mixture and its variants based conformity scores. If "kmeans", the model is also based on the von Mises mixture, but the parameter estimation is implemented with the elliptical k-means algorithm illustrated in Appendix. It supports the log-max-mixture based conformity score only. Default is "all". If the dimension of data space is greater than 2, only "kmeans" is supported.

mixturefitmethod

A string. One of "circular", "axis-aligned", and "general" which determines the constraint of the EM fitting. Default is "axis-aligned". This argument only works for method = "mixture".

kmeansfitmethod

A string. One of "general", ellipsoids", "heterogeneous-circular" or "homogeneous-circular". If "general", the elliptical k-means algorithm with no constraint is used. If "ellipsoids", only the one iteration of the algorithm is used. If"heterogeneous-circular", the same as above, but with the constraint that ellipsoids must be spheres. If "homogeneous-circular", the same as above but the radii of the spheres are identical. This argument only works for method = "kmeans".

init

determine the initial parameter of "kmeans" method, for option "general". Must be "kmeans" or "hierarchical". If "kmeans", the initial parameters are obtained with extrinsic kmeans method. If "hierarchical", the initial parameters are obtained with hierarchical clustering method. Default is "kmeans".

additional.condition

boolean index. If TRUE, a singular matrix will be altered to the scaled identity.

param

the number of components for mixture fitting and the concentration parameter in the form of list(J=j, concentration=k).

kmax

the maximal number of kappa. If estimated kappa is larger than kmax, then put kappa as kmax.

THRESHOLD

number for difference between updating and updated parameters. Default is 1e-10.

maxiter

the maximal number of iteration. Default is 200.

verbose

boolean index, which indicates whether display additional details as to what the algorithm is doing or how many loops are done. Moreover, if additional.condition is TRUE, the warning message will be reported.

Value

returns an icp.torus object, containing all values to compute the conformity score.

References

S. Jung, K. Park, and B. Kim (2021), "Clustering on the torus by conformal prediction"

Examples


data <- toydata1[, 1:2]

icp.torus <- icp.torus.score(data, method = "all",
                             mixturefitmethod = "general",
                             kmeansfitmethod = "general",
                             param = list(J = 4, concentration = 25))


[Package ClusTorus version 0.1.3 Index]