Learn R Programming

PRSim (version 1.1)

simulations: Simulated runoff

Description

The dataset is generated with the package own routines and represent 50 series of 18 years of runoff

Usage

data("simulations")

Arguments

Format

A list of three elements, containing (i) a data frame with 6570 observations of the following 56 variables

YYYY

a numeric vector, year

MM

a numeric vector, month

DD

a numeric vector, day

timestamp

POSIXct vector of the daily runoff

deseasonalized

deseasonalized time series

Qobs

observed runoff

r1,…,r50

50 simulated runoff series

(ii) a data frame with the daily fitted kappa parameters and (iii) p-values of the daily ks.test.

Details

The data is included to illustrate the validation and visualization routines in demo("PRSim-validate").

References

Brunner, Bardossy, Furrer (2019) Technical note: Stochastic simulation of streamflow time series using phase randomization. Submitted.

Examples

Run this code
# NOT RUN {
data(simulations)
names(simulations) 
sim <- simulations$simulation
dim(sim)
sim$day_id <- rep(seq(1:365), times=length(unique(sim$YYYY)))
mean_obs <- aggregate(sim$Qobs, by=list(sim$day_id), FUN=mean, simplify=FALSE)
plot(unlist(mean_obs[,2]),lty=1,lwd=1,col="black", ylab="Discharge [m3/s]",
     xlab="Time [d]", main="Mean hydrographs", ylim=c(0,22), type="l")

for(r in 7:(length(names(sim))-1)){
  mean_hydrograph <- aggregate(sim[,r], by=list(sim$day_id), FUN=mean, simplify=FALSE)
  lines(mean_hydrograph, lty=1, lwd=1, col="gray")
}
lines( mean_obs, lty=1, lwd=1, col="black")
# }

Run the code above in your browser using DataLab