1

I'm trying to plot a generalized pareto distribution with fixed initial values "scale" and "shape" to a random sequence of numbers. When I produce the plot with scale=1 and shape=1, I get the density on the y-axis with limits (0,1). If I produce the plot with different parameters (like the ones below), on the y-axis I get density values between (0,2), which obviously don't make sense.

x <- seq(from = 0, to = 5, by = 0.01)
plot(dgpd(x, scale=0.639, shape=-0.255), type="l",xaxt="n",  las=1, ylab="Density", xlab="Exceedances")
axis(1, at=seq(0, 500, by=100), labels = seq(0, 5, by=1))

(the third line was my way to rename the x-axis, it shouldn't matter for my question.)

Could someone replicate this and tell me whether they also get the weird limits? You know how I can fix this? Thanks!

PS: Sorry for the inconvenience, I only thought that there was a problem with MY specifications since for some parameters I had the interval [0,1] and for others [0,2]. Erroneously enough, I was asking what was wrong with my parameters rather than with the density plot and values. But I get it, it's a question that has been asked before, so it's been flagged as duplicate. Moreover, this being my first experience with stackexchange, I can only learn from it. Good day to you all, lads!

Kondo
  • 249
  • 2
  • 6
  • 5
    The area under the density between any two points must be less than 1 but it is not true that the density values themselves must be less than 1. – G. Grothendieck May 22 '16 at 15:11
  • 1
  • You do't mention where the function dgpd comes from. 2. Nothing is wrong there! Only requirement on density is between points
  • – Eric Lecoutre May 22 '16 at 15:12
  • You mean the package? It's the {evd} package – Kondo May 22 '16 at 15:14
  • Thank you both, after your comments I googled a bit and found the (not so intuitive, at least not to me) explanation of densities above 1. – Kondo May 22 '16 at 15:26