select_quantile_param: Select the better factor and quantile to reach a given FDR.

View source: R/choose_param.R

select_quantile_paramR Documentation

Select the better factor and quantile to reach a given FDR.

Description

This function use the result of choose_quantile to give parameters which allow to reach the given FDR with the best TPR.

Usage

select_quantile_param(which_quantile, FDR_max = 0.15)

Arguments

which_quantile

The matrix result of choose_quantile, with factor, quantile, FDR and TPR.

FDR_max

The maximum FDR wanted.

Value

This function returns a list of 4 parameters : the best factor, the best quantile, and the associated FDR and TPR.

Examples

# First, load and define the data, make the simulation
controls = penda::penda_data_ctrl[1:10, 1:10]
simu_data = penda::penda_data_ctrl[1:10,11:16]
simulation = penda::simplified_simulation(simu_data, proportion = 0.3, threshold = 60)
# Second, choose the vectors of quantiles and factors to test
quantile_values = c(0, 0.02, 0.04, 0.06, 0.08, 0.1, 0.15, 0.2, 0.25, 0.30, 0.35, 0.4, 0.45)
factor_values = c(1, 1.2, 1.4, 1.6, 1.8, 2)
# Third, make the test on simulation for different quantiles
which_quantile = penda::choose_quantile(controls,
                                        simulation,
                                        factor_values,
                                        quantile_values)
# Fourth, use the function to automatically choose the bests parameters
best_quantile = penda::select_quantile_param(which_quantile, FDR_max = 0.15)

CDecamps/penda documentation built on March 29, 2024, 3:26 a.m.