susie_rss | R Documentation |
susie_rss
performs sum of single-effect linear
regression with z scores; all posterior calculations are for
z-scores. This function fits the regression model z = \sum_l
R*b_l + e
, where e is N(0,R)
and \sum_l b_l
is a
p-vector of effects to be estimated. The required summary data are
the p by p correlation matrix, R
, and the p-vector z
.
susie_rss(
z,
R,
maf = NULL,
maf_thresh = 0,
z_ld_weight = 0,
L = 10,
prior_variance = 50,
residual_variance = NULL,
prior_weights = NULL,
null_weight = NULL,
estimate_residual_variance = FALSE,
estimate_prior_variance = TRUE,
estimate_prior_method = c("optim", "EM", "simple"),
check_null_threshold = 0,
prior_tol = 1e-09,
max_iter = 100,
s_init = NULL,
intercept_value = 0,
coverage = 0.95,
min_abs_corr = 0.5,
tol = 0.001,
verbose = FALSE,
track_fit = FALSE,
check_R = FALSE,
r_tol = 1e-08,
refine = FALSE
)
z |
A p-vector of z scores. |
R |
A p by p symmetric, positive semidefinite correlation matrix. |
maf |
Minor allele frequency; to be used along with
|
maf_thresh |
Variants having a minor allele frequency smaller than this threshold are not used. |
z_ld_weight |
This feature is not recommended. The weights
assigned to the z scores in the LD matrix. If |
L |
Number of components (nonzero coefficients) in the susie regression model. If L is larger than the number of covariates, p, L is set to p. |
prior_variance |
The prior variance. It is either a scalar or a vector of length L. |
residual_variance |
Variance of the residual. If it is not specified, we set it to 1. |
prior_weights |
A vector of length p, in which each entry gives the prior probability that SNP j has non-zero effect. |
null_weight |
Prior probability of no effect (a number between 0 and 1, and cannot be exactly 1). |
estimate_residual_variance |
The residual variance is
fixed to the value supplied by |
estimate_prior_variance |
If |
estimate_prior_method |
The method used for estimating prior
variance. When |
check_null_threshold |
When the prior variance is estimated,
compare the estimate with the null, and set the prior variance to
zero unless the log-likelihood using the estimate is larger by this
threshold amount. For example, if you set
|
prior_tol |
When the prior variance is estimated, compare the
estimated value to |
max_iter |
Maximum number of IBSS iterations to perform. |
s_init |
A previous susie fit with which to initialize. |
intercept_value |
The intercept. (The intercept cannot be
estimated from centered summary data.) This setting will be used by
|
coverage |
A number between 0 and 1 specifying the “coverage” of the estimated confidence sets. |
min_abs_corr |
Minimum absolute correlation allowed in a credible set. The default, 0.5, corresponds to a squared correlation of 0.25, which is a commonly used threshold for genotype data in genetic studies. |
tol |
A small, non-negative number specifying the convergence
tolerance for the IBSS fitting procedure. The fitting procedure
will halt when the difference in the variational lower bound, or
“ELBO” (the objective function to be maximized), is
less than |
verbose |
If |
track_fit |
If |
check_R |
If |
r_tol |
Tolerance level for eigenvalue check of positive semidefinite matrix of R. |
refine |
If |
A "susie"
object with some or all of the following
elements:
alpha |
An L by p matrix of posterior inclusion probabilites. |
mu |
An L by p matrix of posterior means, conditional on inclusion. |
mu2 |
An L by p matrix of posterior second moments, conditional on inclusion. |
lbf |
log-Bayes Factor for each single effect. |
lbf_variable |
log-Bayes Factor for each variable and single effect. |
intercept |
Fixed Intercept. |
sigma2 |
Fixed Residual variance. |
V |
Prior variance of the non-zero elements of b, equal to
|
elbo |
The value of the variational lower bound, or “ELBO” (objective function to be maximized), achieved at each iteration of the IBSS fitting procedure. |
fitted |
Vector of length n containing the fitted values of the outcome. |
sets |
Credible sets estimated from model fit; see
|
pip |
A vector of length p giving the (marginal) posterior inclusion probabilities for all p covariates. |
niter |
Number of IBSS iterations that were performed. |
converged |
|
Rr |
An p-vector of |
set.seed(1)
n = 1000
p = 1000
beta = rep(0,p)
beta[1:4] = 1
X = matrix(rnorm(n*p),nrow = n,ncol = p)
X = scale(X,center = TRUE,scale = TRUE)
y = drop(X %*% beta + rnorm(n))
input_ss <- compute_ss(X,y,standardize = TRUE)
ss <- univariate_regression(X,y)
R <- with(input_ss,cov2cor(XtX))
zhat <- with(ss,betahat/sebetahat)
res <- susie_rss(zhat,R,L = 10)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.