ysample.md {acid} | R Documentation |
This function samples incomes from a mixture of two continuous income distributions and a point mass for zero-incomes.
ysample.md(n, dist1, dist2, theta, p0, p1, p2, dist.para.table)
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 |
returns the sample of observations.
Alexander Sohn
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)