Learn R Programming

McMiso (version 0.1.2)

PBclassifier: Probabilistic Bayesian classifier

Description

Probabilistic Bayesian classifier

Usage

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

Value

A list with class "pbc"

Arguments

X

numeric matrix of doses

y

numeric response vector

method

character, either "DU" or "UD"

a0

numeric, prior alpha

b0

numeric, prior beta

t0

numeric, threshold

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.

Examples

Run this code
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)

Run the code above in your browser using DataLab