Estimate four-parameter paired response curve using both total least squares and semiparametric methods.
prc(xvar, dil.x, yvar, dil.y, model=c("4P","3P"), method=c("TLS","naive"),
init.method=c("gnls","optim"), opt.method=c("gnls","optim"), reltol=1e-3, max.iter=50,
init=NULL, verbose=FALSE)prcsp (xvar, dil.x, yvar, dil.y, model=c("sp","struct"),
stop.when.dropping=FALSE, grid.density=200,
init=NULL, method.init=c("TLS","naive"), reltol=1e-3, max.iter=20,
try.additiona.support.sets=FALSE,
keep.history=FALSE, verbose=FALSE)
prcstruct(xvar, dil.x, yvar, dil.y,
grid.density=200, method.init=c("TLS","naive"), reltol=1e-3, max.iter=20, init=NULL,
keep.history=FALSE, verbose=FALSE)
# S3 method for prc
coef(object, ...)
# S3 method for prc
predict(object, new.dilution, xvar=NULL, dil.x=NULL, ret.sd=FALSE, ...)
# S3 method for prc
mixlik(object, ...)
# S3 method for prc
print(x, ...)
# S3 method for prc
plot(x, type=c("b","l","p"), add=FALSE, diag.line=TRUE, lcol=2, pcol=1,
log.axis=TRUE, xlab=NULL, ylab=NULL, lwd=2, xlim=NULL, ylim=NULL, ...)
# S3 method for prc
lines(x, col=1, ...)
four_pl_prc(c,d,b,f, xx, k, call.C=TRUE)
s.dot.f(c,d,b,f, r, k)
mixlik (object, ...)
compute.A (logc,logd,b,f, dil.r, sigma.sq, support, xvar, yvar)
quadratic.eiv (xvar, yvar, init=NULL, reltol=1e-3, opt.method=c("optim"),
stop.after.init=FALSE, max.iter=50, verbose=FALSE)
quadratic.eiv.sp (xvar, yvar, grid.density=200, init=NULL, reltol=1e-3,
opt.method=c("optim"), max.iter=50, fix.sigma.sq=FALSE, verbose=FALSE)
# S3 method for quad
coef(object, ...)
# S3 method for quad
print(x, ...)
# S3 method for quad
plot(x, type=c("b","l"), add=FALSE, lcol=2, pcol=1,
xlab=NULL, ylab=NULL, lwd=2, x.range=NULL, log.axis=TRUE,...)
# S3 method for quad
lines(x, col=1, x.range=NULL, ...)
quad.f(a,b,c,x)
vector of numbers on the ln(FI) scale
numeric.
vector of numbers on the ln(FI) scale
numeric.
gnls uses gnls to find initial parameter estimate and optim uses optim. In the initial estimation, measurement errors in the xvar are ignored.
relative tolerance convergence criterion used in optimization
optimization method
TLS minimizes total least squares. Naive minmizes least squares, ignoring measurement errors in the xvar.
4P is a four-parameter model proposed in Fong et al. 3P is a three-parameter model that assumes f=1 in 4P.
maximum number of iterations to perform in optimization. Each iteration comprises finding the best r given theta and finding the best theta given r
Boolean. If TRUE, print messages during execution
an object of type prc
a new dilution
"b" for both points and line, "l" for line only
add to an existing plot or not
line color
points color
color
whether to add a diagonal line
whether the axis should be on the log scale
xlab
ylab
line width. Does not affect points
object of class prc or quad depending on the functions
vector of numbers on the log scale
dilution ratio: dilution of x axis/dilution of y axis, e.g. 2500/500
parameter c in the four-parameter paired response model
parameter d in the four-parameter paired response model
parameter b in the four-parameter paired response model
parameter f in the four-parameter paired response model
parameter a in the quadratic model
the x axis of a point on the prc on the log scale
initial parameter value
whether to return standard deviation
xlim
ylim
Boolean
Boolean
string
log(c) in the four-parameter paired response model
log(d) in the four-parameter paired response model
dilution ratio
sigma square
the support of the distribution
boolean
Boolean. If true (not recommended), a naive curve estimate which pretends there is no measurement error in xvar is returned. If false, a proper least squares estimate accounting for errors-in-variables is returned.
a pair of low and high
number of grid points
whether to assume simgasq is fixed
Boolean
more args
Both prc and prcsp return an object of type prc.
curve estimate
error variance estimate
dilution.x/dilution.y
sample dilution for the readouts plotted on the x axis
sample dilution for the readouts plotted on the y axis
observations on the x axis
observations on the y axis
closest point to (x,y) on the curve is (r,s(r))
compute.A returns a matrix.
prc() operates on the scale on which the distance is defined. For example, for MBA/Luminex readouts, this is the log(FI) scale.
In prcsp, if verbose>=2, will make plots of nonparametric distribution
s.dot.f() is created with deriv3 and it returns prc function value, as well as gradient and hessian at the point (r,s(r))
quadratic.eiv and quadratic.eiv.sp deal with a quadratic model as an illustration
Fong, Y., Permar, S., Tomaras, G. (2014) Four-Parameter Paired Response Curve for Serial Dilution Assay: Estimation and Prediction. Submitted
# NOT RUN {
# estimation
fit=prc (mtct.eg$V3_BioV3B_2500, 2500, mtct.eg$V3_BioV3B_500, 500, verbose=TRUE)
plot(fit)
# prediction
logfi.1000 = predict(fit, new.dilution=1000)
points(exp(fit$rvar), exp(logfi.1000), col=2, cex=.5)
theta=coef(fit)
four_pl_prc(theta["c"], theta["d"], theta["b"], theta["f"], log(500), k=5)
# }
Run the code above in your browser using DataLab