2
$\begingroup$

I'm trying to replicate empirical density plot from the paper "Computing Maximum Likelihood Estimates for the Generalized Pareto Distribution".

The data is Exceedance (in kg/mm2) of the Testing Threshold in Tensile-Strength Tests for a Random Sample of n = 15 Nylon Carpet Fibers. Below is the density estimate using Epanechnikov kernel. The paper is about generalized pareto distribution using exceedance data, related to extreme value theory.

enter image description here

I tried to replicate/reproducing this figure in R using density, but unable to do this, see below for reproducible example based on the data in the paper.

tensile_strength <- (0.051,0.140,0.365,0.561,0.030,0.268,0.184,0.1,0.876,0.092,0.011,0.2,0.518,0.338,0.056)
          
plot(density(tensile_strength, bw=0.18, kernel=c("epanechnikov"),from=0.01, to=1)) 
lines(x=tensile_strength,y=rep(0,length(ans)),type="p")

Here is the density plot.

enter image description here

The plot is nowhere close to what is in the article.

My question is how does one account for "Epanechnikov kernel with boundary kernel modifications (since the exceedances must be greater than 0)"

$\endgroup$
2
  • 1
    $\begingroup$ Uff... messy. (+1). It relates to the fact that as we go closer to the boundaries the weights of the kernel window falling outside the support are set to 0 and the remaining non-zero weights (i.e. the one still in the support) are upscaled such that they sum up to 1. Quite common for all kernel regression approaches actually; e.g. see the Wikipedia article on Kernel regression and notice the normalisation in the Nadaraya-Watson estimator's denominator. $\endgroup$
    – usεr11852
    Apr 6, 2021 at 4:59
  • $\begingroup$ @usεr11852 thanks, your comment helped me solve the question. $\endgroup$
    – forecaster
    Apr 16, 2021 at 1:06

1 Answer 1

2
$\begingroup$

I was able to follow @usεr11852 comments and was able to reproduce from the original paper. For truncated/bounded data one would have to used bounded density estimation.

Below is the code to reproduce the plots from the paper.

library(bde)

## Data
tensile_strength <- c(0.051,0.140,0.365,0.561,0.030,0.268,0.184,0.1,0.876,0.092,0.011,0.2,0.518,0.338,0.056)

## Density plots with bounded data
 plot(bde(tensile_strength,estimator="boundarykernel",lower.limit = 0,upper.limit = 1,options = list(mu=1)))

enter image description here

$\endgroup$
3
  • 1
    $\begingroup$ Sweet! Thank you for sharing. (+1) $\endgroup$
    – usεr11852
    Apr 16, 2021 at 1:12
  • $\begingroup$ You are correct let me fix it. $\endgroup$
    – forecaster
    Apr 16, 2021 at 1:23
  • 1
    $\begingroup$ Thansk for pointing it out @usεr11852 I have fixed the answer. $\endgroup$
    – forecaster
    Apr 16, 2021 at 1:28

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.