inverse_pit_gpd: Inverse PIT GPD

View source: R/inverse_pit_gpd.R

inverse_pit_gpdR Documentation

Inverse PIT GPD

Description

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.

Usage

inverse_pit_gpd(u, Data, Data_Declust, q)

Arguments

u

Vector of the uniform random variates.

Data

Vector of the observations.

Data_Declust

Vector of the declustered observations.

q

Numeric vector of length one, giving the quantile of Data above which the GPD is fit.

Value

A vector of u transformed to the specified GPD.

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,S13.Detrend.df$Rainfall,S13.Rainfall.Declust$Declsutered,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)

rjaneUCF/MultiHazard documentation built on April 20, 2024, 12:48 a.m.