I don't believe you when you say that you didn't use any add-on packages: pgumbel()
is not in base R. library("sos"); findFn("pgumbel")
finds it in a variety of places, I used the evd
package.
There are a couple of small issues here.
library("evd")
The main thing is that you want length=100
rather than by=100
(which gives you a single-element x
vector):
x <- seq(-3, 3, length=100)
The actual computations are OK:
Fx = pgumbel(x,loc=0,scale=1)
y = dbeta(Fx,shape1=0.5,shape2=0.5)
You need to change ylim
to be able to see what's going on. However, I also think you need to do something to account for the differential dx
in order to get a proper density function (that's more of a StackExchange than a StackOverflow question though).
par(las=1,bty="l") ## my personal preferences
plot(x, y, type="l", lty=2, xlab="x value", ylab="Density",ylim=c(0,40))