Internal functions for checking function input arguments
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)
param
: scalar or vector of parametersallowvec
: logical, where TRUE permits vectorallownull
: logical, where TRUE permits NULL valuesallowmiss
: logical, where TRUE permits missing inputallowna
: logical, where TRUE permits NA and NaN valuesallowinf
: logical, where TRUE permits +/-Inf valuesallowzero
: logical, where TRUE permits zero values (positive vs non-negative)x
: scalar or vector of quantilesprob
: scalar or vector of probabilityn
: scalar sample sizelogicarg
: logical input argumentns
: vector of lengths of parameter vectorsnparam
: acceptable length of (non-scalar) vectors of parameter vectorsinputn
: vector of input lengthsallowscalar
: logical, where TRUE permits scalar (as opposed to vector) valuestextarg
: character input argumentphiu
: scalar or vector of phiu (logical, NULL or 0-1 exclusive)allowfalse
: logical, where TRUE permits FALSE (and TRUE) valuesmethod
: optimisation method (see optim
)control
: optimisation control list (see optim
)bcmethod
: boundary correction methodnn
: non-negativity correction method (simple boundary correction only)offset
: offset added to kernel centres (logtrans only) or NULL
beta
: vector of B-spline coefficients (required)xrange
: vector of minimum and maximum of B-spline (support of density)nseg
: number of segments between knotsdegree
: degree of B-splines (0 is constant, 1 is linear, etc.)design.knots
: spline knots for splineDesign functionThe checking functions will stop on errors and return no value. The only exception is the check.inputn
which outputs the maximum vector length.
Carl Scarrott carl.scarrott@canterbury.ac.nz .