estimate_densities_modT: Estimate parameters under the null and alternative densities

Description Usage Arguments Details Value

View source: R/density_estimation.R

Description

Estimate the parameters of the null and alternative density functions using moderated t-statistics.

Usage

1
2
estimate_densities_modT(betas, sds, df, alt_prop, mafs = NULL,
  N = NULL)

Arguments

betas

vector of coefficient estimates.

sds

vector of standard errors (for coefficient estimates).

df

scalar or vector of first degrees of freedom of the F-distribution (usually, N-p-1).

alt_prop

proportion of test statistics from the alternative density.

mafs

vector of minor allele frequencies (MAFs) (optional). If NULL, no adjustment will be made for MAF in variance calculations.

N

scalar or vector of number of subjects (optional). Should be specified if mafs!=NULL.

Details

Following Smyth (2004), the function calculates moderated t-statistics using conditional posterior means of the variance. The moderated t-statistics are used to estimate the null density under a t-distribution and the alternative density under a scaled t-distribution, each with moderated degrees of freedom.

Value

A list with the following elements:

Tstat_mod matrix of moderated t-statistics.
df_mod vector of the moderated degrees of freedom.
scaler vector of the scaling factors for the moderated t-statistics under the alternative.
prior_df scalar of the prior degrees of freedom.
prior_var scalar of the prior variance estimator.
unscaled_var scalar of the unscaled variance prior on non-zero coefficients.

kjgleason/primo documentation built on Sept. 7, 2021, 5:21 p.m.