PBclassifier: Multivariable Isotonic Classification using Projective Bayes

View source: R/fun.R

PBclassifierR Documentation

Multivariable Isotonic Classification using Projective Bayes

Description

Estimates a monotone binary classification rule for multivariate features using a projective Bayes classifier. The classifier is obtained by projecting an unconstrained nonparametric Bayes estimator onto the partial ordering subspace defined by the assumption that the outcome probability is nondecreasing in each feature. The projection is computed using a recursive sequential update algorithm that yields the exact Bayes solution maximizing the posterior gain. Both a down-up ("DU") and an up-down ("UD") algorithm are available.

Usage

PBclassifier(X, y, method = "DU", a0 = 0.5, b0 = 0.5, t0 = 0.5)

Arguments

X

a numeric matrix of observed feature combinations, one row per observation, where repeated rows are expected. Each column represents a feature (e.g., a dose component or experimental factor) and each row represents the feature combination observed for one unit.

y

a binary numeric vector of length nrow(X) indicating the observed outcome for each observation (1 = event, 0 = no event).

method

a character string specifying the search strategy for finding the optimal monotone classification, either "DU" (down-up) or "UD" (up-down). Defaults to "DU".

a0

a positive numeric value specifying the shape1 hyperparameter of the Beta prior in the Beta-Binomial conjugate model. Defaults to 0.5 (Jeffreys prior).

b0

a positive numeric value specifying the shape2 hyperparameter of the Beta prior in the Beta-Binomial conjugate model. Defaults to 0.5 (Jeffreys prior).

t0

a numeric value in (0,1) specifying the threshold on the response rate used to classify each feature combination as event or no-event. Defaults to 0.5.

Value

A list of class "pbc" containing the following components:

alldoses

a numeric matrix of unique feature combinations

M

a numeric vector of observation counts at each feature combination

S

a numeric vector of event counts at each feature combination

yhat

a binary numeric vector of the optimal monotone classification for each feature combination (1 = event, 0 = no event)

pt

a numeric vector of posterior probabilities that the true response rate exceeds t0 at each feature combination

logH

the log posterior probability of the optimal classification

References

Cheung YK, Diaz KM. Monotone response surface of multi-factor condition: estimation and Bayes classifiers. J R Stat Soc Series B Stat Methodol. 2023 Apr;85(2):497-522. doi: 10.1093/jrsssb/qkad014. Epub 2023 Mar 22. PMID: 38464683; PMCID: PMC10919322.

Cheung YK, Kuhn L. Evaluating multiplex diagnostic test using partially ordered Bayes classifier. Ann Appl Stat. In press.

Examples

A <- as.matrix(expand.grid(rep(list(0:1), 6)))
set.seed(2025)
X <- A[sample(nrow(A),size=500, replace = TRUE),]
y <- as.numeric(rowSums(X)>=3)
PBclassifier(X,y)

McMiso documentation built on April 4, 2026, 1:07 a.m.

Related to PBclassifier in McMiso...