plot.Erlang {DELTD} R Documentation

## Density Plot by Erlang kernel

### Description

Plot Kernel density by using Erlang Kernel.

### Usage

## S3 method for class 'Erlang'
plot(x, ...)


### Arguments

 x An object of class "Erlang" ... Not presently used in this implementation

Nothing

### References

Salha, R. B.; Ahmed, E. S.; Alhoubi, I. M. 2014. Hazard rate function estimation using Erlang Kernel. Pure Mathematical Sciences 3 (4), 141-152.

For further MSE by using other kernels see plot.Beta, plot.BS, plot.Gamma and plot.LogN. For estimated values Erlang and for calculating MSE see mse.

### Examples

y <- rlnorm(100, meanlog = 0, sdlog = 1)
h <- 1.5
xx <- seq(min(y) + 0.05, max(y), length = 200)
den <- Erlang(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 <- Erlang(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 Erlang Kernel"),
col=c("red", "black"), lty=c(1,2))


[Package DELTD version 2.6.8 Index]