plot.Gamma | R Documentation |
Plot density by using Gamma Kernel.
## S3 method for class 'Gamma' plot(x, ...)
x |
an object of class "Gamma" |
... |
Not presently used in this implementation |
nothing
Javaria Ahmad Khan, Atif Akbar.
Chen, S. X. 2000. Probability density function estimation using Gamma kernels. Annals of the Institute of Statistical Mathematics 52 (3), 471-480.
For further kernels see plot.Beta
, plot.Erlang
, plot.BS
and plot.LogN
. To calculate its estimated values see Gamma
and for
MSE mse
.
y <- rexp(100, 1) h <- 1.5 xx <- seq(min(y) + 0.05, max(y), length =200) den <- Gamma(x=xx, y=y, k=200, h=h) plot(den, type = "l") ##other details can also be added y <- rexp(100, 2) h <- 0.79 * IQR(y) * length(y) ^ (-1/5) gr <- Gamma(x=xx, y=y, k=200, h=h) plot(gr, type = "s", ylab = "Density Function", lty = 1, xlab = "Time") ## To add true density along with estimated d1 <- density(y, bw=h) lines(d1, type="p", col="red") legend("topright", c("Real Density", "Density by Gamma Kernel"), col=c("red", "black"), lty=c(1,2))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.