llcq: Log-posterior for Cq-dPCR data

Description Usage Arguments Details Value Author(s) See Also Examples

View source: R/llcq.R

Description

Calculates the log-posterior or log-likelihood for the data and the parameters.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
llcq(mpars, data = fetch(2, 1), maxn0 = 7, c0 = 6, 
  extra = c("trendx", "trendy", "disp", "E1"), 
  h = 0.1, n0 = 300, n1 = 465,
  nt0 = 0, nt1 = 0, n.lo = 0, n.hi = 0, 
  nx = 0, ny = 0, 
  full = TRUE, delta = 1e-05, sum. = TRUE, 
  report = 0, probreport = 0, prior = FALSE, 
  mu.fun = function(mu) 1, A.fun = function(A) 1, 
  E.fun = function(E) 1, E1.fun = function(E1) 1, 
  trendx.fun = function(x) 1, trendy.fun = function(y) 1, 
  disp.fun = function(d) 1, prior.funs = NULL, 
  invisible = FALSE)

Arguments

mpars

parameter vector in "m" parameterisation. Use conv if necessary to reparameterise.

data

cqdat object or data frame.

maxn0

the maximum number of initial molecules used in computation.

c0

number of cycles for which exact probabilities are caclulated. This can have a significant impact on speed of computation.

extra

vector of names of parameters to include in model in additon to "mu", "E", and "A". Defaults to all possibitilies: c("E1","trendx","trendy","disp").

h

threshold value Not needed if data is a cqdat object.

n0, n1, nt0, nt1, n.lo, n.hi

counts of the number of negative partitions (n0), positive partitions (n1), trimmed negative partitions (nt0), trimmed positive partitions (nt1), low outliers (n.lo) and high outliers (n.hi). Not needed if data is cqdat object.

nx, ny

numbers of rows, columns respectively.

full

logical, if TRUE then more robust method used for small log-likelihood contributions.

delta

positive number used in finite difference method.

sum.

logical, if TRUE calculate log-likelihood for all data, otherwise calculate vector of log-densities for each Cq value.

report

if postive then tracing information is produced. High values may produce more information.

probreport

if report > 0, the probability that "'" is printed when a valid log-likelihood is calculated.

prior

logical, if FALSE use constant priors, which is equivalent to returning the log-likelihood. Otherwise use priors specified by mu.fun, A.fun, E.fun, E1.fun, trendx.fun, trendy.fun and disp.fun.

mu.fun, A.fun, E.fun, E1.fun, trendx.fun, trendy.fun, disp.fun

priors as single parameter functions.

prior.funs

list of named prior functions.

invisible

logical. If TRUE then the result is printed.

Details

Due to computation limits very small log-posteriors cannot be calculated and -10^10 is returned instead. If report>0 "." will also be printed. For other log-posteriors if report>0 then "'" is printed with probability probreport.

Value

If sum. is TRUE the log-posterior, otherwise a vector of log-densities for the Cq values.

Author(s)

Philip Wilson

See Also

cqmc,plotfun

Examples

1
2
3
dat<-fetch(Exp37a,1)
pars0<-get.pars0(dat)
llcq(conv(pars0,"p","m"),dat)

edpcr documentation built on May 2, 2019, 5:22 p.m.

Related to llcq in edpcr...