StATS | R Documentation |
Stability Approach to Threshold Selection
StATS(Pmat, nlambda = 100, stab.thresh = 0.9, plot = FALSE)
Pmat |
Pmat output from the 'ResampleEMtree()' function |
nlambda |
Number of probability thresholds to look at |
stab.thresh |
Stability threshold |
plot |
Optional graphic output |
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.
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))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.