npem.start: Obtain approximate starting values for npem.em

View source: R/npem_start.R

npem.startR Documentation

Obtain approximate starting values for npem.em

Description

Obtains crude starting values, needed for the EM algorithm.

Usage

npem.start(
  y,
  cells = 10^6,
  n = c(24, 24, 24, 22),
  n.plates = 1,
  n.groups = 4,
  n.sd = 2,
  cv = 0.33
)

Arguments

y

Vector of transformed scintillation counts, in lexicographical order (plate by plate and group by group within a plate.)

cells

Number of cells per well. The \lambda's will be rescaled to give response per 10^6 cells. This may be either a single number (if all wells have the same number of cells, or 10^6 if one wishes the \lambda's to not be rescaled), a value for each plate (vector of length n.plates, or a value for each well (a vector of the same length as y).

n

Vector giving the number of wells within each group. This may have length either n.groups (if all plates have the same number of wells per group) or n.groups*n.plates.

n.plates

The number of plates in the data.

n.groups

The number of groups. (This is needed here but not elsewhere, because usually I figure it out from n.plates and the length of the argument ests.)

n.sd

Number of SDs above the mean to use as a cutoff

cv

Coefficient of variation (= SD/ave) used in randomizing the starting point; use cv=0 to avoid randomization.

Details

[I should describe the algorithm in more detail here.]

Value

ests

The parameter estimates to use as starting values for the EM algorithm, as a vector of length n.groups + 3*n.plates, of the form (\lambda's, (a, b, \sigma)'s), where \lambda is the average number of responding cells per 10^6 cells for a group, and (a, b, \sigma) are the plate-specific parameters.

Author(s)

Karl W Broman, broman@wisc.edu

References

Broman et al. (1996) Estimation of antigen-responsive T cell frequencies in PBMC from human subjects. J Immunol Meth 198:119-132

See Also

npem.em()

Examples

  data(p713)
  start.pl3 <- npem.start(p713$counts[[3]],n=p713$n)
  out.pl3 <- npem.em(p713$counts[[3]],start.pl3,n=p713$n,tol=1e-13)


kbroman/npem documentation built on May 17, 2023, 11:52 p.m.