checking: Internal functions for checking function input arguments

Description Usage Arguments Value Author(s)

Description

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.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
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)

Arguments

param

scalar or vector of parameters

allowvec

logical, where TRUE permits vector

allownull

logical, where TRUE permits NULL values

allowmiss

logical, where TRUE permits missing input

allowna

logical, where TRUE permits NA and NaN values

allowinf

logical, where TRUE permits +/-Inf values

allowzero

logical, where TRUE permits zero values (positive vs non-negative)

x

scalar or vector of quantiles

prob

scalar or vector of probability

n

scalar sample size

logicarg

logical input argument

ns

vector of lengths of parameter vectors

nparam

acceptable length of (non-scalar) vectors of parameter vectors

inputn

vector of input lengths

allowscalar

logical, where TRUE permits scalar (as opposed to vector) values

textarg

character input argument

phiu

scalar or vector of phiu (logical, NULL or 0-1 exclusive)

allowfalse

logical, where TRUE permits FALSE (and TRUE) values

method

optimisation method (see optim)

control

optimisation control list (see optim)

bcmethod

boundary correction method

nn

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 knots

degree

degree of B-splines (0 is constant, 1 is linear, etc.)

design.knots

spline knots for splineDesign function

Value

The checking functions will stop on errors and return no value. The only exception is the check.inputn which outputs the maximum vector length.

Author(s)

Carl Scarrott carl.scarrott@canterbury.ac.nz.


evmix documentation built on Sept. 3, 2019, 5:07 p.m.