Learn R Programming

DEEVD (version 1.2.3)

Weibull: Estimated Density Values by Weibull kernel

Description

The Weibull kernel is developed by Salha et al. (2014). They used it to nonparametric estimation of the probability density function (pdf) and the hazard rate function for independent and identically distributed (iid) data. Weibull Kernel is $$ K_w\left( x, \frac{1}{h}\right)(t) =\frac{\Gamma(1+h)}{hx}\left[ \frac{t\Gamma(1+h)}{x}\right] ^{\frac{1}{h}-1} exp\left( -\left( \frac{t\Gamma(1+h)}{x}\right) ^\frac{1}{h}\right)$$

Usage

Weibull(x = NULL, y, k = NULL, h = NULL)

Arguments

x

scheme for generating grid points

y

a numeric vector of positive values

k

number of gird points

h

the bandwidth

Value

x

grid points

y

estimated values of density

Details

see the details in the Gumbel

References

Salha, R. B., El Shekh Ahmed, H. I., & Alhoubi, I. M. 2014. Hazard Rate Function Estimation Using Weibull Kernel. Open Journal of Statistics 4 (08), 650-661. Silverman, B. W. 1986. Density Estimation. Chapman & Hall/ CRC, London.

See Also

For Gumbel kernel see Gumbel. To plot its density see plot.Weibull and to calculate MSE mse.

Examples

Run this code
# NOT RUN {
#Data can be simulated or real data
## Number of grid points "k" should be at least equal to the data size.
### If user define the generating scheme of gridpoints than number of gridpoints should
####be equal or greater than "k"
##### otherwise NA will be produced.
y <- rexp(100, 1)
xx <- seq(min(y) + 0.05, max(y), length = 100)
h <- 2
den <- Weibull(x = xx, y = y, k = 200, h = h)

##If scheme for generating gridpoints is unknown
y <- rexp(50, 1)
h <- 3
den <- Weibull(y = y, k = 90, h = h)

##If user do not mention the number of grid points
y <- rexp(23, 1)
xx <- seq(min(y) + 0.05, max(y), length = 90)

# }
# NOT RUN {
#any bandwidth can be used
require(KernSmooth)
h <- dpik(y)
den <- Weibull(x = xx, y = y, h = h)
# }
# NOT RUN {
#if bandwidth is missing
y <- rexp(100, 1)
xx <- seq(min(y) + 0.05, max(y), length = 100)
den <- Weibull(x = xx, y = y, k = 90)

# }

Run the code above in your browser using DataLab