testconstr: Check Constraints

Description Usage Arguments Value References See Also Examples

View source: R/testconstr.R

Description

Check if constraints on parameters are valid. See the reference for details.

Usage

1
testconstr(mixdat, mixpar, dist, constr)

Arguments

mixdat

a data frame containing grouped data, whose first column should be right boundaries of grouping intervals, whose second column should consist of the frequencies indicating numbers of observations falling into each interval. If conditional data are available, this data frame should have k + 2 columns, where k is the number of components, whose element in row j and column i + 2 is the number of observations from the jth interval belonging to the ith component.

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

If the constraints are valid, this function will give a logical value TRUE. If not, it will give an error message to illustrate the reason.

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

mixgroup for grouping data, mixparam for organizing the parameter values, mixconstr for constructing constraints.

Examples

1
2
3
4
5
6
7
## Not run: 
testconstr(pike65, pikepar, "lnorm", constr = mixconstr(consigma = "CCV"))
testconstr(bindat, binpar, "binom", constr = mixconstr())
testconstr(bindat, binpar, "binom", constr = mixconstr(consigma = "BINOM"))
testconstr(bindat, binpar, "pois", constr = mixconstr(conmu = "MEQ", consigma = "POIS"))

## End(Not run)

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

Related to testconstr in mixdist...