separable_proportion: Porportion of linearly separable subsamples

View source: R/separable_proportion.R

separable_proportionR Documentation

Porportion of linearly separable subsamples

Description

This function randomly generate B subsamples of size nn and returns the proportion of times that a subsample is linearly separable.

Usage

separable_proportion(X, Y, nn, B = 10)

Arguments

X

Covariate matrix. Each row in X is one observation.

Y

Response vector of +1 and -1 representing the two classes. Y has the same length as the number of rows in X.

nn

Number of observations in each subsample.

B

Numeric. Number of subsamples.

Value

Numeric. The proportion of separable subsamples.

Examples

## Not run: 
n <- 1000; p <- 400
X <- matrix(rnorm(n*p, 0, 1), n, p)
Y <- 2 * rbinom(n, 1, 0.5) - 1
separable_proportion(X, Y, nn = 600, B = 10)

## End(Not run)

zq00/glmhd documentation built on April 7, 2023, 7:45 a.m.