ysample.md: Sampling Incomes from a Mixture of Income Distributions

Description Usage Arguments Value Author(s) See Also Examples

Description

This function samples incomes from a mixture of two continuous income distributions and a point mass for zero-incomes.

Usage

1
ysample.md(n, dist1, dist2, theta, p0, p1, p2, dist.para.table)

Arguments

n

number of observations.

dist1

character string with the name of the first continuous distribution used. Must be listed in dist.para.table. Must be equivalent to the respective function of that distribution, e.g. norm for the normal distribution.

dist2

character string with the name of the second continuous distribution used. Must be listed in dist.para.table. Must be equivalent to the respective function of that distribution, e.g. norm for the normal distribution.

theta

vector with the parameters of dist1 and dist2. Order must be the same as in the functions for the distributions.

p0

scalar with probability mass for the point mass.

p1

scalar with probability mass for dist1.

p2

scalar with probability mass for dist2.

dist.para.table

a table of the same form as dist.para.t with distribution name, function name and number of parameters.

Value

returns the sample of observations.

Author(s)

Alexander Sohn

See Also

pval.md

Examples

1
2
3
4
5
6
7
8
data(dist.para.t)
ygrid<-seq(0,1e5,by=1000)
theta<-c(5,1,10,3)
p0<-0.2
p1<-0.3
p2<-0.5
n <-10
ysample.md(n, "LOGNO", "LOGNO", theta, p0, p1, p2, dist.para.t)

acid documentation built on May 1, 2019, 10:14 p.m.