StATS: Stability Approach to Threshold Selection

View source: R/F_inference.R

StATSR Documentation

Stability Approach to Threshold Selection

Description

Stability Approach to Threshold Selection

Usage

StATS(Pmat, nlambda = 100, stab.thresh = 0.9, plot = FALSE)

Arguments

Pmat

Pmat output from the 'ResampleEMtree()' function

nlambda

Number of probability thresholds to look at

stab.thresh

Stability threshold

plot

Optional graphic output

Value

a list containing

  • freqs_opt: A tibble with (number of possible edges) x nlambda rows, containing the computed selection frequency of each edge and stability measure for each threshold.

  • lambda_opt: The probability threshold giving the desired stability of frequencies.

  • plot: The optional graphic output.

Examples

n=100
p=15
S=15
set.seed(2021)
simu=data_from_scratch("erdos",p=p,n=n)
G=1*(simu$omega!=0) ; diag(G) = 0
#With default evaluation, using the PLNmodel paradigm:
default_resample=ResampleEMtree(simu$data, S=S, cores = 1)
stab_selection=StATS(default_resample$Pmat, nlambda=50, stab.thresh=0.9,plot=TRUE)
#Check quality of result
table(pred=1*(stab_selection$freqs_opt>0.9), truth=ToVec(G))

Rmomal/EMtree documentation built on Dec. 14, 2024, 8:16 a.m.