diff --git a/docs/LICENSE.html b/docs/LICENSE.html index 51cab6f..3fc9bf5 100644 --- a/docs/LICENSE.html +++ b/docs/LICENSE.html @@ -86,25 +86,23 @@

License

-
BSD 3-Clause License
-
-Copyright (c) 2017, Matthew Stephens
-All rights reserved.
+
Copyright (c) 2017, Gao Wang, Sarah Urbut & Matthew Stephens.
 
 Redistribution and use in source and binary forms, with or without
 modification, are permitted provided that the following conditions are
 met:
 
-* Redistributions of source code must retain the above copyright
-  notice, this list of conditions and the following disclaimer.
+    Redistributions of source code must retain the above copyright
+    notice, this list of conditions and the following disclaimer.
 
-* Redistributions in binary form must reproduce the above copyright
-  notice, this list of conditions and the following disclaimer in the
-  documentation and/or other materials provided with the distribution.
+    Redistributions in binary form must reproduce the above copyright
+    notice, this list of conditions and the following disclaimer in
+    the documentation and/or other materials provided with the
+    distribution.
 
-* Neither the name of the copyright holder nor the names of its
-  contributors may be used to endorse or promote products derived from
-  this software without specific prior written permission.
+    Neither the name of the University of Chicago nor the names of its
+    contributors may be used to endorse or promote products derived
+    from this software without specific prior written permission.
 
 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
 "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
diff --git a/docs/articles/eQTL_outline.html b/docs/articles/eQTL_outline.html
index 8a6c681..8a6498b 100644
--- a/docs/articles/eQTL_outline.html
+++ b/docs/articles/eQTL_outline.html
@@ -8,8 +8,8 @@
 eQTL analysis outline • mashr
 
 
-
-
+
+
 
 
 
 
 
-    
+
-
+
+

2019-03-11

+
+

Introduction

@@ -141,9 +134,9 @@

U.c = cov_canonical(data.random)
 m = mash(data.random, Ulist = c(U.ed,U.c), outputlevel = 1)
#  - Computing 5000 x 241 likelihood matrix.
-#  - Likelihood calculations took 0.16 seconds.
+#  - Likelihood calculations took 0.14 seconds.
 #  - Fitting model with 241 mixture components.
-#  - Model fitting took 1.30 seconds.
+# - Model fitting took 2.10 seconds.

@@ -151,24 +144,25 @@

Now we can compute posterior summaries etc for any subset of tests using the above mash fit. Here we do this for the strong tests. We do this using the same mash function as above, but we specify to use the fit from the previous run of mash by specifying
g=get_fitted_g(m), fixg=TRUE. (In mash the parameter g is used to denote the mixture model which we learned above.)

m2 = mash(data.strong, g=get_fitted_g(m), fixg=TRUE)
#  - Computing 1428 x 241 likelihood matrix.
-#  - Likelihood calculations took 0.04 seconds.
+#  - Likelihood calculations took 0.06 seconds.
 #  - Computing posterior matrices.
 #  - Computation allocated took 0.01 seconds.
head(get_lfsr(m2))
#               condition_1  condition_2  condition_3  condition_4
-# effect_13096 1.381058e-05 7.503454e-01 6.874052e-01 6.678948e-01
-# effect_29826 5.177092e-05 7.346448e-01 6.923586e-01 7.622170e-01
-# effect_14042 5.669400e-02 1.529967e-02 1.311803e-02 4.596554e-02
-# effect_12524 5.386482e-01 6.905166e-01 4.978431e-01 2.552465e-05
-# effect_15456 8.662398e-05 5.733642e-01 4.369942e-01 6.176371e-01
-# effect_35844 3.413396e-10 2.143976e-10 9.175308e-09 6.573930e-11
+# effect_13096 1.351029e-05 7.304550e-01 6.633768e-01 6.419718e-01
+# effect_29826 4.749262e-05 6.730004e-01 6.283735e-01 7.309554e-01
+# effect_14042 6.116539e-02 1.556075e-02 1.341717e-02 4.594320e-02
+# effect_12524 5.552693e-01 7.011304e-01 5.154365e-01 2.625457e-05
+# effect_15456 8.487950e-05 5.662427e-01 4.228120e-01 6.055155e-01
+# effect_35844 6.452969e-10 3.804030e-10 1.797445e-08 1.206916e-10
 #               condition_5
-# effect_13096 8.183524e-01
-# effect_29826 6.874560e-01
-# effect_14042 6.019355e-06
-# effect_12524 5.360416e-01
-# effect_15456 5.033481e-01
-# effect_35844 3.296696e-12
+# effect_13096 8.025795e-01 +# effect_29826 6.232960e-01 +# effect_14042 6.049099e-06 +# effect_12524 5.527004e-01 +# effect_15456 4.885029e-01 +# effect_35844 5.432876e-12

+ @@ -209,7 +203,5 @@

- - diff --git a/docs/articles/flash_mash.html b/docs/articles/flash_mash.html index cfb1143..02cc9a6 100644 --- a/docs/articles/flash_mash.html +++ b/docs/articles/flash_mash.html @@ -8,8 +8,8 @@ Using flashr for mashr prior specification • mashr - - + + -
+
-
+
+

2019-03-11

+
+

Introduction

