testpar: Check Parameters

Description Usage Arguments Details Value References See Also

View source: R/testpar.R

Description

Check if the values of parameters are valid. See the reference for details.

Usage

1
testpar(mixpar, dist, constr)

Arguments

mixpar

a data frame containing the values for parameters of component distributions, which are, in order, the proportions, means, and standard deviations.

dist

the distribution of components, it can be one of "norm", "lnorm", "gamma", "weibull", "binom", "nbinom" and "pois".

constr

a list of constraints on parameters of component distributions. See function mixconstr.

Details

Any of the parameter values can not be missing value (NA or NaN) or infinity (Inf), and the proportions can only take the values between 0 and 1. Besides, the standard deviations can not be negative. The components must be indexed so that the means are in non-decreasing order. If any two consecutive means are equal, then the corresponding standard deviations must be in strictly ascending order. Furthermore, the parameter values should be consistent with the constraints and the distribution of components. For example, if one wants to constrain the means to lie along a growth curve, then (μ_3 - μ_2) < (μ_2 - μ_1) is required. Also, negative means are not permitted by the constraints "FCV", "CCV", "BINOM", "NBINOM", "POIS" and all the distributions but Normal. If the Binomial distribution components with the constraint "BINOM" are fitted, then the relation μ_i > (σ_i)^2 need to be satisfied. And the Negative Binomial components with the constraint "NBINOM" require μ_i < (σ_i)^2.

Value

logical. If TRUE, the parameters are valid. If FALSE, some of the parameters are invalid. Since this function is for internal use, it doesn't give error messages.

References

Macdonald, P.D.M. and Green, P.E.J. (1988) User's Guide to Program MIX: An Interactive Program for Fitting Mixtures of Distributions. ICHTHUS DATA SYSTEMS.

See Also

mixparam for organizing the parameter values, mixconstr for constructing constraints, testconstr for checking constraints.


mixdist documentation built on May 2, 2019, 3:34 p.m.

Related to testpar in mixdist...