rmixtruncnorm: Random numbers generator for truncated normal mixtures

Description Usage Arguments Details Value Author(s) See Also Examples

View source: R/functions_only.R

Description

Generates random samples from a mixture of truncated normals.

Usage

1
rmixtruncnorm(n, pis, means, sds, range)

Arguments

n

Size of the random sample.

pis

A vector collecting the mixture weights. See details.

means

A vector collecting the means of the mixture components.

sds

A vector collecting the standard deviations of the mixture components.

range

Interval corresponding to the support of each of truncated normal contributing to the mixture. See details.

Details

The argument pis is a vector with its length equal the number of components in the mixture. The vector pis must sum up to one, e.g. c(0.7, 0.2, 0.1). The argument range is an interval corresponding to the support of each truncated normal contributing to the mixture.

Value

A vector collecting the random sample of size n from the mixture of truncated specified.

Author(s)

Sara Algeri and Xiangyu Zhang

See Also

dmixtruncnorm,dmixnegbinom, rmixnegbinom, find_h_cont.

Examples

1
rmixtruncnorm(n=100,pis=c(0.3,0.6,0.1),means=c(3,6,25),sds=c(3,4,10),range=c(0,30))

Yorkee2018/LPsmooth documentation built on June 5, 2020, 12:32 a.m.