Performs SuSiE regression using z-scores and correlation matrix. Supports both standard RSS (lambda = 0) and RSS with regularized LD matrix (lambda > 0).
Usage
susie_rss(
z = NULL,
R,
n = NULL,
bhat = NULL,
shat = NULL,
var_y = NULL,
L = min(10, ncol(R)),
lambda = 0,
maf = NULL,
maf_thresh = 0,
z_ld_weight = 0,
prior_variance = 50,
scaled_prior_variance = 0.2,
residual_variance = NULL,
prior_weights = NULL,
null_weight = 0,
standardize = TRUE,
intercept_value = 0,
estimate_residual_variance = FALSE,
estimate_residual_method = c("MoM", "MLE"),
estimate_prior_variance = TRUE,
estimate_prior_method = c("optim", "EM", "simple"),
unmappable_effects = c("none", "inf"),
check_null_threshold = 0,
prior_tol = 1e-09,
residual_variance_lowerbound = 0,
residual_variance_upperbound = Inf,
model_init = NULL,
coverage = 0.95,
min_abs_corr = 0.5,
max_iter = 100,
tol = 0.001,
convergence_method = c("elbo", "pip"),
verbose = FALSE,
track_fit = FALSE,
check_input = FALSE,
check_prior = TRUE,
check_R = TRUE,
check_z = FALSE,
n_purity = 100,
r_tol = 1e-08,
refine = FALSE
)Arguments
- z
A p-vector of z-scores.
- R
A p by p correlation matrix.
- n
The sample size, not required but recommended.
- bhat
Alternative summary data giving the estimated effects (a vector of length p). This, together with
shat, may be provided instead ofz.- shat
Alternative summary data giving the standard errors of the estimated effects (a vector of length p). This, together with
bhat, may be provided instead ofz.- var_y
The sample variance of y, defined as \(y'y/(n-1)\). When the sample variance is not provided, the coefficients (returned from
coef) are computed on the “standardized” X, y scale.- L
Maximum number of non-zero effects in the model. If L is larger than the number of covariates, p, L is set to p.
- lambda
Regularization parameter for LD matrix. When
lambda> 0, you cannot useunmappable_effectsmethods.- maf
A p-vector of minor allele frequencies; to be used along with
maf_threshto filter input summary statistics.- maf_thresh
Variants with MAF smaller than this threshold are not used.
- z_ld_weight
This parameter is included for backwards compatibility with previous versions of the function, but it is no longer recommended to set this to a non-zero value. When
z_ld_weight > 0, the matrixRis adjusted to becov2cor((1-w)*R + w*tcrossprod(z)), wherew = z_ld_weight.- prior_variance
This specifies the prior variance parameter for the SuSiE-RSS variant with the “regularized” LD matrix R. This is ignored when
lambda = 0.- scaled_prior_variance
The prior variance, divided by
var(y)(or by(1/(n-1))ytyforsusie_ss); that is, the prior variance of each non-zero element of b isvar(y) * scaled_prior_variance. The value provided should be either a scalar or a vector of lengthL. Ifestimate_prior_variance = TRUE, this provides initial estimates of the prior variances.- residual_variance
Variance of the residual. If
estimate_residual_variance = TRUE, this value provides the initial estimate of the residual variance. By default, it is set tovar(y)insusieand(1/(n-1))ytyinsusie_ss.- prior_weights
A vector of length p, in which each entry gives the prior probability that corresponding column of X has a nonzero effect on the outcome, y.
- null_weight
Prior probability of no effect (a number between 0 and 1, and cannot be exactly 1).
- standardize
If
standardize = TRUE, standardize the columns of X to unit variance prior to fitting (or equivalently standardize XtX and Xty to have the same effect). Note thatscaled_prior_variancespecifies the prior on the coefficients of X after standardization (if it is performed). If you do not standardize, you may need to think more carefully about specifyingscaled_prior_variance. Whatever your choice, the coefficients returned bycoefare given forXon the original input scale. Any column ofXthat has zero variance is not standardized.- intercept_value
Real number specifying the intercept. This is ignored when
lambda = 0.- estimate_residual_variance
The default is FALSE, the residual variance is fixed to 1 or variance of y. If the in-sample LD matrix is provided, we recommend setting
estimate_residual_variance = TRUE.- estimate_residual_method
The method used for estimating residual variance. For the original SuSiE model, "MLE" and "MoM" estimation is equivalent, but for the infinitesimal model, "MoM" is more stable. We recommend using "Servin_Stephens" when n < 80 for improved coverage, although it is currently only implemented for individual-level data.
- estimate_prior_variance
If
estimate_prior_variance = TRUE, the prior variance is estimated (this is a separate parameter for each of the L effects). If provided,scaled_prior_varianceis then used as an initial value for the optimization. Whenestimate_prior_variance = FALSE, the prior variance for each of the L effects is determined by the value supplied toscaled_prior_variance.- estimate_prior_method
The method used for estimating prior variance. When
estimate_prior_method = "simple"is used, the likelihood at the specified prior variance is compared to the likelihood at a variance of zero, and the setting with the larger likelihood is retained.- unmappable_effects
The method for modeling unmappable effects: "none", "inf", "ash".
- 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
check_null_threshold = 0.1, this will "nudge" the estimate towards zero when the difference in log-likelihoods is small. A note of caution that setting this to a value greater than zero may lead the IBSS fitting procedure to occasionally decrease the ELBO. This setting is disabled when usingunmappable_effects = "inf"orunmappable_effects = "ash".- prior_tol
When the prior variance is estimated, compare the estimated value to
prior_tolat the end of the computation, and exclude a single effect from PIP computation if the estimated prior variance is smaller than this tolerance value.- residual_variance_lowerbound
Lower limit on the estimated residual variance. It is only relevant when
estimate_residual_variance = TRUE.- residual_variance_upperbound
Upper limit on the estimated residual variance. It is only relevant when
estimate_residual_variance = TRUE.- model_init
A previous susie fit with which to initialize.
- 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.
- max_iter
Maximum number of IBSS iterations to perform.
- tol
tol A small, non-negative number specifying the convergence tolerance for the IBSS fitting procedure.
- convergence_method
When
converge_method = "elbo"the fitting procedure halts when the difference in the variational lower bound, or “ELBO” (the objective function to be maximized), is less thantol. Whenconverge_method = "pip"the fitting procedure halts when the maximum absolute difference inalphais less thantol.- verbose
If
verbose = TRUE, the algorithm's progress, a summary of the optimization settings, and refinement progress (ifrefine = TRUE) are printed to the console.- track_fit
If
track_fit = TRUE,traceis also returned containing detailed information about the estimates at each iteration of the IBSS fitting procedure.- check_input
If
check_input = TRUE,susie_ssperforms additional checks onXtXandXty. The checks are: (1) check thatXtXis positive semidefinite; (2) check thatXtyis in the space spanned by the non-zero eigenvectors ofXtX.- check_prior
If
check_prior = TRUE, it checks if the estimated prior variance becomes unreasonably large (comparing with 10 * max(abs(z))^2).- check_R
If TRUE, check that R is positive semidefinite.
- check_z
If TRUE, check that z lies in column space of R.
- n_purity
Passed as argument
n_puritytosusie_get_cs.- r_tol
Tolerance level for eigenvalue check of positive semidefinite matrix
XtX.- refine
If
refine = TRUE, then an additional iterative refinement procedure is used, after the IBSS algorithm, to check and escape from local optima (see details).