gsm.plot {GSM} | R Documentation |
This function plots the output of a Gamma Shape Mixture estimation procedure.
gsm.plot(v,y,ndens=5,xlim=c(min(y),max(y)),ylim=c(0,max(v$ff)),xlab="x",ylab="density",nbin=10,histogram=FALSE,bands=FALSE)
v |
list returned by the gsm or gsm.theta functions. |
y |
vector of data to use in the analysis. |
ndens |
number of simulated density curves to plot. |
xlim |
the x limits (x1, x2) of the plot. |
ylim |
the y limits of the plot. |
xlab |
a title for the x axis. |
ylab |
a title for the y axis. |
nbin |
number of bins for the histogram. |
histogram |
logical; if TRUE the histogram is plotted on the figure. |
bands |
logical; if TRUE the 95% credibility bands are overimposed on the density graph. |
To produce a standard histogram with the estimated density curve superimposed on it, simply set ndens
to 0 and histogram
to TRUE
.
Sergio Venturini sergio.venturini@unibocconi.it
Venturini, S., Dominici, F., and Parmigiani, G., "Gamma Shape Mixtures for Heavy-Tailed Distributions" (December 2006). Johns Hopkins University, Dept. of Biostatistics Working Papers. Working Paper 124. http://www.bepress.com/jhubiostat/paper124
set.seed(2040) y <- rgsm(500,c(.1,.3,.4,.2),1) burnin <- 100 J <- 250 gsm.out <- gsm(y,J,300,burnin+500,6500,340,1/J) par(mfrow=c(2,2)) gsm.plot(gsm.out,y,ndens=5,nbin=20) gsm.plot(gsm.out,y,ndens=0,nbin=20,histogram=TRUE) gsm.plot(gsm.out,y,ndens=0,nbin=20,histogram=TRUE,bands=TRUE) gsm.plot(gsm.out,y,ndens=5,nbin=20,histogram=TRUE,bands=TRUE)