Description Usage Arguments Details Value Examples
View source: R/stability_function.R
Returns the graph with desired FDR/freq from a path of CPSS estimates from CPSS_path().
1 | CPSS_control(path, FDR = NULL, freq = NULL, B = 50)
|
path |
A list returned by |
FDR |
A number between 0 and 1, the desired FDR (false discovery rate); exactly one of |
freq |
A number between 0 and 1, the frequency threshold; exactly one of |
B |
An integer, number of pairs of subsamples to be drawn, should be equal to the |
Returns the densest graph along the CPSS path that has FDR <= FDR
or freq >= freq
. If the resulting graph is empty, returns the sparsest non-empty graph.
Fore more details, see Shah and Samworth (2012) and the documentation on CPSS_fit()
and CPSS_path()
.
Note: The user is expected to call CPSS_fit()
, followed by CPSS_path()
, and then followed by CPSS_control()
.
A list associated with the selected estimated DAG.
graph |
The estimated adjacency matrix. |
actual_fdr |
The actual FDR controlled. |
freq |
The frequency threshold for the selected graph using |
1 2 3 4 5 6 7 8 9 10 | m <- 3; n <- 200; B <- 10
adj_mat <- ZiDAG::make_dag(m, mode = "chain")
d <- ZiDAG::gen_zero_dat(seed=1, gen_para="pms", adj_mat=adj_mat, n=n, gen_uniform_degree=1)
fitting_func <- function(indices) return (
ZiDAG::ziGDS(V=d$V[indices,], Y=d$Y[indices,], parametrization="pms", verbose=FALSE,
control=list("max_uniform_degree"=1L, "tol"=1e-8, "print_best_degree"=FALSE)))
freq_B <- ZiDAG::CPSS_fit(nrow(d$V), fitting_func, B=B, parallel=FALSE, num_cores=1)
cpss_path <- CPSS_path(freq_B, B = B)
CPSS_control(cpss_path, freq=0.5, B=B)
CPSS_control(cpss_path, FDR=0.2, B=B)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.