susie_get_objective | R Documentation |
These functions access basic properties or draw inferences from a fitted susie model.
susie_get_objective(res, last_only = TRUE, warning_tol = 1e-06)
susie_get_posterior_mean(res, prior_tol = 1e-09)
susie_get_posterior_sd(res, prior_tol = 1e-09)
susie_get_niter(res)
susie_get_prior_variance(res)
susie_get_residual_variance(res)
susie_get_lfsr(res)
susie_get_posterior_samples(susie_fit, num_samples)
susie_get_cs(
res,
X = NULL,
Xcorr = NULL,
coverage = 0.95,
min_abs_corr = 0.5,
dedup = TRUE,
squared = FALSE
)
susie_get_pip(res, prune_by_cs = FALSE, prior_tol = 1e-09)
res |
A susie fit, typically an output from
|
last_only |
If |
warning_tol |
Warn if ELBO is decreasing by this tolerance level. |
prior_tol |
Filter out effects having estimated prior variance smaller than this threshold. |
susie_fit |
A susie fit, an output from |
num_samples |
The number of draws from the posterior distribution. |
X |
n by p matrix of values of the p variables (covariates) in
n samples. When provided, correlation between variables will be
computed and used to remove CSs whose minimum correlation among
variables is smaller than |
Xcorr |
p by p matrix of correlations between variables
(covariates). When provided, it will be used to remove CSs whose
minimum correlation among variables is smaller than
|
coverage |
A number between 0 and 1 specifying desired coverage of each CS. |
min_abs_corr |
A "purity" threshold for the CS. Any CS that contains a pair of variables with correlation less than this threshold will be filtered out and not reported. |
dedup |
If |
squared |
If |
prune_by_cs |
Whether or not to ignore single effects not in a reported CS when calculating PIP. |
susie_get_objective
returns the evidence lower bound
(ELBO) achieved by the fitted susie model and, optionally, at each
iteration of the IBSS fitting procedure.
susie_get_residual_variance
returns the (estimated or
fixed) residual variance parameter.
susie_get_prior_variance
returns the (estimated or fixed)
prior variance parameters.
susie_get_posterior_mean
returns the posterior mean for the
regression coefficients of the fitted susie model.
susie_get_posterior_sd
returns the posterior standard
deviation for coefficients of the fitted susie model.
susie_get_niter
returns the number of model fitting
iterations performed.
susie_get_pip
returns a vector containing the posterior
inclusion probabilities (PIPs) for all variables.
susie_get_lfsr
returns a vector containing the average lfsr
across variables for each single-effect, weighted by the posterior
inclusion probability (alpha).
susie_get_posterior_samples
returns a list containing the
effect sizes samples and causal status with two components: b
,
an num_variables
x num_samples
matrix of effect
sizes; gamma
, an num_variables
x num_samples
matrix of causal status random draws.
susie_get_cs
returns credible sets (CSs) from a susie fit,
as well as summaries of correlation among the variables included in
each CS. If desired, one can filter out CSs that do not meet a
specified “purity” threshold; to do this, either X
or
Xcorr
must be supplied. It returns a list with the following
elements:
cs |
A list in which each list element is a vector containing the indices of the variables in the CS. |
coverage |
The nominal coverage specified for each CS. |
purity |
If |
cs_index |
If |
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))
s = susie(X,y,L = 10)
susie_get_objective(s)
susie_get_objective(s, last_only=FALSE)
susie_get_residual_variance(s)
susie_get_prior_variance(s)
susie_get_posterior_mean(s)
susie_get_posterior_sd(s)
susie_get_niter(s)
susie_get_pip(s)
susie_get_lfsr(s)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.