Learn R Programming

mixdist (version 0.5-5)

testpar: Check Parameters

Description

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

Usage

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.

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.

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 (\(\mu_3\) - \(\mu_2\)) < (\(\mu_2\) - \(\mu_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 \(\mu_i\) > \((\sigma_i)^2\) need to be satisfied. And the Negative Binomial components with the constraint "NBINOM" require \(\mu_i\) < \((\sigma_i)^2\).

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.