estimate_shrinkage_prior: Estimate the prior needed for LFC shrinkage

Description Usage Arguments Value

View source: R/estimate_shrinkage_prior.R

Description

estimate_shrinkage_prior, for each cell type, matches the 95 percentile of absolute values of all log fold changes (LFCs) to the 97.5 percentile of a zero-centered normal distribution. It also matches the 95 percentile of absolute values of all cell type-specific expressions on log scale to the 97.5 percentile of a zero-centered normal distribution.

Usage

1
estimate_shrinkage_prior(estimates, K, M, H, prob = 0.95)

Arguments

estimates

A matrix of K (number of cell type-independent variables) + H (number of cell types) * M (number of groups) + 1 (overdispersion) columns. The estimates need to be obtained without using LFC shrinkage.

K

number of cell type-independent variables

M

number of group

H

number of cell types

prob

a number to match prob quantile of absolute value of parameter estimates to prob confidence interval

Value

a vector of length K + H * (M + 1). The first K entries are 0, the next H * M entries are based on 1/sigma^2 of length H of the normal prior for each cell type-specific LFC, and the last M entries are based on 1/sigma^2 of length 1 of the normal prior for the cell type-specific intercept terms.


Sun-lab/CARseq documentation built on Oct. 7, 2021, 1:52 p.m.