Calculates joint return periods
Joint_RP_2D.Rd
Calculates joint return periods via simulation. A large number of realizations are simulated from the copulas fit to the conditioned samples, in proportion with the sizes of the conditional samples. The realizations are transformed to the original scale and the relevant probabilities estimated empirically.
Usage
Joint_RP_2D(
Data,
Data_Con1,
Data_Con2,
u1,
u2,
Thres1 = NA,
Thres2 = NA,
Copula_Family1,
Copula_Family2,
Marginal_Dist1,
Marginal_Dist2,
Con1 = "Rainfall",
Con2 = "OsWL",
mu = 365.25,
RP_Var1,
RP_Var2,
Var1 = NA,
Var2 = NA,
x_lab = "Rainfall (mm)",
y_lab = "O-sWL (mNGVD 29)",
x_lim_min = NA,
x_lim_max = NA,
y_lim_min = NA,
y_lim_max = NA,
DecP = 2,
N = 10^6
)
Arguments
- Data
Data frame containing two co-occurring time series.
- Data_Con1
Data frame containing the conditional sample (declustered excesses paired with concurrent values of other variable), conditioned on the variable in the first column.
- Data_Con2
Data frame containing the conditional sample (declustered excesses paired with concurrent values of other variable), conditioned on the variable in the second column. Can be obtained using the
Con_Sampling_2D
function.- u1
Numeric vector of length one specifying the (quantile) threshold above which the variable in the first column was sampled in Data_Con1.
- u2
Numeric vector of length one specifying the (quantile) threshold above which the variable in the second column was sampled in Data_Con2.
- Thres1
Numeric vector of length one specifying the threshold above which the variable in the first column was sampled in Data_Con1. Only one of
u1
andThres1
should be supplied. Default isNA
.- Thres2
Numeric vector of length one specifying the threshold above which the variable in the second column was sampled in Data_Con2. Only one of
u2
andThres2
should be supplied. Default isNA
.- Copula_Family1
Numeric vector of length one specifying the copula family used to model the
Data_Con1
dataset.- Copula_Family2
Numeric vector of length one specifying the copula family used to model the
Data_Con2
dataset. Best fitting of 40 copulas can be found using theCopula_Threshold_2D
function.- Marginal_Dist1
Character vector of length one specifying (non-extreme) distribution used to model the marginal distribution of the non-conditioned variable in
Data_Con1
.- Marginal_Dist2
Character vector of length one specifying (non-extreme) distribution used to model the marginal distribution of the non-conditioned variable in
Data_Con2
.- Con1
Character vector of length one specifying the name of variable in the first column of
Data
.- Con2
Character vector of length one specifying the name of variable in the second column of
Data
.- mu
Numeric vector of length one specifying the (average) occurrence frequency of events in
Data
. Default is365.25
, daily data.- RP_Var1
Numeric vector of length one specifying the univariate return period of variable
Con1
.- RP_Var2
Numeric vector of length one specifying the univariate return period of variable
Con2
.- Var1
Numeric vector specifying the values of the variable in the first column of
Data
. Default isNA
.- Var2
Numeric vector specifying the values of the variable in the second column of
Data
. Default isNA
.- x_lab
Character vector specifying the x-axis label.
- y_lab
Character vector specifying the y-axis label.
- x_lim_min
Numeric vector of length one specifying x-axis minimum. Default is
NA
.- x_lim_max
Numeric vector of length one specifying x-axis maximum. Default is
NA
.- y_lim_min
Numeric vector of length one specifying y-axis minimum. Default is
NA
.- y_lim_max
Numeric vector of length one specifying y-axis maximum. Default is
NA
.- DecP
Numeric vector of length one specifying the number of decimal places to round the data in the conditional samples to in order to identify observations in both conditional samples. Default is
2
.- N
Numeric vector of length one specifying the size of the sample from the fitted joint distributions used to estimate the density along an isoline. Samples are collected from the two joint distribution with proportions consistent with the total number of extreme events conditioned on each variable. Default is
10^6
Value
Console output is a vector RP_Copula
of the joint return period of the specified (Var1,Var2) events according to the conditional sampling - copula theory approach.
Examples
con.sample.Rainfall<-Con_Sampling_2D(Data_Detrend=S22.Detrend.df[,-c(1,4)],
Data_Declust=S22.Detrend.Declustered.df[,-c(1,4)],
Con_Variable="Rainfall",u=0.97)
con.sample.OsWL<-Con_Sampling_2D(Data_Detrend=S22.Detrend.df[,-c(1,4)],
Data_Declust=S22.Detrend.Declustered.df[,-c(1,4)],
Con_Variable="OsWL",u=0.97)
con.sample.OsWL$Data$Rainfall <- con.sample.OsWL$Data$Rainfall +
runif(length(con.sample.OsWL$Data$Rainfall),0.001,0.01)
cop.Rainfall<-Copula_Threshold_2D(Data_Detrend=S22.Detrend.df[,-c(1,4)],
Data_Declust=S22.Detrend.Declustered.df[,-c(1,4)],u1 =0.97,
y_lim_min=-0.075,y_lim_max=0.25,
Upper=c(2,9),Lower=c(2,10),GAP=0.15)$Copula_Family_Var1
cop.OsWL<-Copula_Threshold_2D(Data_Detrend=S22.Detrend.df[,-c(1,4)],
Data_Declust=S22.Detrend.Declustered.df[,-c(1,4)],u2 =0.97,
y_lim_min=-0.075, y_lim_max =0.25,
Upper=c(2,9),Lower=c(2,10),GAP=0.15)$Copula_Family_Var2
#Joint excedence probability of a 5 inch rainfall and 2 ft O-sWL at S-22.
Joint_RP_2D(Data=S22.Detrend.df,
Data_Con1=con.sample.Rainfall$Data, Data_Con2=con.sample.OsWL$Data,
u1=0.98, u2=0.98,
Copula_Family1=cop.Rainfall,Copula_Family2=cop.OsWL,
Marginal_Dist1="Logis", Marginal_Dist2="BS",
Con1 = "Rainfall", Con2 = "OsWL",
mu = 365.25,
RP_Var1 =10, RP_Var2 =10,
x_lab = "Rainfall (Inches)", y_lab = "O-sWL (ft NGVD 29)",
y_lim_max = 10,
N=10^7)
#> Warning: NaNs produced
#> Warning: NaNs produced
#> Warning: NaNs produced
#> Warning: NaNs produced
#> [1] 50.79394