calculate_pip_threshold {simBKMRdata}R Documentation

Calculate PIP Threshold

Description

Given a response vector (or statistics from this vector), calculate a PIP threshold that should preserve close to a nominal 5% test size for Bayesian Kernel Machine Regression (BKMR) feature selection.

Usage

calculate_pip_threshold(
  y,
  absCV,
  sampSize,
  coeffs_ls = list(A = 0, K = 1, C = 1.3046, betaAbsCV = 0.59867, betaSampSize = 0.43565),
  na.rm = TRUE
)

Arguments

y

a response vector for BKMR

absCV

If y is not supplied, the absolute value of the coefficient of variation of the response

sampSize

If y is not supplied, the number of observations included in the response

coeffs_ls

A list of Richard's Curve parameters. See Details.

na.rm

Remove missing values from y? Defaults to TRUE

Details

CalculatePipThreshold function is designed to model the relationship between PIP(q95), coefficient of variation (CV), and sample size using a form of four-parameter logistic regression (Richard Curve). This function employs the nls function from the R stats package, utilizing the Levenberg-Marquardt algorithm for optimization to ensure robust parameter estimation.

PIP(q_{95}) = A + \frac{K-A}{ (C + \exp(-\beta_1x_1) )^{\beta_2x_2} }

Where-

A: Fixed left asymptote (0);

K: Right asymptote;

C: Constant;

\beta_1, \beta_2: Midpoint shift parameters for CV and sample size;

x1: Log2-transformed |CV| (log2(|CV|));

x2: Log-transformed sample size (log10(Sample Size)).

The detailed explanation of how we calculated the values in coeffs_ls can be found in <......>.

For more information on Richard's curve, see https://en.wikipedia.org/wiki/Generalised_logistic_function

Value

A single numeric value; the output of the Richard's Four-Parameter Logistic Regression curve with the coefficient values supplied in coeffs_ls.

Examples

calculate_pip_threshold(absCV = 7.5, sampSize = 300)
# should equal 0.6829892


[Package simBKMRdata version 0.2.1 Index]