solveDampenedWLSj: Solve overdetermined system of equations, Sx=B, for x, using...

Description Usage Arguments Value Examples

View source: R/functions.R

Description

Dampened weighted least squares involves solving:

min_{x>0} ∑_{i=1}^n w_i(B_i-(Sx)_i)^2

through an iterative approach. The dampening constant determines the allowed maximum value of the weights. S is a gene by cell-type signature matrix, B is a list containing bulk data, and x is the number of cells from each cell type present in the bulk data. x is then normalized:

\tilde{x} = \frac{x}{∑_{j=1}^n x},

where j is the cell-type index.

Usage

1
    solveDampenedWLSj(S, B, goldstandard, j)   

Arguments

S

Gene by cell-type matrix consisting of averaged expression values across cells from each cell type

B

List containing bulk data values.

goldstandard

An initial estimate of the number of each cell type present in the bulk data set. Often this estimate is derived from the solveOLS function.

j

Positive integer defining the dampening constant. The maximum weight value allowed will be d=2^(j-1)

Value

List containing proportion of each cell type present in bulk data set.

Examples

1
    prop <- solveDampenedWLSj(S, B, solveOLS(S,B), 5)

PelzKo/dwls documentation built on Dec. 18, 2021, 6:46 a.m.