Learn R Programming

mixdist (version 0.5-5)

grpintprob: Compute Probabilities of an Observation Falling into a Grouping Interval

Description

Compute probabilities of an observation falling into a grouping interval when given component distribution which the observation comes from.

Usage

grpintprob(mixdat, mixpar, dist, constr)

Arguments

mixdat

a data frame containing grouped data, whose first column should be right boundaries of grouping intervals where the first and last intervals are open-ended; whose second column should consist of the frequencies indicating numbers of observations falling into each interval.

mixpar

a data frame containing the parameter values 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.

Value

It produces a matrix, whose each column contains the probabilities of the observations from one component falling into each grouping interval.

Examples

Run this code
# NOT RUN {
data(bindat)
data(binpar)
grpintprob(bindat, binpar, "binom", mixconstr(consigma = "BINOM", size = c(20, 20, 20, 20)))
# }

Run the code above in your browser using DataLab