Knockoff
: Start from \(\Sigma_{\hat\beta}\)Last updated: 2018-02-01
Code version: fe8ed5b
Similar to previous simulations, only that the design matrix \(X\) is simulated such that \(\Sigma_{\hat\beta} = \sigma_e^2(X^TX)^{-1}\) has non negligible off-diagnoal correlations.
Let \(\Sigma_{\hat\beta} / \sigma_e^2 = B_{p \times d} \cdot B_{p \times d}^T + I\), where \(B_{i, j} \stackrel{\text{iid}}{\sim} N(0, 1)\). Then rescale the matrix such that the mean of its diagnal \(= 1\). Generate \(X_{n \times p}\) such that \((X^TX)^{-1} = \Sigma_{\hat\beta} / \sigma_e^2\).
Recall that the random coefficient of the second order of Gaussian deviative with the empirical distribution of correlated null \(W_2\) has the property \[ Var(W_2) = \bar{\rho_{ij}^2} \] We take a look at how \(d\) is related to this quantity.
sessionInfo()
R version 3.4.3 (2017-11-30)
Platform: x86_64-apple-darwin15.6.0 (64-bit)
Running under: macOS High Sierra 10.13.2
Matrix products: default
BLAS: /Library/Frameworks/R.framework/Versions/3.4/Resources/lib/libRblas.0.dylib
LAPACK: /Library/Frameworks/R.framework/Versions/3.4/Resources/lib/libRlapack.dylib
locale:
[1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8
attached base packages:
[1] stats graphics grDevices utils datasets methods base
other attached packages:
[1] ggplot2_2.2.1 reshape2_1.4.3 knockoff_0.3.0
[4] qvalue_2.10.0 ashr_2.2-2 Rmosek_8.0.69
[7] PolynomF_1.0-1 CVXR_0.94-4 REBayes_1.2
[10] Matrix_1.2-12 SQUAREM_2017.10-1 EQL_1.0-0
[13] ttutils_1.0-1
loaded via a namespace (and not attached):
[1] gmp_0.5-13.1 Rcpp_0.12.14 pillar_1.0.1
[4] plyr_1.8.4 compiler_3.4.3 git2r_0.21.0
[7] R.methodsS3_1.7.1 R.utils_2.6.0 iterators_1.0.9
[10] tools_3.4.3 digest_0.6.14 bit_1.1-12
[13] tibble_1.4.1 gtable_0.2.0 evaluate_0.10.1
[16] lattice_0.20-35 rlang_0.1.6 foreach_1.4.4
[19] yaml_2.1.16 parallel_3.4.3 Rmpfr_0.6-1
[22] ECOSolveR_0.3-2 stringr_1.2.0 knitr_1.18
[25] rprojroot_1.3-2 bit64_0.9-7 grid_3.4.3
[28] R6_2.2.2 rmarkdown_1.8 magrittr_1.5
[31] splines_3.4.3 scales_0.5.0 MASS_7.3-47
[34] backports_1.1.2 codetools_0.2-15 htmltools_0.3.6
[37] scs_1.1-1 colorspace_1.3-2 labeling_0.3
[40] stringi_1.1.6 lazyeval_0.2.1 munsell_0.4.3
[43] doParallel_1.0.11 pscl_1.5.2 truncnorm_1.0-7
[46] R.oo_1.21.0
This R Markdown site was created with workflowr