Functions for checking the input arguments to functions, so that main functions are more concise. They will stop when an inappropriate input is found.
These function are visible and operable by the user. But they should be used with caution, as no checks on the input validity are carried out.
For likelihood functions you will often not want to stop on finding a non-positive values for
positive parameters, in such cases use check.param
rather than
check.posparam
.
check.param(param, allowvec = FALSE, allownull = FALSE, allowmiss = FALSE,
allowna = FALSE, allowinf = FALSE)check.posparam(param, allowvec = FALSE, allownull = FALSE,
allowmiss = FALSE, allowna = FALSE, allowinf = FALSE,
allowzero = FALSE)
check.quant(x, allownull = FALSE, allowna = FALSE, allowinf = FALSE)
check.prob(prob, allownull = FALSE, allowna = FALSE)
check.n(n, allowzero = FALSE)
check.logic(logicarg, allowvec = FALSE, allowna = FALSE)
check.nparam(ns, nparam = 1, allownull = FALSE, allowmiss = FALSE)
check.inputn(inputn, allowscalar = FALSE, allowzero = FALSE)
check.text(textarg, allowvec = FALSE, allownull = FALSE)
check.phiu(phiu, allowvec = FALSE, allownull = FALSE, allowfalse = FALSE)
check.optim(method)
check.control(control)
check.bcmethod(bcmethod)
check.nn(nn)
check.offset(offset, bcmethod, allowzero = FALSE)
check.design.knots(beta, xrange, nseg, degree, design.knots)
scalar or vector of parameters
logical, where TRUE permits vector
logical, where TRUE permits NULL values
logical, where TRUE permits missing input
logical, where TRUE permits NA and NaN values
logical, where TRUE permits +/-Inf values
logical, where TRUE permits zero values (positive vs non-negative)
scalar or vector of quantiles
scalar or vector of probability
scalar sample size
logical input argument
vector of lengths of parameter vectors
acceptable length of (non-scalar) vectors of parameter vectors
vector of input lengths
logical, where TRUE permits scalar (as opposed to vector) values
character input argument
scalar or vector of phiu (logical, NULL or 0-1 exclusive)
logical, where TRUE permits FALSE (and TRUE) values
optimisation method (see optim
)
optimisation control list (see optim
)
boundary correction method
non-negativity correction method (simple boundary correction only)
offset added to kernel centres (logtrans only) or NULL
vector of B-spline coefficients (required)
vector of minimum and maximum of B-spline (support of density)
number of segments between knots
degree of B-splines (0 is constant, 1 is linear, etc.)
spline knots for splineDesign function
The checking functions will stop on errors and return no value. The only exception is
the check.inputn
which outputs the maximum vector length.