I'm doing a project on Extreme Value Theory in R and I'm having trouble showing convergence to Fréchet with maxima from a Power Law distributions, using normalizing constants.
convergence in domain of attraction: [1] https://i.stack.imgur.com/Feonv.png
power law inverse transform sampling: [2] https://i.stack.imgur.com/c93ww.png
I created a function in R that generates power law random variables, using inverse transform sampling. I then created a vector of 300 block maxima with n=1,000, with the parameter gamma (shape parameter)=3, and then applied the normalizing constants to the maxima. When I run the code through the fevd function in the extRemes package it doesn't give the parameters I'd expect:
rpowerlaw <- function(n,g) {
(1-runif(n))^(-1/g)
# inverse transform sampling
}
#taking the maxima of an nXm matrix with m rows for m block maxima
Mpowerlaw<-function (n,m,c=3) {
d1<-matrix(rpowerlaw(n*m,g=c),nrow=m)
(apply(d1,1,max) )/(n^(1/c))
#divide by n^(1/gamma) as the normalizing constant
}
#Power law maxima with 1000 observations per block (300 blocks)
x2<-Mpowerlaw(1000,300)
#with renormalization, results should show location parameter as 0, scale parameter 1.
library(extRemes)
fevd(x2)$results[1]
#Output:
#location scale shape
#1.0024691 0.3280454 0.2492214
I expected location close to zero, scale close to 1, shape close to 3, as would be expected in the attached image. Maybe there is a problem with my convergence equation, something with the inverse transform sampling, or something in my code that is making it not work.