U_Sample: Implements (unconditional) bootstrap procedure in Serinaldi...

View source: R/U_Sample.R

U_SampleR Documentation

Implements (unconditional) bootstrap procedure in Serinaldi and Kilsby (2013)

Description

Implements the unconditional bootstrap procedure i.e. peak is not conditioned on duration outlined in Serinaldi and Kilsby (2013) to generate non-peak rainfall totals for a simulated peak. The function also calculates hyetograph properties including net characteristics.

Usage

U_Sample(Data, Cluster_Max, D, Start, End, Xp)

Arguments

Data

Vector of the rainfall time series.

Cluster_Max

Vector of the index of Data containing the cluster maximum. If declustering is carried out using Decluster_SW() set equal to $EventsMax output.

D

Numeric vector of the duration of the cluster maximum events.

Start

Numeric vector of the index of Data where each cluster maximum event begins.

End

Numeric vector of the index of Data where each cluster maximum event ends.

Xp

Numeric vector of simulated peaks. To implement the method exactly as in Serinaldi and Kilsby (2013), set equal to a sample (taken with replacement) of the observed cluster maximum (peaks).

Value

A data frame with the following columns:

  • Xp Simulated event peaks i.e. input Xp.

  • D Duration sampled from the duration vector D for each simulated event.

  • Samp Index of the cluster maximum event, sampled conditionally on D, that provides non-peak rainfall depths.

  • V Volume of simulated events.

  • Vn Net volume of simulated events.

  • I Intensity of simulated events.

  • In Net intensity of simulated events.

  • Start Index of Data where the sampled (Samp) event begins.

  • End Index of Data where the sampled (Samp) event ends.

See Also

Decluster Time_Series_Plot WL_Curve

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)
#Set very small rainfall measurements to zero.
#Assumed to be the result of uncertainty in measuring equipment.
S13_Rainfall$Rainfall[which(S13_Rainfall$Rainfall<0.01)] = 0
#Find NAs in rainfall series
z = which(is.na(S13_Rainfall$Rainfall)==T)
#Temporarily set NAs to zero
S13_Rainfall$Rainfall[z] = 0
#Find times where there is 6-hours of no rainfall
no.rain = rep(NA,length(S13_Rainfall$Rainfall))
for(i in 6:length(S13_Rainfall$Rainfall)){
  no.rain[i] = ifelse(sum(S13_Rainfall$Rainfall[(i-5):i])==0,i,NA)
}
#Remove NAs from results vector as these correspond to times where there is
#rainfall at certain points in the 6 hour period.
no.rain = na.omit(no.rain)
#Reset missing values in the rainfall record back to NA
S13_Rainfall$Rainfall[z] = NA
#Find the start and end times of the 500 events.
start = rep(NA,length(S13.Rainfall.Declust$EventsMax))
end = rep(NA,length(S13.Rainfall.Declust$EventsMax))
for(i in 1:length(S13.Rainfall.Declust$EventsMax)){
 start[i] = max(no.rain[which(no.rain<S13.Rainfall.Declust$EventsMax[i])])
 end[i] = min(no.rain[which(no.rain>S13.Rainfall.Declust$EventsMax[i])])
}
start = start + 1
end = end - 6
d = end - start + 1 #Duration
#Simulate some peaks by sampling observed peaks with replacement
#I.e., applying the method exactly as in Serinaldi and Kilsby (2013)
sim.peak = sample(S13.Rainfall.Declust$EventsMax,size=500,replace=TRUE)
#Derive the hyetographs
S13.oswl.sample = U_Sample(Data=S13_Rainfall$Rainfall,
                           Cluster_Max=S13.Rainfall.Declust$EventsMax,
                           D=d,Start=start,End=end,
                           Xp=sim.peak)

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