@@ -112,7 +105,6 @@

  • (For the time being we remove the additional decomposition on FLASH loading because there are issues needs to be figured out. @yuxin)
  • library(flashr)
    -library(mixsqp)
     library(mashr)
         
     my_init_fn <- function(Y, K = 1) {
    @@ -185,16 +177,39 @@ 

    U.f = cov_flash(data.strong, non_canonical = TRUE)
    # Fitting factor/loading 1 (stop when max factor change is < 1.00e-03):
    #   Iteration  Max Chg (f)      Objective   Obj Diff
    +
    # Due to absence of package REBayes, switching to EM algorithm
    +# Due to absence of package REBayes, switching to EM algorithm
    #           1     8.48e-03      -15489.36        Inf
    +
    # Due to absence of package REBayes, switching to EM algorithm
    +# Due to absence of package REBayes, switching to EM algorithm
    #           2     4.90e-03      -15415.40   7.40e+01
    +
    # Due to absence of package REBayes, switching to EM algorithm
    +# Due to absence of package REBayes, switching to EM algorithm
    #           3     2.24e-03      -15412.98   2.42e+00
    +
    # Due to absence of package REBayes, switching to EM algorithm
    +# Due to absence of package REBayes, switching to EM algorithm
    #           4     9.51e-04      -15412.93   5.18e-02
    # Fitting factor/loading 2 (stop when max factor change is < 1.00e-03):
    #   Iteration  Max Chg (f)      Objective   Obj Diff
    -
    #           1     3.33e-01      -15716.96        Inf
    -
    #           2     7.23e-04      -15429.56   2.87e+02
    +
    # Due to absence of package REBayes, switching to EM algorithm
    +# Due to absence of package REBayes, switching to EM algorithm
    +
    #           1     3.32e-01      -15716.96        Inf
    +
    # Due to absence of package REBayes, switching to EM algorithm
    +# Due to absence of package REBayes, switching to EM algorithm
    +
    #           2     1.48e-03      -15429.70   2.87e+02
    +
    # Due to absence of package REBayes, switching to EM algorithm
    +# Due to absence of package REBayes, switching to EM algorithm
    +
    #           3     1.20e-03      -15416.64   1.31e+01
    +
    # Due to absence of package REBayes, switching to EM algorithm
    +# Due to absence of package REBayes, switching to EM algorithm
    +
    #           4     1.72e-03      -15416.04   6.06e-01
    +
    # Due to absence of package REBayes, switching to EM algorithm
    +# Due to absence of package REBayes, switching to EM algorithm
    +
    #           5     4.01e-05      -15415.92   1.15e-01
    # Backfitting 1 factor/loading(s) (stop when max factor change is < 1.00e-03):
    #   Iteration  Max Chg (f)      Objective   Obj Diff
    +
    # Due to absence of package REBayes, switching to EM algorithm
    +# Due to absence of package REBayes, switching to EM algorithm
    #           1     3.91e-04      -15412.95        Inf

    @@ -210,9 +225,9 @@

    Now we fit mash to the random tests using both data-driven and canonical covariances.

    m = mash(data.random, Ulist = c(U.ed,U.c), outputlevel = 1)
    #  - Computing 5000 x 256 likelihood matrix.
    -#  - Likelihood calculations took 0.18 seconds.
    +#  - Likelihood calculations took 0.16 seconds.
     #  - Fitting model with 256 mixture components.
    -#  - Model fitting took 1.45 seconds.
    +# - Model fitting took 2.34 seconds.

    @@ -220,24 +235,25 @@

    Now we can compute posterior summaries etc for any subset of tests using the above mash fit. Here we do this for the strong tests.

    m2 = mash(data.strong, g=get_fitted_g(m), fixg=TRUE)
    #  - Computing 1428 x 256 likelihood matrix.
    -#  - Likelihood calculations took 0.04 seconds.
    +#  - Likelihood calculations took 0.06 seconds.
     #  - Computing posterior matrices.
     #  - Computation allocated took 0.01 seconds.
    head(get_lfsr(m2))
    #               condition_1  condition_2  condition_3  condition_4
    -# effect_13096 1.370473e-05 7.437300e-01 6.793988e-01 6.592581e-01
    -# effect_29826 5.040489e-05 7.150092e-01 6.719218e-01 7.521132e-01
    -# effect_14042 5.807916e-02 1.537341e-02 1.320160e-02 4.592088e-02
    -# effect_12524 5.434980e-01 6.936128e-01 5.029747e-01 2.573779e-05
    -# effect_15456 8.611973e-05 5.712820e-01 4.327731e-01 6.141828e-01
    -# effect_35844 4.435606e-10 2.638274e-10 1.157848e-08 8.065726e-11
    +# effect_13096 1.337460e-05 7.226243e-01 6.539333e-01 6.318229e-01
    +# effect_29826 4.626489e-05 6.555198e-01 6.100098e-01 7.208470e-01
    +# effect_14042 6.267154e-02 1.562942e-02 1.349911e-02 4.592698e-02
    +# effect_12524 5.612236e-01 7.049402e-01 5.217429e-01 2.651821e-05
    +# effect_15456 8.418593e-05 5.634123e-01 4.175647e-01 6.012912e-01
    +# effect_35844 7.394985e-10 4.355099e-10 2.080568e-08 1.387775e-10
     #               condition_5
    -# effect_13096 8.130021e-01
    -# effect_29826 6.669676e-01
    -# effect_14042 6.026087e-06
    -# effect_12524 5.408984e-01
    -# effect_15456 4.989776e-01
    -# effect_35844 3.936074e-12
    +# effect_13096 7.963808e-01 +# effect_29826 6.048723e-01 +# effect_14042 6.050289e-06 +# effect_12524 5.586740e-01 +# effect_15456 4.831697e-01 +# effect_35844 6.112666e-12 +

    @@ -270,7 +286,5 @@

    - - diff --git a/docs/articles/index.html b/docs/articles/index.html index 73c600b..46a8fa5 100644 --- a/docs/articles/index.html +++ b/docs/articles/index.html @@ -21,19 +21,13 @@ - - - + - - - + + - - - @@ -46,7 +40,7 @@ -
    +
    @@ -91,12 +80,12 @@ -
    -
    - + +
    +

    Vignettes

    The following vignettes provide detailed illustrations of the mashr package, as well as guidance on correct application of the statistical methods.

    @@ -127,8 +116,5 @@

    Vignettes

    - - - diff --git a/docs/articles/intro_correlations.html b/docs/articles/intro_correlations.html index 671d85f..ba74f56 100644 --- a/docs/articles/intro_correlations.html +++ b/docs/articles/intro_correlations.html @@ -8,8 +8,8 @@ Accounting for correlations among measurements • mashr - - + + -
    +
    -
    +
    +

    2019-03-11

    +
    +

    Introduction

    @@ -100,24 +93,25 @@

    U.c = cov_canonical(data.V) 
     m.c = mash(data.V, U.c) # fits with correlations because data.V includes correlation information 
    #  - Computing 2000 x 151 likelihood matrix.
    -#  - Likelihood calculations took 0.03 seconds.
    +#  - Likelihood calculations took 0.05 seconds.
     #  - Fitting model with 151 mixture components.
    -#  - Model fitting took 0.31 seconds.
    +#  - Model fitting took 0.43 seconds.
     #  - Computing posterior matrices.
    -#  - Computation allocated took 0.04 seconds.
    +# - Computation allocated took 0.01 seconds.
    print(get_loglik(m.c),digits=10) # log-likelihood of the fit with correlations set to V
    # [1] -16121.1117

    We can also compare with the original analysis. (Note that the canonical covariances do not depend on the correlations, so we can use the same U.c here for both analyses. If we used data-driven covariances we might prefer to estimate these separately for each analysis as the correlations would affect them.)

    m.c.orig = mash(data, U.c) # fits without correlations because data object was set up without correlations
    #  - Computing 2000 x 151 likelihood matrix.
    -#  - Likelihood calculations took 0.04 seconds.
    +#  - Likelihood calculations took 0.05 seconds.
     #  - Fitting model with 151 mixture components.
    -#  - Model fitting took 0.25 seconds.
    +#  - Model fitting took 0.41 seconds.
     #  - Computing posterior matrices.
    -#  - Computation allocated took 0.02 seconds.
    +# - Computation allocated took 0.04 seconds.
    print(get_loglik(m.c.orig),digits=10)
    -
    # [1] -16120.3214
    +
    # [1] -16120.32135

    The log-likelihoods with and without correlations are similar here, which is expected since there are no actual correlations in the data.

    +

    @@ -146,7 +140,5 @@

    - - diff --git a/docs/articles/intro_mash.html b/docs/articles/intro_mash.html index 1546b84..a8bf9ee 100644 --- a/docs/articles/intro_mash.html +++ b/docs/articles/intro_mash.html @@ -8,8 +8,8 @@ Introduction to mashr • mashr - - + + -
    +
    -
    +
    +

    2019-03-11

    +
    +

    Goal

    @@ -133,11 +126,11 @@

    Having set up the data and covariance matrices you are ready to fit the model using the mash function:

    m.c = mash(data, U.c)
    #  - Computing 2000 x 151 likelihood matrix.
    -#  - Likelihood calculations took 0.03 seconds.
    +#  - Likelihood calculations took 0.04 seconds.
     #  - Fitting model with 151 mixture components.
    -#  - Model fitting took 0.28 seconds.
    +#  - Model fitting took 0.41 seconds.
     #  - Computing posterior matrices.
    -#  - Computation allocated took 0.02 seconds.
    +# - Computation allocated took 0.01 seconds.

    This can take a little time. What this does is to fit a mixture model to the data, estimating the mixture proportions. Specifically the model is that the true effects follow a mixture of multivariate normal distributions: \(B \sim \sum_k \sum_l \pi_{kl} N(0, \omega_l U_k)\) where the \(\omega_l\) are scaling factors set by the “grid” parameter in mash and the \(U_k\) are the covariance matrices (here specified by U.c).

    Remember the Crucial Rule! This step must be peformed using all the tests (or a large random subset), because this is where mash learns that many tests are null and corrects for it.

    @@ -147,28 +140,28 @@

    You can extract estimates (posterior means and posterior standard deviations) and measures of significance (local false sign rates) using functions like get_pm (posterior mean), get_psd (posteriore standard deviation) and get_lfsr (local false sign rate):

    head(get_lfsr(m.c))
    #          condition_1 condition_2 condition_3 condition_4 condition_5
    -# effect_1   0.7561485   0.7705861   0.8052827   0.8111157   0.8189465
    -# effect_2   0.7245458   0.6905897   0.7760443   0.6922721   0.7012676
    -# effect_3   0.7387366   0.7514411   0.8104817   0.8390483   0.8501608
    -# effect_4   0.7855697   0.8454482   0.8360483   0.8660092   0.8503405
    -# effect_5   0.8044543   0.8371045   0.8808436   0.8785908   0.8758300
    -# effect_6   0.7207011   0.6833614   0.7894066   0.7002700   0.7569387
    +# effect_1 0.7561456 0.7705826 0.8052788 0.8111108 0.8189434 +# effect_2 0.7245451 0.6905870 0.7760437 0.6922681 0.7012644 +# effect_3 0.7387334 0.7514373 0.8104771 0.8390450 0.8501580 +# effect_4 0.7855678 0.8454469 0.8360456 0.8660080 0.8503389 +# effect_5 0.8044529 0.8371028 0.8808424 0.8785894 0.8758287 +# effect_6 0.7206969 0.6833571 0.7894009 0.7002643 0.7569353
    head(get_pm(m.c))
    #          condition_1 condition_2   condition_3  condition_4  condition_5
    -# effect_1  0.07387834 -0.12489759 -0.0763244886  0.092632369 -0.045367788
    -# effect_2 -0.02353831 -0.17604807 -0.0324369466 -0.201653402 -0.170552895
    -# effect_3 -0.10218266  0.18092162 -0.0846330445  0.022524410 -0.002684844
    -# effect_4 -0.06238567  0.02794216  0.0654480304  0.008114002  0.032179504
    -# effect_5  0.03341379 -0.06059760  0.0001468816 -0.003887884 -0.004665950
    -# effect_6 -0.09934657  0.21556659 -0.0791493932  0.213026594  0.079063145
    +# effect_1 0.07387961 -0.12490000 -0.0763267542 0.092636351 -0.045368803 +# effect_2 -0.02353673 -0.17604965 -0.0324344285 -0.201657010 -0.170555034 +# effect_3 -0.10218412 0.18092463 -0.0846362908 0.022525129 -0.002685045 +# effect_4 -0.06238666 0.02794230 0.0654500317 0.008113439 0.032179933 +# effect_5 0.03341429 -0.06059869 0.0001472689 -0.003887683 -0.004665803 +# effect_6 -0.09934878 0.21556970 -0.0791533646 0.213031571 0.079063932
    head(get_psd(m.c))
    #          condition_1 condition_2 condition_3 condition_4 condition_5
    -# effect_1   0.4592843   0.4210491   0.3544632   0.4062381   0.3365901
    -# effect_2   0.4861855   0.4277957   0.4046967   0.4447866   0.4149872
    -# effect_3   0.4679437   0.5082161   0.3799417   0.3269355   0.3283886
    -# effect_4   0.4389144   0.2963991   0.3082056   0.2749155   0.2809661
    -# effect_5   0.4033371   0.3286541   0.2608030   0.2597925   0.2656081
    -# effect_6   0.5226677   0.4981608   0.4482759   0.4906756   0.3899237
    +# effect_1 0.4592864 0.4210518 0.3544677 0.4062430 0.3365941 +# effect_2 0.4861874 0.4277981 0.4047003 0.4447904 0.4149903 +# effect_3 0.4679459 0.5082177 0.3799465 0.3269399 0.3283928 +# effect_4 0.4389159 0.2964015 0.3082097 0.2749191 0.2809693 +# effect_5 0.4033387 0.3286560 0.2608065 0.2597959 0.2656111 +# effect_6 0.5226697 0.4981630 0.4482802 0.4906797 0.3899275

    Each of these are \(J \times R\) matrices.

    Use get_significant_results to find the indices of effects that are “significant”, which here means they have lfsr less than t in at least one condition, where t is a threshold you specify (default 0.05). The output is ordered from most significant to least significant.

    @@ -213,11 +206,11 @@

    Use get_estimated_pi to extract the estimates of the mixture proportions for different types of covariance matrix:

    print(get_estimated_pi(m.c))
    #          null      identity   condition_1   condition_2   condition_3 
    -#  3.711952e-01  2.208546e-01  1.365276e-01  2.098059e-02  1.302892e-08 
    +#  3.711932e-01  2.208664e-01  1.365264e-01  2.097969e-02  0.000000e+00 
     #   condition_4   condition_5 equal_effects  simple_het_1  simple_het_2 
    -#  6.212090e-10  4.961779e-03  2.264413e-01  1.000873e-04  2.719204e-09 
    +#  0.000000e+00  4.961490e-03  2.264380e-01  9.035503e-05  0.000000e+00 
     #  simple_het_3 
    -#  1.893879e-02
    +# 1.894453e-02
    barplot(get_estimated_pi(m.c),las = 2)

    Here we can see most of the mass is on the null, identity, singletons_1 (which corresponds to effects that are specific to condition 1) and equal_effects. This reassuringly matches the way that these data were generated.

    @@ -234,13 +227,13 @@

    Session information.

    print(sessionInfo())
    -
    # R version 3.5.1 (2018-07-02)
    +
    # R version 3.4.3 (2017-11-30)
     # Platform: x86_64-apple-darwin15.6.0 (64-bit)
    -# Running under: macOS  10.14.1
    +# Running under: macOS High Sierra 10.13.6
     # 
     # Matrix products: default
    -# BLAS: /Library/Frameworks/R.framework/Versions/3.5/Resources/lib/libRblas.0.dylib
    -# LAPACK: /Library/Frameworks/R.framework/Versions/3.5/Resources/lib/libRlapack.dylib
    +# 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
    @@ -249,24 +242,21 @@ 

    # [1] stats graphics grDevices utils datasets methods base # # other attached packages: -# [1] mashr_0.2.18.0476 ashr_2.2-23 +# [1] mashr_0.2.20.0583 ashr_2.2-32 # # loaded via a namespace (and not attached): -# [1] Rcpp_1.0.0 compiler_3.5.1 plyr_1.8.4 -# [4] iterators_1.0.10 tools_3.5.1 digest_0.6.18 -# [7] evaluate_0.12 memoise_1.1.0 lattice_0.20-35 -# [10] rlang_0.3.0.1 Matrix_1.2-14 foreach_1.4.4 -# [13] rstudioapi_0.8 commonmark_1.6 yaml_2.2.0 -# [16] parallel_3.5.1 mvtnorm_1.0-8 pkgdown_1.1.0 -# [19] stringr_1.3.1 roxygen2_6.1.0 xml2_1.2.0 -# [22] knitr_1.20 desc_1.2.0 fs_1.2.6 -# [25] REBayes_1.3 rprojroot_1.3-2 grid_3.5.1 -# [28] R6_2.3.0 rmarkdown_1.10 rmeta_3.0 -# [31] magrittr_1.5 backports_1.1.2 codetools_0.2-15 -# [34] htmltools_0.3.6 MASS_7.3-50 assertthat_0.2.0 -# [37] abind_1.4-5 stringi_1.2.4 Rmosek_8.0.69 -# [40] doParallel_1.0.14 pscl_1.5.2 truncnorm_1.0-8 -# [43] SQUAREM_2017.10-1 crayon_1.3.4

    +# [1] Rcpp_1.0.0 knitr_1.20 magrittr_1.5 +# [4] MASS_7.3-48 doParallel_1.0.11 pscl_1.5.2 +# [7] SQUAREM_2017.10-1 lattice_0.20-35 foreach_1.4.4 +# [10] plyr_1.8.4 stringr_1.3.1 tools_3.4.3 +# [13] parallel_3.4.3 grid_3.4.3 rmeta_3.0 +# [16] htmltools_0.3.6 iterators_1.0.9 assertthat_0.2.0 +# [19] abind_1.4-5 yaml_2.2.0 rprojroot_1.3-2 +# [22] digest_0.6.17 mixsqp_0.1-97 Matrix_1.2-12 +# [25] codetools_0.2-15 evaluate_0.11 rmarkdown_1.10 +# [28] stringi_1.2.4 compiler_3.4.3 backports_1.1.2 +# [31] mvtnorm_1.0-8 truncnorm_1.0-8
    +
    @@ -308,7 +298,5 @@

    - - diff --git a/docs/articles/intro_mash_dd.html b/docs/articles/intro_mash_dd.html index ed30f19..3febc65 100644 --- a/docs/articles/intro_mash_dd.html +++ b/docs/articles/intro_mash_dd.html @@ -8,8 +8,8 @@ Introduction to mash: data-driven covariances • mashr - - + + -
    +
    -
    +
    +

    2019-03-11

    +
    +

    Goal

    @@ -154,6 +147,7 @@

    Session information.

    print(sessionInfo())
    +
    @@ -185,7 +179,5 @@

    - - diff --git a/docs/articles/intro_mash_files/figure-html/unnamed-chunk-11-1.png b/docs/articles/intro_mash_files/figure-html/unnamed-chunk-11-1.png index 05b2ec3..a2bb2e6 100644 Binary files a/docs/articles/intro_mash_files/figure-html/unnamed-chunk-11-1.png and b/docs/articles/intro_mash_files/figure-html/unnamed-chunk-11-1.png differ diff --git a/docs/articles/intro_mash_files/figure-html/unnamed-chunk-12-1.png b/docs/articles/intro_mash_files/figure-html/unnamed-chunk-12-1.png index e68e391..1ebea88 100644 Binary files a/docs/articles/intro_mash_files/figure-html/unnamed-chunk-12-1.png and b/docs/articles/intro_mash_files/figure-html/unnamed-chunk-12-1.png differ diff --git a/docs/articles/intro_mashcommonbaseline.html b/docs/articles/intro_mashcommonbaseline.html index 0b53f40..ce34061 100644 --- a/docs/articles/intro_mashcommonbaseline.html +++ b/docs/articles/intro_mashcommonbaseline.html @@ -8,8 +8,8 @@ mashr with common baseline • mashr - - + + -
    +
    -
    +
    +

    2019-03-11

    +
    +

    Introduction

    -

    We want to estimate the change in some quantity computed in multiple conditions over a common control condition. Deviation in any condition is defined as a difference in the quantity over a common control condition. We must consider the additional burden of comparing all subsequent conditions to the same reference condition. Failure to deal with such correlations induces many false positives in mashr analysis.

    +

    This vignette illustrates how to use mashr to estimate the change in some quantity measured in multiple conditions compared with a common control condition.

    +

    We assume that we have measurements in multiple conditions, and want to estimate the deviation in each condition from the control: that is, the difference in mean between that condition and the control condition. When we compare every condition to the same control then the observed deviations are correlated with one another (even under the null where there are no true differences among conditions). These correlations, if not properly accounted for, can lead to many false positives in a multivariate analysis. This vignette illustrates how to properly account for such correlations.

    Here is the write-up for the details of the model. When there is no control condition in the study, we can compare the quantity in different conditions with the mean. We illustrate an example in the no baseline vignette.

    To deal with these correlations, mashr allows the user to specify the reference condition using mash_update_data, after setting up the data in mash_set_data.

    -

    Note: In some settings measurements and tests in different conditions may be correlated with one another. For example, in eQTL applications this can occur due to sample overlap among the different conditions. In common baseline analysis, we assume the correlation is known.

    +

    Note: The correlations in deviations induced by comparing to a common baseline/control occur even if the measurements in different conditions are entirely independent. If the measurements in different conditions are also correlated with one another (eg in eQTL applications this can occur due to sample overlap among the different conditions) then this induces additional correlations into the analysis that should also be taken into account. In common baseline analysis, such additional correlations can be specified by the user (we have not yet implemented methods to estimate this additional correlation from the data).

    Illustration

    -

    Here we simulate data for illustration. This simulation routine creates a dataset with 8 conditions and 12000 samples, the last condition is the control condition. 90% of the samples have no deviations from the control condition. The rest 10% of the samples are ‘non-null’. The ‘non-null’ consists of equal numbers of three different types of deviations: equal among conditions \(1, \cdots, 7\), present only in condition 1, independent across conditions \(1, \cdots, 7\).

    -

    Our goal is to estimate the deviations in condition \(1, \cdots, 7\) over the control condition.

    +

    Here we simulate data for illustration. This simulation routine creates a dataset with 8 conditions and 12000 samples, the last condition is the control condition. 90% of the samples have no deviations from the control condition. The remaining 10% of the samples are “non-null”, and consist of equal numbers of three different types of deviations: equal among conditions \(1, \cdots, 7\), present only in condition 1, independent across conditions \(1, \cdots, 7\).

    +

    Our goal is to estimate the deviations in condition \(1, \cdots, 7\) compared with the control condition.

    library(mashr)
    # Loading required package: ashr
    set.seed(1)
    @@ -102,16 +96,16 @@ 

    data = mash_set_data(simdata$Chat, simdata$Shat)
     
     data.L = mash_update_data(data, ref = 8)
    -

    The updated mash data object (data.L) includes the induced correlation internally.

    +

    The updated mash data object (data.L) includes the induced correlation internally.

    We proceed the analysis using just the simple canonical covariances as in the initial introductory vignette.

    U.c = cov_canonical(data.L)
     mashcontrast.model = mash(data.L, U.c, algorithm.version = 'R')
    #  - Computing 12000 x 181 likelihood matrix.
    -#  - Likelihood calculations took 0.91 seconds.
    +#  - Likelihood calculations took 0.97 seconds.
     #  - Fitting model with 181 mixture components.
    -#  - Model fitting took 2.31 seconds.
    +#  - Model fitting took 4.21 seconds.
     #  - Computing posterior matrices.
    -#  - Computation allocated took 0.22 seconds.
    +# - Computation allocated took 0.14 seconds.

    print(get_loglik(mashcontrast.model),digits=10)
    # [1] -105525.1375

    Use get_significant_results to find the indices of effects that are ‘significant’:

    @@ -127,15 +121,16 @@

    data.wrong = mash_set_data(Bhat = simdata$Chat %*% t(L), Shat = 1) m = mash(data.wrong, U.c)

    #  - Computing 12000 x 181 likelihood matrix.
    -#  - Likelihood calculations took 0.25 seconds.
    +#  - Likelihood calculations took 0.29 seconds.
     #  - Fitting model with 181 mixture components.
    -#  - Model fitting took 2.33 seconds.
    +#  - Model fitting took 2.26 seconds.
     #  - Computing posterior matrices.
     #  - Computation allocated took 0.07 seconds.
    print(get_loglik(m),digits = 10)
    # [1] -111355.1971

    We can see that the log likelihood is lower, since it does not consider the induced correlation.

    There are 3358 significant effects, 2932 of them are false positives. The number of false positives is much more than the one include the induced correlation.

    +
    @@ -166,7 +161,5 @@

    - - diff --git a/docs/articles/intro_mashnobaseline.html b/docs/articles/intro_mashnobaseline.html index fa74f8d..c58dadf 100644 --- a/docs/articles/intro_mashnobaseline.html +++ b/docs/articles/intro_mashnobaseline.html @@ -8,8 +8,8 @@ mashr with no common baseline • mashr - - + + -
    +
    -
    +
    +

    2019-03-11

    +
    -
    library(knitr)
    +
    +
    library(MASS)
     library(kableExtra)
    +
    # Warning: package 'kableExtra' was built under R version 3.4.4

    Introduction

    @@ -103,10 +97,10 @@

    Beta = matrix(0, nrow=n, ncol=p) for(i in 1:n){ - Beta[i,] = MASS::mvrnorm(1, rep(0, p), Utrue[[which_U[i]]]) + Beta[i,] = mvrnorm(1, rep(0, p), Utrue[[which_U[i]]]) } Shat = matrix(err_sd, nrow=n, ncol=p, byrow = TRUE) - E = MASS::mvrnorm(n, rep(0, p), Shat[1,]^2 * V) + E = mvrnorm(n, rep(0, p), Shat[1,]^2 * V) Bhat = Beta + E return(list(B = Beta, Bhat=Bhat, Shat = Shat, whichU = which_U)) }

    @@ -148,18 +142,19 @@

    m = mash(data.L, c(U.c,U.ed), algorithm.version = 'R')
    #  - Computing 2000 x 181 likelihood matrix.
    -#  - Likelihood calculations took 0.12 seconds.
    +#  - Likelihood calculations took 0.36 seconds.
     #  - Fitting model with 181 mixture components.
    -#  - Model fitting took 0.29 seconds.
    +#  - Model fitting took 0.51 seconds.
     #  - Computing posterior matrices.
     #  - Computation allocated took 0.01 seconds.

    The log likelihood is

    print(get_loglik(m),digits=10)
    -
    # [1] -10891.72235
    +
    # [1] -10891.72215

    Use get_significant_results to find the indices of effects that are ‘significant’:

    # [1] 141

    The number of false positive is 1.

    +

    @@ -188,7 +183,5 @@

    - - diff --git a/docs/articles/mash_sampling.html b/docs/articles/mash_sampling.html index bfadd29..6fe4ffd 100644 --- a/docs/articles/mash_sampling.html +++ b/docs/articles/mash_sampling.html @@ -8,8 +8,8 @@ Sample from mash posteriors • mashr - - + + -
    +
    -
    +
    +

    2019-03-11

    +
    +

    Introduction

    @@ -95,11 +88,11 @@

    Here, we draw 100 samples from the posteriors of each effect.

    m = mash(data, U.c, algorithm.version = 'R', posterior_samples = 100)
    #  - Computing 2000 x 151 likelihood matrix.
    -#  - Likelihood calculations took 0.10 seconds.
    +#  - Likelihood calculations took 0.27 seconds.
     #  - Fitting model with 151 mixture components.
    -#  - Model fitting took 0.30 seconds.
    +#  - Model fitting took 0.43 seconds.
     #  - Computing posterior matrices.
    -#  - Computation allocated took 3.33 seconds.
    +# - Computation allocated took 3.11 seconds.

    Using get_samples(m), we have a \(2000 \times 5 \times 100\) array for samples.

    If we fit the mash model without the posterior samples, we could use mash_compute_posterior_matrices to sample from the mash object.

    m$result = mash_compute_posterior_matrices(m, data, algorithm.version = 'R',
    @@ -130,6 +123,7 @@ 

    x = get_pairwise_sharing(m, factor=0.5)
     corrplot(x, method='color', cl.lim=c(0,1), type='upper', addCoef.col = "black", tl.col="black", tl.srt=45, title = 'Pairwise Sharing by Magnitude', mar = c(4,0,4,0))

    +

    @@ -159,7 +153,5 @@

    - - diff --git a/docs/articles/mash_sampling_files/figure-html/unnamed-chunk-5-1.png b/docs/articles/mash_sampling_files/figure-html/unnamed-chunk-5-1.png index f9e21ae..e8a667c 100644 Binary files a/docs/articles/mash_sampling_files/figure-html/unnamed-chunk-5-1.png and b/docs/articles/mash_sampling_files/figure-html/unnamed-chunk-5-1.png differ diff --git a/docs/articles/mash_sampling_files/figure-html/unnamed-chunk-6-1.png b/docs/articles/mash_sampling_files/figure-html/unnamed-chunk-6-1.png index 5282375..22b234c 100644 Binary files a/docs/articles/mash_sampling_files/figure-html/unnamed-chunk-6-1.png and b/docs/articles/mash_sampling_files/figure-html/unnamed-chunk-6-1.png differ diff --git a/docs/articles/simulate_noncanon.html b/docs/articles/simulate_noncanon.html index de71337..5461928 100644 --- a/docs/articles/simulate_noncanon.html +++ b/docs/articles/simulate_noncanon.html @@ -8,8 +8,8 @@ Simulation with non-canonical matrices • mashr - - + + -
    +
    -
    +
    +

    2019-03-11

    +
    +

    Goal

    @@ -120,6 +113,7 @@

    print(get_loglik(m.c.ed),digits = 10) print(get_loglik(m.true),digits = 10)

    The log-likelihood is much better from data-driven than canonical covariances. This is good! Indeed, here the data-driven fit is very slightly better fit than the true matrices, but only very slightly.

    +
    @@ -149,7 +143,5 @@

    - - diff --git a/docs/authors.html b/docs/authors.html index 9d00aed..b0fa702 100644 --- a/docs/authors.html +++ b/docs/authors.html @@ -6,7 +6,7 @@ -Authors • mashr +Citation and Authors • mashr @@ -21,19 +21,13 @@ - - - + - - - - - - - + + + @@ -46,7 +40,7 @@ -
    +
    @@ -91,8 +80,26 @@ -
    +
    + + + +

    Urbut S, Wang G, Carbonetto P and Stephens M (2019). +“Flexible statistical methods for estimating and testing effects in genomic studies with multiple conditions.” +Nature Genetics, 51(1), pp. 187–195. +

    +
    @Article{,
    +  title = {Flexible statistical methods for estimating and testing effects in genomic studies with multiple conditions},
    +  author = {Sarah Urbut and Gao Wang and Peter Carbonetto and Matthew Stephens},
    +  journal = {Nature Genetics},
    +  volume = {51},
    +  number = {1},
    +  pages = {187--195},
    +  year = {2019},
    +}
    @@ -137,8 +144,5 @@

    Authors

    - - - diff --git a/docs/index.html b/docs/index.html index dabd9ac..03ff313 100644 --- a/docs/index.html +++ b/docs/index.html @@ -8,8 +8,8 @@ Multivariate Adaptive Shrinkage • mashr - - + + - - - + - - - + + - - - @@ -60,12 +54,8 @@ - - mashr - 0.2.18.476 - + mashr
    -
    @@ -95,25 +84,21 @@ -
    +
    -

    computes matrix of condition likelihoods for each of J rows of Bhat for each of P prior covariances.

    -
    calc_lik_matrix(data, Ulist, log = FALSE, mc.cores = 1,
       algorithm.version = c("Rcpp", "R"))
    -

    Arguments

    +

    Arguments

    @@ -172,8 +157,5 @@

    Contents

    - - - diff --git a/docs/reference/calc_lik_matrix_common_cov.html b/docs/reference/calc_lik_matrix_common_cov.html index 29d0186..dab6173 100644 --- a/docs/reference/calc_lik_matrix_common_cov.html +++ b/docs/reference/calc_lik_matrix_common_cov.html @@ -21,22 +21,16 @@ - - - + - - - + + - - - @@ -59,12 +53,8 @@ - - mashr - 0.2.18.476 - + mashr - @@ -94,23 +83,19 @@ -
    +
    -

    computes matrix of likelihoods for each of J rows of Bhat for each of P prior covariances; special case when standard errors and variances are all same across j;

    -
    calc_lik_matrix_common_cov(data, Ulist, log = FALSE)
    -

    Arguments

    +

    Arguments

    @@ -163,8 +148,5 @@

    Contents

    - - - diff --git a/docs/reference/calc_lik_vector.html b/docs/reference/calc_lik_vector.html index 5f2c248..69edad2 100644 --- a/docs/reference/calc_lik_vector.html +++ b/docs/reference/calc_lik_vector.html @@ -21,23 +21,17 @@ - - - + - - - + + - - - @@ -60,12 +54,8 @@ - - mashr - 0.2.18.476 - + mashr - @@ -95,24 +84,20 @@ -
    +
    -

    Computes vector of likelihoods for bhat for each of P prior covariances.

    -
    calc_lik_vector(bhat, V, Ulist, log = FALSE)
    -

    Arguments

    +

    Arguments

    @@ -164,8 +149,5 @@

    Contents

    - - - diff --git a/docs/reference/calc_relative_lik_matrix.html b/docs/reference/calc_relative_lik_matrix.html index 1b3fc65..8cfc8f2 100644 --- a/docs/reference/calc_relative_lik_matrix.html +++ b/docs/reference/calc_relative_lik_matrix.html @@ -21,23 +21,17 @@ - - - + - - - + + - - - @@ -60,12 +54,8 @@ - - mashr - 0.2.18.476 - + mashr - @@ -95,24 +84,20 @@ -
    +
    -

    Computes matrix of relative likelihoods for each of J rows of Bhat for each of P prior covariances.

    -
    calc_relative_lik_matrix(data, Ulist, algorithm.version = c("Rcpp", "R"))
    -

    Arguments

    +

    Arguments

    @@ -169,8 +154,5 @@

    Contents

    - - - diff --git a/docs/reference/compute_alt_loglik_from_matrix_and_pi.html b/docs/reference/compute_alt_loglik_from_matrix_and_pi.html index 4c9476e..ad4c1b2 100644 --- a/docs/reference/compute_alt_loglik_from_matrix_and_pi.html +++ b/docs/reference/compute_alt_loglik_from_matrix_and_pi.html @@ -21,22 +21,16 @@ - - - + - - - + + - - - @@ -59,12 +53,8 @@ - - mashr - 0.2.18.476 - + mashr - @@ -94,23 +83,19 @@ -
    +
    -

    Compute vector of alternative loglikelihoods from a matrix of log-likelihoods and fitted pi

    -
    compute_alt_loglik_from_matrix_and_pi(pi_s, lm, Shat_alpha)
    -

    Arguments

    +

    Arguments

    @@ -151,8 +136,5 @@

    Contents

    - - - diff --git a/docs/reference/compute_loglik_from_matrix_and_pi.html b/docs/reference/compute_loglik_from_matrix_and_pi.html index 4b40dcf..acc18cf 100644 --- a/docs/reference/compute_loglik_from_matrix_and_pi.html +++ b/docs/reference/compute_loglik_from_matrix_and_pi.html @@ -21,22 +21,16 @@ - - - + - - - + + - - - @@ -59,12 +53,8 @@ - - mashr - 0.2.18.476 - + mashr - @@ -94,23 +83,19 @@ -
    +
    -

    Compute total loglikelihood from a matrix of log-likelihoods and fitted pi

    -
    compute_loglik_from_matrix_and_pi(pi_s, lm, Shat_alpha)
    -

    Arguments

    +

    Arguments

    @@ -150,8 +135,5 @@

    Contents

    - - - diff --git a/docs/reference/compute_null_loglik_from_matrix.html b/docs/reference/compute_null_loglik_from_matrix.html index bf6a752..123a174 100644 --- a/docs/reference/compute_null_loglik_from_matrix.html +++ b/docs/reference/compute_null_loglik_from_matrix.html @@ -21,22 +21,16 @@ - - - + - - - + + - - - @@ -59,12 +53,8 @@ - - mashr - 0.2.18.476 - + mashr - @@ -94,23 +83,19 @@ -
    +
    -

    Compute vector of null loglikelihoods from a matrix of log-likelihoods

    -
    compute_null_loglik_from_matrix(lm, Shat_alpha)
    -

    Arguments

    +

    Arguments

    @@ -147,8 +132,5 @@

    Contents

    - - - diff --git a/docs/reference/compute_posterior_matrices.html b/docs/reference/compute_posterior_matrices.html index e4695b9..a1bd761 100644 --- a/docs/reference/compute_posterior_matrices.html +++ b/docs/reference/compute_posterior_matrices.html @@ -21,22 +21,16 @@ - - - + - - - + + - - - @@ -59,12 +53,8 @@ - - mashr - 0.2.18.476 - + mashr - @@ -94,25 +83,21 @@ -
    +
    -

    More detailed description of function goes here.

    -
    compute_posterior_matrices(data, Ulist, posterior_weights,
       algorithm.version = c("Rcpp", "R"), A = NULL,
       output_posterior_cov = FALSE, posterior_samples = 0, seed = 123)
    -

    Arguments

    +

    Arguments

    @@ -199,8 +184,5 @@

    Contents

    - - - diff --git a/docs/reference/compute_posterior_matrices_common_cov_R.html b/docs/reference/compute_posterior_matrices_common_cov_R.html index 8c0350c..5835da4 100644 --- a/docs/reference/compute_posterior_matrices_common_cov_R.html +++ b/docs/reference/compute_posterior_matrices_common_cov_R.html @@ -21,22 +21,16 @@ - - - + - - - + + - - - @@ -59,12 +53,8 @@ - - mashr - 0.2.18.476 - + mashr - @@ -94,24 +83,20 @@ -
    +
    -

    Computes posterior matrices without allocating huge memory

    -
    compute_posterior_matrices_common_cov_R(data, A, Ulist, posterior_weights,
       output_posterior_cov = FALSE, posterior_samples = 0, seed = 123)
    -

    Arguments

    +

    Arguments

    @@ -179,8 +164,5 @@

    Contents

    - - - diff --git a/docs/reference/compute_posterior_matrices_general_R.html b/docs/reference/compute_posterior_matrices_general_R.html index 49bac3f..b83c1f0 100644 --- a/docs/reference/compute_posterior_matrices_general_R.html +++ b/docs/reference/compute_posterior_matrices_general_R.html @@ -21,22 +21,16 @@ - - - + - - - + + - - - @@ -59,12 +53,8 @@ - - mashr - 0.2.18.476 - + mashr - @@ -94,24 +83,20 @@ -
    +
    -

    Computes posterior matrices without allocating huge memory

    -
    compute_posterior_matrices_general_R(data, A, Ulist, posterior_weights,
       output_posterior_cov = FALSE, posterior_samples = 0, seed = 123)
    -

    Arguments

    +

    Arguments

    @@ -179,8 +164,5 @@

    Contents

    - - - diff --git a/docs/reference/compute_posterior_weights.html b/docs/reference/compute_posterior_weights.html index f9dbf37..0e34c21 100644 --- a/docs/reference/compute_posterior_weights.html +++ b/docs/reference/compute_posterior_weights.html @@ -21,22 +21,16 @@ - - - + - - - + + - - - @@ -59,12 +53,8 @@ - - mashr - 0.2.18.476 - + mashr - @@ -94,23 +83,19 @@ -
    +
    -

    computes posterior probabilities that each effect came from each component

    -
    compute_posterior_weights(pi, lik_mat)
    -

    Arguments

    +

    Arguments

    @@ -152,8 +137,5 @@

    Contents

    - - - diff --git a/docs/reference/compute_vloglik_from_matrix_and_pi.html b/docs/reference/compute_vloglik_from_matrix_and_pi.html index 937c936..f2eda31 100644 --- a/docs/reference/compute_vloglik_from_matrix_and_pi.html +++ b/docs/reference/compute_vloglik_from_matrix_and_pi.html @@ -21,22 +21,16 @@ - - - + - - - + + - - - @@ -59,12 +53,8 @@ - - mashr - 0.2.18.476 - + mashr - @@ -94,23 +83,19 @@ -
    +
    -

    Compute vector of loglikelihoods from a matrix of log-likelihoods and fitted pi

    -
    compute_vloglik_from_matrix_and_pi(pi_s, lm, Shat_alpha)
    -

    Arguments

    +

    Arguments

    @@ -150,8 +135,5 @@

    Contents

    - - - diff --git a/docs/reference/contrast_matrix.html b/docs/reference/contrast_matrix.html index a9554d2..a268148 100644 --- a/docs/reference/contrast_matrix.html +++ b/docs/reference/contrast_matrix.html @@ -21,22 +21,16 @@ - - - + - - - + + - - - @@ -59,12 +53,8 @@ - - mashr - 0.2.18.476 - + mashr - @@ -94,23 +83,19 @@ -
    +
    -

    Create contrast matrix

    -
    contrast_matrix(R, ref, name = 1:R)
    -

    Arguments

    +

    Arguments

    @@ -150,8 +135,5 @@

    Contents

    - - - diff --git a/docs/reference/cov_all_zeros.html b/docs/reference/cov_all_zeros.html index c905c2c..828dca4 100644 --- a/docs/reference/cov_all_zeros.html +++ b/docs/reference/cov_all_zeros.html @@ -21,22 +21,16 @@ - - - + - - - + + - - - @@ -59,12 +53,8 @@ - - mashr - 0.2.18.476 - + mashr - @@ -94,23 +83,19 @@ -
    +
    -

    Compute an R by R matrix of all 0s

    -
    cov_all_zeros(data)
    -

    Arguments

    +

    Arguments

    @@ -148,8 +133,5 @@

    Contents

    - - - diff --git a/docs/reference/cov_canonical.html b/docs/reference/cov_canonical.html index 5e02555..f69abd2 100644 --- a/docs/reference/cov_canonical.html +++ b/docs/reference/cov_canonical.html @@ -21,22 +21,16 @@ - - - + - - - + + - - - @@ -59,12 +53,8 @@ - - mashr - 0.2.18.476 - + mashr - @@ -94,24 +83,20 @@ -
    +
    -

    Compute a list of canonical covariance matrices

    -
    cov_canonical(data, cov_methods = c("identity", "singletons",
       "equal_effects", "simple_het"))
    -

    Arguments

    +

    Arguments

    @@ -226,8 +211,5 @@

    Contents

    - - - diff --git a/docs/reference/cov_ed.html b/docs/reference/cov_ed.html index b66588f..f5ec68d 100644 --- a/docs/reference/cov_ed.html +++ b/docs/reference/cov_ed.html @@ -21,22 +21,16 @@ - - - + - - - + + - + - - - @@ -59,12 +53,8 @@ - - mashr - 0.2.18.476 - + mashr - @@ -94,23 +83,19 @@ -
    +
    -

    Perform "extreme deconvolution" (Bovy et al) on a subset of the data

    -
    cov_ed(data, Ulist_init, subset = NULL, ...)
    -

    Arguments

    +

    Arguments

    @@ -161,8 +146,5 @@

    Contents

    - - - diff --git a/docs/reference/cov_equal_effects.html b/docs/reference/cov_equal_effects.html index 373b40b..66d0433 100644 --- a/docs/reference/cov_equal_effects.html +++ b/docs/reference/cov_equal_effects.html @@ -21,22 +21,16 @@ - - - + - - - + + - - - @@ -59,12 +53,8 @@ - - mashr - 0.2.18.476 - + mashr - @@ -94,23 +83,19 @@ -
    +
    -

    Compute an R by R matrix of all 1s

    -
    cov_equal_effects(data)
    -

    Arguments

    +

    Arguments

    @@ -148,8 +133,5 @@

    Contents

    - - - diff --git a/docs/reference/cov_first_singleton.html b/docs/reference/cov_first_singleton.html index d0e5694..515d80e 100644 --- a/docs/reference/cov_first_singleton.html +++ b/docs/reference/cov_first_singleton.html @@ -21,22 +21,16 @@ - - - + - - - + + - - - @@ -59,12 +53,8 @@ - - mashr - 0.2.18.476 - + mashr - @@ -94,23 +83,19 @@ -
    +
    -

    Compute all the singleton matrices corresponding to condition-specific effects in first condition only; used for testing purposes

    -
    cov_first_singleton(data)
    -

    Arguments

    +

    Arguments

    @@ -148,8 +133,5 @@

    Contents

    - - - diff --git a/docs/reference/cov_from_factors.html b/docs/reference/cov_from_factors.html index 48180ef..9b58a1b 100644 --- a/docs/reference/cov_from_factors.html +++ b/docs/reference/cov_from_factors.html @@ -21,22 +21,16 @@ - - - + - - - + + - - - @@ -59,12 +53,8 @@ - - mashr - 0.2.18.476 - + mashr - @@ -94,23 +83,19 @@ -
    +
    -

    produce list of rank 1 covariance matrices corresponding to rows of f

    -
    cov_from_factors(f, name)
    -

    Arguments

    +

    Arguments

    @@ -152,8 +137,5 @@

    Contents

    - - - diff --git a/docs/reference/cov_pca.html b/docs/reference/cov_pca.html index 14a6466..507e98c 100644 --- a/docs/reference/cov_pca.html +++ b/docs/reference/cov_pca.html @@ -21,22 +21,16 @@ - - - + - - - + + - - - @@ -59,12 +53,8 @@ - - mashr - 0.2.18.476 - + mashr - @@ -94,23 +83,19 @@ -
    +
    -

    Perform PCA on data and return list of candidate covariance matrices

    -
    cov_pca(data, npc, subset = NULL)
    -

    Arguments

    +

    Arguments

    @@ -157,8 +142,5 @@

    Contents

    - - - diff --git a/docs/reference/cov_simple_het.html b/docs/reference/cov_simple_het.html index 74bb848..cba872b 100644 --- a/docs/reference/cov_simple_het.html +++ b/docs/reference/cov_simple_het.html @@ -21,22 +21,16 @@ - - - + - - - + + - - - @@ -59,12 +53,8 @@ - - mashr - 0.2.18.476 - + mashr - @@ -94,23 +83,19 @@ -
    +
    -

    Compute covariance matrices with diagonal element 1 and off-diagonal element corr

    -
    cov_simple_het(data, corr = c(0.25, 0.5, 0.75))
    -

    Arguments

    +

    Arguments

    @@ -152,8 +137,5 @@

    Contents

    - - - diff --git a/docs/reference/cov_udi.html b/docs/reference/cov_udi.html index 7fe6d5e..2693382 100644 --- a/docs/reference/cov_udi.html +++ b/docs/reference/cov_udi.html @@ -22,24 +22,18 @@ - - - + - - - + + +"Unassociated", "Directly associated" and "Indirectly associated" models" /> - - - @@ -62,12 +56,8 @@ - - mashr - 0.2.18.476 - + mashr - @@ -97,25 +86,21 @@ -
    +
    -

    Compute a list of covariance matrices corresponding to the "Unassociated", "Directly associated" and "Indirectly associated" models

    -
    cov_udi(data, model = udi_model_matrix(n_conditions(data)))
    -

    Arguments

    +

    Arguments

    @@ -168,8 +153,5 @@

    Contents

    - - - diff --git a/docs/reference/cov_udi_single.html b/docs/reference/cov_udi_single.html index 48cb614..e94ee95 100644 --- a/docs/reference/cov_udi_single.html +++ b/docs/reference/cov_udi_single.html @@ -21,22 +21,16 @@ - - - + - - - + + - - - @@ -59,12 +53,8 @@ - - mashr - 0.2.18.476 - + mashr - @@ -94,23 +83,19 @@ -
    +
    -

    computes the covariance matrix for a single UDI model

    -
    cov_udi_single(data, model)
    -

    Arguments

    +

    Arguments

    @@ -147,8 +132,5 @@

    Contents

    - - - diff --git a/docs/reference/ed_wrapper.html b/docs/reference/ed_wrapper.html index a3baf5f..3af43d4 100644 --- a/docs/reference/ed_wrapper.html +++ b/docs/reference/ed_wrapper.html @@ -21,22 +21,16 @@ - - - + - - - + + - - - @@ -59,12 +53,8 @@ - - mashr - 0.2.18.476 - + mashr - @@ -94,23 +83,19 @@ -
    +
    -

    Fit extreme deconvolution to mash data

    -
    ed_wrapper(data, Ulist_init, subset = NULL, ...)
    -

    Arguments

    +

    Arguments

    @@ -167,8 +152,5 @@

    Contents

    - - - diff --git a/docs/reference/estimate_null_correlation.html b/docs/reference/estimate_null_correlation.html index 16f2ce1..1812ba6 100644 --- a/docs/reference/estimate_null_correlation.html +++ b/docs/reference/estimate_null_correlation.html @@ -21,22 +21,16 @@ - - - + - - - + + - - - @@ -59,12 +53,8 @@ - - mashr - 0.2.18.476 - + mashr - @@ -94,25 +83,21 @@ -
    +
    -

    Estimates a null correlation matrix from data

    -
    -
    estimate_null_correlation(data, Ulist, init, max_iter = 50,
    -  tol = 0.001, est_cor = TRUE, track_fit = FALSE,
    -  prior = c("nullbiased", "uniform"), ...)
    +
    estimate_null_correlation(data, Ulist, init, max_iter = 30, tol = 1,
    +  est_cor = TRUE, track_fit = FALSE, prior = c("nullbiased",
    +  "uniform"), details = FALSE, ...)
    -

    Arguments

    +

    Arguments

    @@ -137,7 +122,7 @@

    Arg

    - + @@ -147,15 +132,32 @@

    Arg

    + + + +
    est_cor

    whether to estimate correlation matrix. If it is False, we estimate the covairance matrix

    whether to estimate correlation matrix (TRUE) or the covariance matrix (FALSE)

    track_fitprior

    indicates what penalty to use on the likelihood, if any

    details

    whether to return details of the model, if it is TRUE, the number of iterations and the value of objective functions will be returned

    ...

    other parameters pass to mash

    +

    Value

    + +

    the estimated correlation (or covariance) matrix and the fitted mash model

    +
    V

    estimated correlation (or covariance) matrix

    +
    mash.model

    fitted mash model

    + +

    Details

    -

    Returns the estimated correlation/covariance matrix of the effects

    +

    Returns the estimated correlation matrix (or covariance matrix) among conditions under the null. +The correlation (or covariance) matrix is estimated by maximum likelihood. +Specifically, the unknown correlation/covariance matrix V and the unknown weights are estimated iteratively. +The unknown correlation/covariance matrix V is estimated using the posterior second moment of the noise. +The unknown weights pi is estimated by maximum likelihood, which is a convex problem.

    +

    Warning: This method could take some time. +The estimate_null_correlation_simple gives a quick approximation for the null correlation (or covariance) matrix.

    @@ -164,6 +166,8 @@

    Contents

    @@ -182,8 +186,5 @@

    Contents

    - - - diff --git a/docs/reference/estimate_null_correlation_simple.html b/docs/reference/estimate_null_correlation_simple.html index ea2086c..0dbd1f5 100644 --- a/docs/reference/estimate_null_correlation_simple.html +++ b/docs/reference/estimate_null_correlation_simple.html @@ -6,7 +6,7 @@ -Estimate null correlations (ad hoc) — estimate_null_correlation_simple • mashr +Estimate null correlations (simple) — estimate_null_correlation_simple • mashr @@ -21,22 +21,16 @@ - - - + - - - - + + + - - - @@ -59,12 +53,8 @@ - - mashr - 0.2.18.476 - + mashr
    -
    @@ -94,23 +83,19 @@ -
    +
    -

    Estimates a null correlation matrix from data using simple z score threshold

    -
    estimate_null_correlation_simple(data, z_thresh = 2, est_cor = TRUE)
    -

    Arguments

    +

    Arguments

    @@ -123,13 +108,15 @@

    Arg

    - +
    est_cor

    whether to estimate correlation matrix. If it is False, we estimate the covairance matrix

    whether to estimate correlation matrix (TRUE) or the covariance matrix (FALSE).

    Details

    -

    Returns the empirical correlation matrix of the effects that are "null" based on simple z score threshold

    +

    Returns a simple estimate of the correlation matrix (or covariance matrix) among conditions under the null. +Specifically, the simple estimate is the empirical correlation (or covariance) matrix of the z scores +for those effects that have (absolute) z score < z_thresh in all conditions.

    @@ -156,8 +143,5 @@

    Contents

    - - - diff --git a/docs/reference/expand_cov.html b/docs/reference/expand_cov.html index c73a2e3..4f57edd 100644 --- a/docs/reference/expand_cov.html +++ b/docs/reference/expand_cov.html @@ -21,22 +21,16 @@ - - - + - - - + + - - - @@ -59,12 +53,8 @@ - - mashr - 0.2.18.476 - + mashr
    -
    @@ -94,23 +83,19 @@ -
    +
    -

    Create expanded list of covariance matrices expanded by grid, Sigma_lk = omega_l U_k

    -
    expand_cov(Ulist, grid, usepointmass = TRUE)
    -

    Arguments

    +

    Arguments

    @@ -158,8 +143,5 @@

    Contents

    - - - diff --git a/docs/reference/extreme_deconvolution.html b/docs/reference/extreme_deconvolution.html new file mode 100644 index 0000000..6c60ca0 --- /dev/null +++ b/docs/reference/extreme_deconvolution.html @@ -0,0 +1,320 @@ + + + + + + + + +Density estimation using Gaussian mixtures in the presence of noisy, +heterogeneous and incomplete data — extreme_deconvolution • mashr + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + +
    + +
    +
    + + + +

    We present a general algorithm to infer a d-dimensional distribution +function given a set of heterogeneous, noisy observations or samples. This +algorithm reconstructs the error-deconvolved or 'underlying' distribution +function common to all samples, even when the individual samples have unique +error and missing-data properties. The underlying distribution is modeled as +a mixture of Gaussians, which is completely general. Model parameters are +chosen to optimize a justified, scalar objective function: the logarithm of +the probability of the data under the error-convolved model, where the error +convolution is different for each data point. Optimization is performed by +an Expectation Maximization (EM) algorithm, extended by a regularization +technique and 'split-and-merge' procedure. These extensions mitigate +problems with singularities and local maxima, which are often encountered +when using the EM algorithm to estimate Gaussian density mixtures.

    + + +
    extreme_deconvolution(ydata,ycovar,xamp,xmean,xcovar,
    +projection=NULL,weight=NULL, fixamp=NULL,fixmean=NULL,fixcovar=NULL,
    +tol=1.e-6,maxiter=1e9,w=0,logfile=NULL,
    +splitnmerge=0,maxsnm=FALSE,likeonly=FALSE, logweight=FALSE)
    + +

    Arguments

    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    ydata

    [ndata,dy] matrix of observed quantities

    ycovar

    [ndata,dy] / [ndata,dy,dy] / [dy,dy,ndata] matrix, list or 3D +array of observational error covariances (if [ndata,dy] then the error +correlations are assumed to vanish)

    xamp

    [ngauss] array of initial amplitudes (*not* [1,ngauss])

    xmean

    [ngauss,dx] matrix of initial means

    xcovar

    [ngauss,dx,dx] list of matrices of initial covariances

    projection

    [ndata,dy,dx] list of projection matrices

    weight

    [ndata] array of weights to be applied to the data points

    fixamp

    (default=None) None, True/False, or list of bools

    fixmean

    (default=None) None, True/False, or list of bools

    fixcovar

    (default=None) None, True/False, or list of bools

    tol

    (double, default=1.e-6) tolerance for convergence

    maxiter

    (long, default= 10**9) maximum number of iterations to +perform

    w

    (double, default=0.) covariance regularization parameter (of the +conjugate prior)

    logfile

    basename for several logfiles (_c.log has output from the +c-routine; _loglike.log has the log likelihood path of all the accepted +routes, i.e. only parts which increase the likelihood are included, during +splitnmerge)

    splitnmerge

    (int, default=0) depth to go down the splitnmerge path

    maxsnm

    (Bool, default=False) use the maximum number of split 'n' +merge steps, K*(K-1)*(K-2)/2

    likeonly

    (Bool, default=False) only compute the total log likelihood +of the data

    logweight

    (bool, default=False) if True, weight is actually +log(weight)

    + +

    Value

    + + + +
    avgloglikedata

    avgloglikedata after convergence

    +
    xamp

    updated xamp

    xmean

    updated xmean

    xcovar

    updated +xcovar

    + + +

    References

    + +

    Inferring complete distribution functions from noisy, +heterogeneous and incomplete observations Jo Bovy, David W. Hogg, & Sam T. +Roweis, Submitted to AOAS (2009) [arXiv/0905.2979]

    + + +

    Examples

    +
    ydata <- +c(2.62434536, 0.38824359, 0.47182825, -0.07296862, 1.86540763, + -1.30153870, 2.74481176, 0.23879310, 1.31903910, 0.75062962, + 2.46210794, -1.06014071, 0.67758280, 0.61594565, 2.13376944, + -0.09989127, 0.82757179, 0.12214158, 1.04221375, 1.58281521, + -0.10061918, 2.14472371, 1.90159072, 1.50249434, 1.90085595, + 0.31627214, 0.87710977, 0.06423057, 0.73211192, 1.53035547, + 0.30833925, 0.60324647, 0.31282730, 0.15479436, 0.32875387, + 0.98733540, -0.11731035, 1.23441570, 2.65980218, 1.74204416, + 0.80816445, 0.11237104, 0.25284171, 2.69245460, 1.05080775, + 0.36300435, 1.19091548, 3.10025514, 1.12015895, 1.61720311, + 1.30017032, 0.64775015, -0.14251820, 0.65065728, 0.79110577, + 1.58662319, 1.83898341, 1.93110208, 1.28558733, 1.88514116, + 0.24560206, 2.25286816, 1.51292982, 0.70190717, 1.48851815, + 0.92442829, 2.13162939, 2.51981682, 3.18557541, -0.39649633, + -0.44411380, 0.49553414, 1.16003707, 1.87616892, 1.31563495, + -1.02220122, 0.69379599, 1.82797464, 1.23009474, 1.76201118, + 0.77767186, 0.79924193, 1.18656139, 1.41005165, 1.19829972, + 1.11900865, 0.32933771, 1.37756379, 1.12182127, 2.12948391, + 2.19891788, 1.18515642, 0.62471505, 0.36126959, 1.42349435, + 1.07734007, 0.65614632, 1.04359686, 0.37999916, 1.69803203, + 0.55287144, 2.22450770, 1.40349164, 1.59357852, -0.09491185, + 1.16938243, 1.74055645, 0.04629940, 0.73378149, 1.03261455, + -0.37311732, 1.31515939, 1.84616065, 0.14048406, 1.35054598, + -0.31228341, 0.96130449, -0.61577236, 2.12141771, 1.40890054, + 0.97538304, 0.22483838, 2.27375593, 2.96710175, -0.85798186, + 2.23616403, 2.62765075, 1.33801170, -0.19926803, 1.86334532, + 0.81907970, 0.39607937, -0.23005814, 1.55053750, 1.79280687, + 0.37646927, 1.52057634, -0.14434139, 1.80186103, 1.04656730, + 0.81343023, 0.89825413, 1.86888616, 1.75041164, 1.52946532, + 1.13770121, 1.07782113, 1.61838026, 1.23249456, 1.68255141, + 0.68988323, -1.43483776, 2.03882460, 3.18697965, 1.44136444, + 0.89984477, 0.86355526, 0.88094581, 1.01740941, -0.12201873, + 0.48290554, 0.00297317, 1.24879916, 0.70335885, 1.49521132, + 0.82529684, 1.98633519, 1.21353390, 3.19069973, -0.89636092, + 0.35308331, 1.90148689, 3.52832571, 0.75136522, 1.04366899, + 0.77368576, 2.33145711, 0.71269214, 1.68006984, 0.68019840, + -0.27255875, 1.31354772, 1.50318481, 2.29322588, 0.88955297, + 0.38263794, 1.56276110, 1.24073709, 1.28066508, 0.92688730, + 2.16033857, 1.36949272, 2.90465871, 2.11105670, 1.65904980, + -0.62743834, 1.60231928, 1.42028220, 1.81095167, 2.04444209) + +ydata <- matrix(ydata,length(ydata),1) +N <- dim(ydata)[1] +ycovar <- ydata*0 + 0.01 +xamp <- c(0.5,0.5) +xmean <- matrix(c(0.86447943, 0.67078879, 0.322681, 0.45087394),2,2) +xcovar <- + list(matrix(c(0.03821028, 0.04014796, 0.04108113, 0.03173839),2,2), + matrix(c(0.06219194, 0.09738021, 0.04302473, 0.06778009),2,2)) +projection <- list() +for (i in 1:N) + projection[[i]] = matrix(c(i%%2,(i+1)%%2),1,2) +res <- extreme_deconvolution(ydata, ycovar, xamp, xmean, xcovar, + projection=projection, logfile="ExDeconDemo")
    +
    + +
    + +
    + + +
    +

    Site built with pkgdown.

    +
    + +
    +
    + + + diff --git a/docs/reference/get_estimated_pi.html b/docs/reference/get_estimated_pi.html index cc75bde..8831587 100644 --- a/docs/reference/get_estimated_pi.html +++ b/docs/reference/get_estimated_pi.html @@ -21,22 +21,16 @@ - - - + - - - + + - - - @@ -59,12 +53,8 @@ - - mashr - 0.2.18.476 - + mashr
    -
    @@ -94,23 +83,19 @@ -
    +
    -

    Return the estimated mixture proportions

    -
    get_estimated_pi(m, dimension = c("cov", "grid", "all"))
    -

    Arguments

    +

    Arguments

    @@ -164,8 +149,5 @@

    Contents

    - - - diff --git a/docs/reference/get_log10bf.html b/docs/reference/get_log10bf.html index e3deab0..644370d 100644 --- a/docs/reference/get_log10bf.html +++ b/docs/reference/get_log10bf.html @@ -21,22 +21,16 @@ - - - + - - - + + - - - @@ -59,12 +53,8 @@ - - mashr - 0.2.18.476 - + mashr - @@ -94,23 +83,19 @@ -
    +
    -

    Return the Bayes Factor for each effect

    -
    get_log10bf(m)
    -

    Arguments

    +

    Arguments

    @@ -150,8 +135,5 @@

    Contents

    - - - diff --git a/docs/reference/get_n_significant_conditions.html b/docs/reference/get_n_significant_conditions.html index c743f4f..5326d2a 100644 --- a/docs/reference/get_n_significant_conditions.html +++ b/docs/reference/get_n_significant_conditions.html @@ -21,22 +21,16 @@ - - - + - - - + + - - - @@ -59,12 +53,8 @@ - - mashr - 0.2.18.476 - + mashr - @@ -94,24 +83,20 @@ -
    +
    -

    Count number of conditions each effect is significant in

    -
    get_n_significant_conditions(m, thresh = 0.05, conditions = NULL,
       sig_fn = get_lfsr)
    -

    Arguments

    +

    Arguments

    @@ -161,8 +146,5 @@

    Contents

    - - - diff --git a/docs/reference/get_pairwise_sharing.html b/docs/reference/get_pairwise_sharing.html index e81484b..d5763db 100644 --- a/docs/reference/get_pairwise_sharing.html +++ b/docs/reference/get_pairwise_sharing.html @@ -21,22 +21,16 @@ - - - + - - - + + - - - @@ -59,12 +53,8 @@ - - mashr - 0.2.18.476 - + mashr - @@ -94,24 +83,20 @@ -
    +
    -

    Compute the proportion of (significant) signals shared by magnitude in each pair of conditions, based on the poterior mean

    -
    get_pairwise_sharing(m, factor = 0.5, lfsr_thresh = 0.05,
       FUN = identity)
    -

    Arguments

    +

    Arguments

    @@ -172,8 +157,5 @@

    Contents

    - - - diff --git a/docs/reference/get_pairwise_sharing_from_samples.html b/docs/reference/get_pairwise_sharing_from_samples.html index 57d5ae4..e03e03d 100644 --- a/docs/reference/get_pairwise_sharing_from_samples.html +++ b/docs/reference/get_pairwise_sharing_from_samples.html @@ -21,22 +21,16 @@ - - - + - - - + + - - - @@ -59,12 +53,8 @@ - - mashr - 0.2.18.476 - + mashr - @@ -94,24 +83,20 @@ -
    +
    -

    Compute the proportion of (significant) signals shared by magnitude in each pair of conditions

    -
    get_pairwise_sharing_from_samples(m, factor = 0.5, lfsr_thresh = 0.05,
       FUN = identity)
    -

    Arguments

    +

    Arguments

    @@ -171,8 +156,5 @@

    Contents

    - - - diff --git a/docs/reference/get_samples.html b/docs/reference/get_samples.html index d2a471b..7362b6c 100644 --- a/docs/reference/get_samples.html +++ b/docs/reference/get_samples.html @@ -21,22 +21,16 @@ - - - + - - - + + - - - @@ -59,12 +53,8 @@ - - mashr - 0.2.18.476 - + mashr - @@ -94,27 +83,33 @@ -
    +
    -

    Return samples from a mash object

    -
    get_samples(m)
    - + +

    Arguments

    +
    + + + + + +
    m

    The mash fit.

    +
    @@ -132,8 +127,5 @@

    Contents

    - - - diff --git a/docs/reference/get_significant_results.html b/docs/reference/get_significant_results.html index 0a1d2e1..f50538a 100644 --- a/docs/reference/get_significant_results.html +++ b/docs/reference/get_significant_results.html @@ -21,22 +21,16 @@ - - - + - - - + + - - - @@ -59,12 +53,8 @@ - - mashr - 0.2.18.476 - + mashr
    -
    @@ -94,24 +83,20 @@ -
    +
    -

    Find effects that are significant in at least one condition

    -
    get_significant_results(m, thresh = 0.05, conditions = NULL,
       sig_fn = get_lfsr)
    -

    Arguments

    +

    Arguments

    @@ -161,8 +146,5 @@

    Contents

    - - - diff --git a/docs/reference/index.html b/docs/reference/index.html index 15ed9f4..7e98735 100644 --- a/docs/reference/index.html +++ b/docs/reference/index.html @@ -21,19 +21,13 @@ - - - + - - - + + - - - @@ -56,12 +50,8 @@ - - mashr - 0.2.18.495 - + mashr - @@ -91,376 +80,387 @@ -
    -
    +
    +
    -
    +
    +
    - - - - - + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - + + + - - - - - - - - - - - - + + + + + + + + + + + - - -
    -

    All functions

    -

    -
    -

    calc_lik_matrix()

    -

    Compute matrix of conditional likelihoods.

    -

    calc_lik_matrix_common_cov()

    -

    calc_lik_matrix_common_cov

    -

    calc_lik_vector()

    -

    Compute conditional likelihoods for bhat vector.

    -

    calc_relative_lik_matrix()

    -

    Calculate matrix of relative likelihoods.

    -

    compute_alt_loglik_from_matrix_and_pi()

    -

    Compute vector of alternative loglikelihoods from a matrix of log-likelihoods and fitted pi

    -

    compute_loglik_from_matrix_and_pi()

    -

    Compute total loglikelihood from a matrix of log-likelihoods and fitted pi

    -

    compute_null_loglik_from_matrix()

    -

    Compute vector of null loglikelihoods from a matrix of log-likelihoods

    -

    compute_posterior_matrices()

    -

    Compute posterior matrices.

    -

    compute_posterior_matrices_common_cov_R()

    -

    Compute posterior matrices (when error covariance V_j is equal for all observations j)

    -

    compute_posterior_matrices_general_R()

    -

    Compute posterior matrices (general version)

    -

    compute_posterior_weights()

    -

    compute posterior probabilities

    -

    compute_vloglik_from_matrix_and_pi()

    -

    Compute vector of loglikelihoods from a matrix of log-likelihoods and fitted pi

    -

    contrast_matrix()

    -

    Create contrast matrix

    -

    cov_all_zeros()

    -

    Compute an R by R matrix of all 0s

    -

    cov_canonical()

    -

    Compute a list of canonical covariance matrices

    -

    cov_ed()

    -

    Perform "extreme deconvolution" (Bovy et al) on a subset of the data

    -

    cov_equal_effects()

    -

    Compute an R by R matrix of all 1s

    -

    cov_first_singleton()

    -

    Compute all the singleton matrices corresponding to condition-specific effects in first condition only; used for testing purposes

    -

    cov_from_factors()

    -

    produce list of rank 1 covariance matrices corresponding to rows of f

    -

    cov_pca()

    -

    Perform PCA on data and return list of candidate covariance matrices

    -

    cov_simple_het()

    -

    Compute covariance matrices with diagonal element 1 and off-diagonal element corr

    -

    cov_udi()

    -

    Compute a list of covariance matrices corresponding to the +

    +

    All functions

    +

    +
    +

    calc_lik_matrix_common_cov

    +

    calc_lik_matrix_common_cov

    +

    calc_lik_matrix

    +

    Compute matrix of conditional likelihoods.

    +

    calc_lik_vector

    +

    Compute conditional likelihoods for bhat vector.

    +

    calc_relative_lik_matrix

    +

    Calculate matrix of relative likelihoods.

    +

    compute_alt_loglik_from_matrix_and_pi

    +

    Compute vector of alternative loglikelihoods from a matrix of log-likelihoods and fitted pi

    +

    compute_loglik_from_matrix_and_pi

    +

    Compute total loglikelihood from a matrix of log-likelihoods and fitted pi

    +

    compute_null_loglik_from_matrix

    +

    Compute vector of null loglikelihoods from a matrix of log-likelihoods

    +

    compute_posterior_matrices_common_cov_R

    +

    Compute posterior matrices (when error covariance V_j is equal for all observations j)

    +

    compute_posterior_matrices_general_R

    +

    Compute posterior matrices (general version)

    +

    compute_posterior_matrices

    +

    Compute posterior matrices.

    +

    compute_posterior_weights

    +

    compute posterior probabilities

    +

    compute_vloglik_from_matrix_and_pi

    +

    Compute vector of loglikelihoods from a matrix of log-likelihoods and fitted pi

    +

    contrast_matrix

    +

    Create contrast matrix

    +

    cov_all_zeros

    +

    Compute an R by R matrix of all 0s

    +

    cov_canonical

    +

    Compute a list of canonical covariance matrices

    +

    cov_ed

    +

    Perform "extreme deconvolution" (Bovy et al) on a subset of the data

    +

    cov_equal_effects

    +

    Compute an R by R matrix of all 1s

    +

    cov_first_singleton

    +

    Compute all the singleton matrices corresponding to condition-specific effects in first condition only; used for testing purposes

    +

    cov_from_factors

    +

    produce list of rank 1 covariance matrices corresponding to rows of f

    +

    cov_pca

    +

    Perform PCA on data and return list of candidate covariance matrices

    +

    cov_simple_het

    +

    Compute covariance matrices with diagonal element 1 and off-diagonal element corr

    +

    cov_udi_single

    +

    computes the covariance matrix for a single UDI model

    +

    cov_udi

    +

    Compute a list of covariance matrices corresponding to the "Unassociated", "Directly associated" and "Indirectly associated" models

    -

    cov_udi_single()

    -

    computes the covariance matrix for a single UDI model

    -

    ed_wrapper()

    -

    Fit extreme deconvolution to mash data

    -

    estimate_null_correlation()

    -

    Estimate null correlations

    -

    estimate_null_correlation_simple()

    -

    Estimate null correlations (ad hoc)

    -

    expand_cov()

    -

    Create expanded list of covariance matrices expanded by grid, Sigma_lk = omega_l U_k

    -

    get_estimated_pi()

    -

    Return the estimated mixture proportions

    -

    get_log10bf()

    -

    Return the Bayes Factor for each effect

    -

    get_n_significant_conditions()

    -

    Count number of conditions each effect is significant in

    -

    get_pairwise_sharing()

    -

    Compute the proportion of (significant) signals shared by magnitude in each pair of conditions, based on the poterior mean

    -

    get_pairwise_sharing_from_samples()

    -

    Compute the proportion of (significant) signals shared by magnitude in each pair of conditions

    -

    get_samples()

    -

    Return samples from a mash object

    -

    get_significant_results()

    -

    Find effects that are significant in at least one condition

    -

    initialize_pi()

    -

    Initialize mixture proportions - currently by making them all equal

    -

    is_common_cov_Shat()

    -

    Check that all covariances are equal (Shat).

    -

    is_common_cov_Shat_alpha()

    -

    Check that all rows of Shat_alpha are the same.

    -

    make_names()

    -

    Create names for covariance matrices

    -

    mash()

    -

    Apply mash method to data

    -

    mash_1by1()

    -

    Perform condition-by-condition analyses

    -

    mash_compute_loglik()

    -

    Compute loglikelihood for fitted mash object on new data.

    -

    mash_compute_posterior_matrices()

    -

    Compute posterior matrices for fitted mash object on new data

    -

    mash_compute_vloglik()

    -

    Compute vector of loglikelihood for fitted mash object on new data.

    -

    mash_plot_meta()

    -

    Plot metaplot for an effect based on posterior from mash

    -

    mash_set_data()

    -

    Create a data object for mash analysis.

    -

    mash_set_data_contrast()

    -

    Create a data object for mash contrast analysis

    -

    mash_update_data()

    -

    Update the data object for mash analysis.

    -

    optimize_pi()

    -

    Estimate the mixture weights by maximum (penalized) likelihood

    -

    posterior_cov()

    -

    posterior_cov

    -

    posterior_mean()

    -

    posterior_mean

    -

    posterior_mean_matrix()

    -

    posterior_mean_matrix

    -

    scale_cov()

    -

    Scale each covariance matrix in list Ulist by a scalar in vector grid

    -

    sim_contrast1()

    -

    Create simplest simulation, cj = mu 1 +

    +

    ed_wrapper

    +

    Fit extreme deconvolution to mash data

    +

    estimate_null_correlation_simple

    +

    Estimate null correlations (simple)

    +

    estimate_null_correlation

    +

    Estimate null correlations

    +

    expand_cov

    +

    Create expanded list of covariance matrices expanded by grid, Sigma_lk = omega_l U_k

    +

    extreme_deconvolution

    +

    Density estimation using Gaussian mixtures in the presence of noisy, +heterogeneous and incomplete data

    +

    get_estimated_pi

    +

    Return the estimated mixture proportions

    +

    get_log10bf

    +

    Return the Bayes Factor for each effect

    +

    get_n_significant_conditions

    +

    Count number of conditions each effect is significant in

    +

    get_pairwise_sharing_from_samples

    +

    Compute the proportion of (significant) signals shared by magnitude in each pair of conditions

    +

    get_pairwise_sharing

    +

    Compute the proportion of (significant) signals shared by magnitude in each pair of conditions, based on the poterior mean

    +

    get_samples

    +

    Return samples from a mash object

    +

    get_significant_results

    +

    Find effects that are significant in at least one condition

    +

    initialize_pi

    +

    Initialize mixture proportions - currently by making them all equal

    +

    is_common_cov_Shat_alpha

    +

    Check that all rows of Shat_alpha are the same.

    +

    is_common_cov_Shat

    +

    Check that all covariances are equal (Shat).

    +

    make_names

    +

    Create names for covariance matrices

    +

    mash_1by1

    +

    Perform condition-by-condition analyses

    +

    mash_compute_loglik

    +

    Compute loglikelihood for fitted mash object on new data.

    +

    mash_compute_posterior_matrices

    +

    Compute posterior matrices for fitted mash object on new data

    +

    mash_compute_vloglik

    +

    Compute vector of loglikelihood for fitted mash object on new data.

    +

    mash_plot_meta

    +

    Plot metaplot for an effect based on posterior from mash

    +

    mash_set_data_contrast

    +

    Create a data object for mash contrast analysis

    +

    mash_set_data

    +

    Create a data object for mash analysis.

    +

    mash_update_data

    +

    Update the data object for mash analysis.

    +

    mash

    +

    Apply mash method to data

    +

    optimize_pi

    +

    Estimate the mixture weights by maximum (penalized) likelihood

    +

    posterior_cov

    +

    posterior_cov

    +

    posterior_mean_matrix

    +

    posterior_mean_matrix

    +

    posterior_mean

    +

    posterior_mean

    +

    scale_cov

    +

    Scale each covariance matrix in list Ulist by a scalar in vector grid

    +

    sim_contrast1

    +

    Create simplest simulation, cj = mu 1 data used for contrast analysis

    -

    sim_contrast2()

    -

    Create simulation with signal data used for contrast +

    +

    sim_contrast2

    +

    Create simulation with signal data used for contrast analysis.

    -

    simple_sims()

    -

    Create some simple simulated data for testing purposes

    -

    simple_sims2()

    -

    Create some more simple simulated data for testing purposes

    -

    udi_model_matrix()

    -

    Create a matrix whose rows contain all possible +

    +

    simple_sims

    +

    Create some simple simulated data for testing purposes

    +

    simple_sims2

    +

    Create some more simple simulated data for testing purposes

    +

    udi_model_matrix

    +

    Create a matrix whose rows contain all possible combinations of the U,D,I models that are allowed.

    + + + +
    - - - diff --git a/docs/reference/initialize_pi.html b/docs/reference/initialize_pi.html index 874efef..1525fb7 100644 --- a/docs/reference/initialize_pi.html +++ b/docs/reference/initialize_pi.html @@ -21,22 +21,16 @@ - - - + - - - + + - - - @@ -59,12 +53,8 @@ - - mashr - 0.2.18.476 - + mashr
    -
    @@ -94,23 +83,19 @@ -
    +
    -

    Initialize mixture proportions - currently by making them all equal

    -
    initialize_pi(K)
    -

    Arguments

    +

    Arguments

    @@ -148,8 +133,5 @@

    Contents

    - - - diff --git a/docs/reference/is_common_cov_Shat.html b/docs/reference/is_common_cov_Shat.html index 17c0ca7..f2a2b3c 100644 --- a/docs/reference/is_common_cov_Shat.html +++ b/docs/reference/is_common_cov_Shat.html @@ -21,23 +21,17 @@ - - - + - - - + + - - - @@ -60,12 +54,8 @@ - - mashr - 0.2.18.476 - + mashr - @@ -95,24 +84,20 @@ -
    +
    -

    checks if all rows of Shat are the same - if so covariances are equal

    -
    is_common_cov_Shat(data)
    -

    Arguments

    +

    Arguments

    @@ -144,8 +129,5 @@

    Contents

    - - - diff --git a/docs/reference/is_common_cov_Shat_alpha.html b/docs/reference/is_common_cov_Shat_alpha.html index 4907ed1..adfbf88 100644 --- a/docs/reference/is_common_cov_Shat_alpha.html +++ b/docs/reference/is_common_cov_Shat_alpha.html @@ -21,22 +21,16 @@ - - - + - - - + + - - - @@ -59,12 +53,8 @@ - - mashr - 0.2.18.476 - + mashr - @@ -94,23 +83,19 @@ -
    +
    -

    checks if all rows of Shat_alpha are the same

    -
    is_common_cov_Shat_alpha(data)
    -

    Arguments

    +

    Arguments

    @@ -142,8 +127,5 @@

    Contents

    - - - diff --git a/docs/reference/make_names.html b/docs/reference/make_names.html index 76aa642..2af3d9e 100644 --- a/docs/reference/make_names.html +++ b/docs/reference/make_names.html @@ -21,22 +21,16 @@ - - - + - - - + + - - - @@ -59,12 +53,8 @@ - - mashr - 0.2.18.476 - + mashr - @@ -94,23 +83,19 @@ -
    +
    -

    Create names for covariance matrices

    -
    make_names(names, suffixes)
    -

    Arguments

    +

    Arguments

    @@ -146,8 +131,5 @@

    Contents

    - - - diff --git a/docs/reference/mash.html b/docs/reference/mash.html index 667c12d..1cfd46a 100644 --- a/docs/reference/mash.html +++ b/docs/reference/mash.html @@ -21,22 +21,16 @@ - - - + - - - + + - - - @@ -59,12 +53,8 @@ - - mashr - 0.2.18.476 - + mashr - @@ -94,28 +83,25 @@ -
    +
    -

    Apply mash method to data

    -
    mash(data, Ulist = NULL, gridmult = sqrt(2), grid = NULL,
       normalizeU = TRUE, usepointmass = TRUE, g = NULL, fixg = FALSE,
    -  prior = c("nullbiased", "uniform"), optmethod = c("mixIP", "mixEM",
    -  "mixSQP", "cxxMixSquarem"), verbose = TRUE, add.mem.profile = FALSE,
    -  algorithm.version = c("Rcpp", "R"), pi_thresh = 1e-10, A = NULL,
    -  posterior_samples = 0, seed = 123, outputlevel = 2)
    + prior = c("nullbiased", "uniform"), optmethod = c("mixSQP", "mixIP", + "mixEM", "cxxMixSquarem"), control = list(), verbose = TRUE, + add.mem.profile = FALSE, algorithm.version = c("Rcpp", "R"), + pi_thresh = 1e-10, A = NULL, posterior_samples = 0, seed = 123, + outputlevel = 2) -

    Arguments

    +

    Arguments

    @@ -158,6 +144,10 @@

    Arg

    + + + + @@ -188,7 +178,7 @@

    Arg

    - +
    optmethod

    name of optimization method to use

    control

    A list of control parameters passed to optmethod.

    verbose

    If TRUE, print progress to R console.

    outputlevel

    controls amount of computation / output; 1: output only estimated mixture component proportions, 2: and posterior estimates, 3: and posterior covariance matrices, 4: and likelihood matrices and posterior weights

    controls amount of computation / output; 1: output only estimated mixture component proportions, 2: and posterior estimates, 3: and posterior covariance matrices, 4: and likelihood matrices

    @@ -234,8 +224,5 @@

    Contents

    - - - diff --git a/docs/reference/mash_1by1.html b/docs/reference/mash_1by1.html index c4e4b3a..8fcc91e 100644 --- a/docs/reference/mash_1by1.html +++ b/docs/reference/mash_1by1.html @@ -21,25 +21,19 @@ - - - + - - - + + - - - - @@ -62,12 +56,8 @@ - - mashr - 0.2.18.476 - + mashr
    -
    @@ -97,26 +86,22 @@ -
    +
    -

    Performs simple "condition-by-condition" analysis by running ash from package ashr on data from each condition, one at a time. May be a useful first step to identify top hits in each condition before a mash analysis.

    -
    mash_1by1(data, alpha = 0)
    -

    Arguments

    +

    Arguments

    @@ -162,8 +147,5 @@

    Contents

    - - - diff --git a/docs/reference/mash_compute_loglik.html b/docs/reference/mash_compute_loglik.html index 2ebb24a..dea44b6 100644 --- a/docs/reference/mash_compute_loglik.html +++ b/docs/reference/mash_compute_loglik.html @@ -21,22 +21,16 @@ - - - + - - - + + - - - @@ -59,12 +53,8 @@ - - mashr - 0.2.18.476 - + mashr - @@ -94,23 +83,19 @@ -
    +
    -

    Compute loglikelihood for fitted mash object on new data.

    -
    mash_compute_loglik(g, data, algorithm.version = c("Rcpp", "R"))
    -

    Arguments

    +

    Arguments

    @@ -164,8 +149,5 @@

    Contents

    - - - diff --git a/docs/reference/mash_compute_posterior_matrices.html b/docs/reference/mash_compute_posterior_matrices.html index d495d34..b9d9ddb 100644 --- a/docs/reference/mash_compute_posterior_matrices.html +++ b/docs/reference/mash_compute_posterior_matrices.html @@ -21,22 +21,16 @@ - - - + - - - + + - - - @@ -59,12 +53,8 @@ - - mashr - 0.2.18.476 - + mashr - @@ -94,25 +83,21 @@ -
    +
    -

    Compute posterior matrices for fitted mash object on new data

    -
    mash_compute_posterior_matrices(g, data, pi_thresh = 1e-10,
       algorithm.version = c("Rcpp", "R"), A = NULL,
       output_posterior_cov = FALSE, posterior_samples = 0, seed = 123)
    -

    Arguments

    +

    Arguments

    @@ -178,8 +163,5 @@

    Contents

    - - - diff --git a/docs/reference/mash_compute_vloglik.html b/docs/reference/mash_compute_vloglik.html index 20236fb..e223bb4 100644 --- a/docs/reference/mash_compute_vloglik.html +++ b/docs/reference/mash_compute_vloglik.html @@ -21,22 +21,16 @@ - - - + - - - + + - - - @@ -59,12 +53,8 @@ - - mashr - 0.2.18.476 - + mashr - @@ -94,23 +83,19 @@ -
    +
    -

    Compute vector of loglikelihood for fitted mash object on new data.

    -
    mash_compute_vloglik(g, data, algorithm.version = c("Rcpp", "R"))
    -

    Arguments

    +

    Arguments

    @@ -173,8 +158,5 @@

    Contents

    - - - diff --git a/docs/reference/mash_plot_meta.html b/docs/reference/mash_plot_meta.html index a859edf..b8fba5c 100644 --- a/docs/reference/mash_plot_meta.html +++ b/docs/reference/mash_plot_meta.html @@ -21,22 +21,16 @@ - - - + - - - + + - - - @@ -59,12 +53,8 @@ - - mashr - 0.2.18.476 - + mashr - @@ -94,23 +83,19 @@ -
    +
    -

    Plot metaplot for an effect based on posterior from mash

    -
    mash_plot_meta(m, i, xlab = "Effect size", ylab = "Condition", ...)
    -

    Arguments

    +

    Arguments

    @@ -158,8 +143,5 @@

    Contents

    - - - diff --git a/docs/reference/mash_set_data.html b/docs/reference/mash_set_data.html index b7bdcd3..f736b3e 100644 --- a/docs/reference/mash_set_data.html +++ b/docs/reference/mash_set_data.html @@ -21,22 +21,16 @@ - - - + - - - + + - - - @@ -59,12 +53,8 @@ - - mashr - 0.2.18.476 - + mashr - @@ -94,24 +83,20 @@ -
    +
    -

    Create a data object for mash analysis.

    -
    mash_set_data(Bhat, Shat = NULL, alpha = 0, df = Inf, pval = NULL,
       V = diag(ncol(Bhat)))
    -

    Arguments

    +

    Arguments

    @@ -146,9 +131,9 @@

    Arg

    -
    V

    an R by R correlation matrix of error correlations; must +

    an R by R matrix / [R x R x J] array of effect specific correlation matrix of error correlations; must be positive definite. [So Bhat_j distributed as N(B_j,diag(Shat_j) -V diag(Shat_j)) where _j denotes the jth row of a matrix]. +V_j diag(Shat_j)) where _j denotes the jth row of a matrix]. Defaults to identity.

    @@ -182,8 +167,5 @@

    Contents

    - - - diff --git a/docs/reference/mash_set_data_contrast.html b/docs/reference/mash_set_data_contrast.html index ed5fef3..7942b10 100644 --- a/docs/reference/mash_set_data_contrast.html +++ b/docs/reference/mash_set_data_contrast.html @@ -21,22 +21,16 @@ - - - + - - - + + - - - @@ -59,12 +53,8 @@ - - mashr - 0.2.18.476 - + mashr
    -
    @@ -94,23 +83,19 @@ -
    +
    -

    Create a data object for mash contrast analysis

    -
    mash_set_data_contrast(mashdata, L)
    -

    Arguments

    +

    Arguments

    @@ -152,8 +137,5 @@

    Contents

    - - - diff --git a/docs/reference/mash_update_data.html b/docs/reference/mash_update_data.html index c8f4299..f22df72 100644 --- a/docs/reference/mash_update_data.html +++ b/docs/reference/mash_update_data.html @@ -21,22 +21,17 @@ - - - + - - - + + - + - - - @@ -59,12 +54,8 @@ - - mashr - 0.2.18.476 - + mashr - @@ -94,23 +84,20 @@ -
    +
    -
    -

    Update the data object for mash analysis.

    +

    This function can update two parts of the mash data. The first one is setting the reference group, so the mash data +can be used for commonbaseline analysis. The other one is updating the null correlation matrix.

    -
    mash_update_data(mashdata, ref = NULL, V = NULL)
    -

    Arguments

    +

    Arguments

    @@ -123,7 +110,7 @@

    Arg

    - +
    V

    a correlation matrix for the null effects

    an R by R matrix / [R x R x J] array of correlation matrix of error correlations

    @@ -156,8 +143,5 @@

    Contents

    - - - diff --git a/docs/reference/optimize_pi.html b/docs/reference/optimize_pi.html index 7a43b37..6f0a031 100644 --- a/docs/reference/optimize_pi.html +++ b/docs/reference/optimize_pi.html @@ -21,22 +21,16 @@ - - - + - - - + + - - - @@ -59,12 +53,8 @@ - - mashr - 0.2.18.476 - + mashr
    -
    @@ -94,25 +83,21 @@ -
    +
    -

    Estimate the mixture weights by maximum (penalized) likelihood

    -
    optimize_pi(matrix_lik, pi_init = NULL, prior = NULL,
    -  optmethod = c("mixIP", "mixEM", "mixSQP", "cxxMixSquarem"),
    +  optmethod = c("mixSQP", "mixIP", "mixEM", "cxxMixSquarem"),
       control = list())
    -

    Arguments

    +

    Arguments

    @@ -166,8 +151,5 @@

    Contents

    - - - diff --git a/docs/reference/posterior_cov.html b/docs/reference/posterior_cov.html index 5d2f1ad..dc55620 100644 --- a/docs/reference/posterior_cov.html +++ b/docs/reference/posterior_cov.html @@ -21,22 +21,16 @@ - - - + - - - + + - - - @@ -59,12 +53,8 @@ - - mashr - 0.2.18.476 - + mashr - @@ -94,23 +83,19 @@ -
    +
    -

    If bhat is N(b,V) and b is N(0,U) then b|bhat N(mu1,U1). This function returns U1.

    -
    posterior_cov(Vinv, U)
    -

    Arguments

    +

    Arguments

    @@ -152,8 +137,5 @@

    Contents

    - - - diff --git a/docs/reference/posterior_mean.html b/docs/reference/posterior_mean.html index 03be869..f715e64 100644 --- a/docs/reference/posterior_mean.html +++ b/docs/reference/posterior_mean.html @@ -21,22 +21,16 @@ - - - + - - - + + - - - @@ -59,12 +53,8 @@ - - mashr - 0.2.18.476 - + mashr - @@ -94,23 +83,19 @@ -
    +
    -

    If bhat is N(b,V) and b is N(0,U) then b|bhat N(mu1,U1). This function returns mu1.

    -
    posterior_mean(bhat, Vinv, U1)
    -

    Arguments

    +

    Arguments

    @@ -156,8 +141,5 @@

    Contents

    - - - diff --git a/docs/reference/posterior_mean_matrix.html b/docs/reference/posterior_mean_matrix.html index ddd6ac6..26bfd7d 100644 --- a/docs/reference/posterior_mean_matrix.html +++ b/docs/reference/posterior_mean_matrix.html @@ -21,24 +21,18 @@ - - - + - - - + + - - - @@ -61,12 +55,8 @@ - - mashr - 0.2.18.476 - + mashr - @@ -96,25 +85,21 @@ -
    +
    -

    Computes posterior mean under multivariate normal model for each row of matrix Bhat. Note that if bhat is N_R(b,V) and b is N_R(0,U) then b|bhat N_R(mu1,U1). This function returns a matrix with jth row equal to mu1(bhat) for bhat= Bhat[j,].

    -
    posterior_mean_matrix(Bhat, Vinv, U1)
    -

    Arguments

    +

    Arguments

    @@ -160,8 +145,5 @@

    Contents

    - - - diff --git a/docs/reference/scale_cov.html b/docs/reference/scale_cov.html index 64408c9..0c8dee6 100644 --- a/docs/reference/scale_cov.html +++ b/docs/reference/scale_cov.html @@ -21,22 +21,16 @@ - - - + - - - + + - - - @@ -59,12 +53,8 @@ - - mashr - 0.2.18.476 - + mashr - @@ -94,23 +83,19 @@ -
    +
    -

    Scale each covariance matrix in list Ulist by a scalar in vector grid

    -
    scale_cov(Ulist, grid)
    -

    Arguments

    +

    Arguments

    @@ -152,8 +137,5 @@

    Contents

    - - - diff --git a/docs/reference/sim_contrast1.html b/docs/reference/sim_contrast1.html index 53d3165..020e10a 100644 --- a/docs/reference/sim_contrast1.html +++ b/docs/reference/sim_contrast1.html @@ -22,24 +22,18 @@ - - - + - - - + + - - - @@ -62,12 +56,8 @@ - - mashr - 0.2.18.476 - + mashr - @@ -97,25 +86,21 @@ -
    +
    -

    Create simplest simulation, cj = mu 1 data used for contrast analysis

    -
    sim_contrast1(nsamp = 100, ncond = 5, err_sd = sqrt(0.5))
    -

    Arguments

    +

    Arguments

    @@ -161,8 +146,5 @@

    Contents

    - - - diff --git a/docs/reference/sim_contrast2.html b/docs/reference/sim_contrast2.html index 92bbdc6..122dd14 100644 --- a/docs/reference/sim_contrast2.html +++ b/docs/reference/sim_contrast2.html @@ -22,24 +22,18 @@ - - - + - - - + + - - - @@ -62,12 +56,8 @@ - - mashr - 0.2.18.476 - + mashr - @@ -97,25 +86,21 @@ -
    +
    -

    Create simulation with signal data used for contrast analysis.

    -
    sim_contrast2(nsamp = 1000, ncond = 5, err_sd = sqrt(0.5))
    -

    Arguments

    +

    Arguments

    @@ -166,8 +151,5 @@

    Contents

    - - - diff --git a/docs/reference/simple_sims.html b/docs/reference/simple_sims.html index 2dcc546..c7d4f71 100644 --- a/docs/reference/simple_sims.html +++ b/docs/reference/simple_sims.html @@ -21,22 +21,16 @@ - - - + - - - + + - - - @@ -59,12 +53,8 @@ - - mashr - 0.2.18.476 - + mashr - @@ -94,23 +83,19 @@ -
    +
    -

    Create some simple simulated data for testing purposes

    -
    simple_sims(nsamp = 100, ncond = 5, err_sd = 0.01)
    -

    Arguments

    +

    Arguments

    @@ -156,8 +141,5 @@

    Contents

    - - - diff --git a/docs/reference/simple_sims2.html b/docs/reference/simple_sims2.html index 10d1b75..3922be5 100644 --- a/docs/reference/simple_sims2.html +++ b/docs/reference/simple_sims2.html @@ -21,22 +21,16 @@ - - - + - - - + + - - - @@ -59,12 +53,8 @@ - - mashr - 0.2.18.476 - + mashr - @@ -94,23 +83,19 @@ -
    +
    -

    Create some more simple simulated data for testing purposes

    -
    simple_sims2(nsamp = 100, err_sd = 0.01)
    -

    Arguments

    +

    Arguments

    @@ -153,8 +138,5 @@

    Contents

    - - - diff --git a/docs/reference/udi_model_matrix.html b/docs/reference/udi_model_matrix.html index 7cc5ba7..e63945f 100644 --- a/docs/reference/udi_model_matrix.html +++ b/docs/reference/udi_model_matrix.html @@ -22,24 +22,18 @@ - - - + - - - + + - - - @@ -62,12 +56,8 @@ - - mashr - 0.2.18.476 - + mashr - @@ -97,25 +86,21 @@ -
    +
    -

    Create a matrix whose rows contain all possible combinations of the U,D,I models that are allowed.

    -
    udi_model_matrix(R)
    -

    Arguments

    +

    Arguments

    @@ -155,8 +140,5 @@

    Contents

    - - -