U_Sample | R Documentation |
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.
U_Sample(Data, Cluster_Max, D, Start, End, Xp)
Data |
Vector of the rainfall time series. |
Cluster_Max |
Vector of the index of |
D |
Numeric vector of the duration of the cluster maximum events. |
Start |
Numeric vector of the index of |
End |
Numeric vector of the index of |
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). |
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.
Decluster
Time_Series_Plot
WL_Curve
#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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.