Learn R Programming

DEEVD (version 1.2.3)

plot.Gumbel: Density Plot by Gumbel kernel

Description

Plot kernel density by using Gumbel Kernel.

Usage

# S3 method for Gumbel
plot(x, ...)

Arguments

x

an object of class "Gumbel"

Not presently used in this implementation

Value

nothing

References

Khan, J. A., & Akbar, A. 2021. Density Estimation Using Gumbel Kernel Estimator. Open Journal of Statistics 11 (2), 319-328.

See Also

For Weibull kernel see plot.Weibull. To calculate Gumbel estimated values see Gumbel and for MSE mse.

Examples

Run this code
# NOT RUN {
y <- rlnorm(100, meanlog = 0, sdlog = 1)
h <- 1.5
xx <- seq(min(y) + 0.05, max(y), length = 200)
den <- Gumbel(x = xx, y = y, k = 200, h = h)
plot(den, type = "l")

##other details can also be added
y <- rlnorm(100, meanlog = 0, sdlog = 1)
grid <- seq(min(y) + 0.05, max(y), length = 200)
h <- 0.79 * IQR(y) * length(y) ^ (-1/5)
gr <- Gumbel(x = grid, 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 Gumbel Kernel"),
col=c("red", "black"), lty=c(1,2))
# }

Run the code above in your browser using DataLab