Description Usage Arguments Author(s) See Also Examples
This function plots a graph entailing the empirical cdf and the parametrically specified cdf composed of a mixture distribution either by cdf.mix.dag or cdf.mix.LN.
1 | midks.plot(x.seq, y, dist, w.emp = NULL, ...)
|
x.seq |
the sequence on the x-axis for which the parametric distribution is plotted. |
y |
a vector of observed incomes. |
dist |
a function specifying the parametric cdf. |
w.emp |
the weights of the observations contained in y. |
... |
arguments to be passed to dist. |
Alexander sohn
midks.test
,cdf.mix.dag
,cdf.mix.LN
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 | # parameter values
pi0.s<-0.2
pi1.s<-0.1
thres0.s<-0
thres1.s<-25000
mu.s<-20000
sigma.s<-5
nu.s<-0.5
tau.s<-1
x.seq<-seq(0,200000,by=1000)
# generate sample
n<-100
s<-as.data.frame(matrix(NA,n,3))
names(s)<-c("cat","y","w")
s[,1]<-sample(1:3,n,replace=TRUE,prob=c(pi0.s,pi1.s,1-pi0.s-pi1.s))
s[,3]<-rep(1,n)
for(i in 1:n){
if(s$cat[i]==1){s$y[i]<-0
}else if(s$cat[i]==2){s$y[i]<-runif(1,thres0.s,thres1.s)
}else s$y[i]<-rGB2(1,mu=mu.s,sigma=sigma.s,nu=nu.s,tau=tau.s)+thres1.s
}
# display
midks.plot(x.seq,s$y,dist=cdf.mix.dag,pi0=pi0.s,thres0=thres0.s,pi1=pi1.s,
thres1=thres1.s,mu=mu.s,sigma=sigma.s,nu=nu.s,tau=tau.s)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.