Inverse PIT GPD
inverse_pit_gpd.Rd
Transforms a uniform (0,1) sample to the original scale by invoking the inverse Probability Integral Transform (PIT). Realizations above a high threshold are transformed through a user-specified Generalized Pareto Distribution (GPD) while those below are transformed through the empirical distribution.
Examples
#First decluster the rainfall series to find the 500 events
#with the highest peaks
S13.Rainfall.Declust = Decluster(Data=S13.Detrend.df$Rainfall,
SepCrit=24*3, u=0.99667)
#Generate some uniform (0,1) random variates
unif = runif(100,0,1)
#Transform the unifrom variate to the original scale
x.sim = inverse_pit_gpd(unif,na.omit(S13.Detrend.df$Rainfall),S13.Rainfall.Declust$Declustered,0.95)
#Plotting the empirical distribution functions of the sample and observations
plot(S13.Detrend.df$Rainfall[order(S13.Detrend.df$Rainfall)],
(1:length(S13.Detrend.df$Rainfall))/length(S13.Detrend.df$Rainfall))
points(x.sim[order(x.sim)],1:length(x.sim)/length(x.sim),col=2)