estimateBetaParamsFromCounts: Estimate parameters of a Beta distribution from counts

View source: R/estimateBetaParamsFromCounts.R

estimateBetaParamsFromCountsR Documentation

Estimate parameters of a Beta distribution from counts

Description

This function estimates the two parameters of the Beta distribution, alpha and beta for each cell type. The input is a matrix of cell type counts, where the rows are the cell types/clusters and the columns are the samples.

Usage

estimateBetaParamsFromCounts(x)

Arguments

x

a matrix of counts

Details

This function is called from the plotting function plotCellTypeMeanVar in order to estimate the variance for the Beta-Binomial distribution for each cell type.

Value

outputs a list object with the following components

n

Normalised library size

alpha

a vector of alpha parameters for the Beta distribution for each cell type

beta

vector of beta parameters for the Beta distribution for each cell type

pi

Estimate of the true proportion for each cell type

dispersion

Dispersion estimates for each cell type

var

Variance estimates for each cell type

Author(s)

Belinda Phipson

Examples

data <- speckle_example_data()
x <- table(data$clusters, data$samples)
estimateBetaParamsFromCounts(x)



Oshlack/speckle documentation built on Oct. 16, 2022, 9:39 a.m.