ggof(sim, obs, na.rm = TRUE, dates, date.fmt = "%Y-%m-%d",
pt.style = "ts", ftype = "o", FUN,
gof.leg = TRUE, digits=2,
legend=c("Sim", "Obs"), leg.cex=1,
tick.tstep = "months", lab.tstep = "years", lab.fmt,
cal.ini=NA, val.ini=NA,
main, xlab = "Time", ylab=c("Q, [m3/s]"),
col = c("blue", "black"),
cex = c(0.5, 0.5), cex.axis=1.2, cex.lab=1.2,
lwd = c(1, 1), lty = c(1, 3), pch = c(1, 9), ...)obs OR sim, the i-th value of obs AND sim arsim and obs time series
If dates is a character or factor, it is converted into Date class, using the date formcal.ini and val.ini. See format in as.Date. Default value is %Y-%ftype is NOT o, it only applies for the annual values. Valid values are:
-) ts : (default) each ts is plotted as a lines along the 'x' axis
-) sim and obs time series are plotted
-) dm : it assumes that sim and obs arftype is in c('dm', 'ma', 'dma'). Function that have to be applied for transforming from daily to monthly or annual time step (e.g., for precipitation FUN MUST be sum, for temperature andsim and obs, and plotted as a legend on the graph. If leg.gof=TRUE, then x is considered as observed and yleg.gof=TRUE. Numeric, representing the decimal places used for rounding the goodness-of-fit indexes.leg.gof=TRUE. Character expansion factor for drawing the legend, *relative* to current 'par("cex")'. Used for text, and provides the default for 'pt.cex' and 'title.cex'. Default value = 1format in as.Date. If not specified, it will try "%Y-%m-%d" when lab.tstep=="days", sim and obspar.par.sim and obssim and obsx and y. (e.g., 1: white circle; 9: white rhombus with a cross inside)sim and obs
( 0 <= br2="" <="1" )<="" description="">=>sim and obs
( 0 <= kge="" <="1" )<="" description="">=>If gof.leg=TRUE, it computes the numerical values of:
'me', 'mae', 'rms', 'nrms', 'PBIAS', 'RSR, 'rSD', 'NSeff', 'mNSeff', 'rNSeff', 'd', 'md, 'rd', 'cp', 'r', 'r.Spearman', 'R2', 'bR2'
gof, plot2obs <- 1:10
sim <- 2:11
ggof(sim, obs)
##################
# Loading daily streamflows of the Ega River (Spain), from 1961 to 1970
require(zoo)
data(EgaEnEstellaQts)
obs <- EgaEnEstellaQts
# Generating a simulated daily time series, initially equal to the observed series
sim <- obs
# Getting the numeric goodness of fit for the "best" (unattainable) case
gof(sim=sim, obs=obs)
# Randomly changing the first 2000 elements of 'sim', by using a normal distribution
# with mean 10 and standard deviation equal to 1 (default of 'rnorm').
sim[1:2000] <- obs[1:2000] + rnorm(2000, mean=10)
# Getting the new numeric goodness of fit
gof(sim=sim, obs=obs)
# Getting the graphical representation of 'obs' and 'sim' along with the numeric
# goodness of fit for the daily and monthly time series
require(hydroTSM)
ggof(sim=sim, obs=obs, ftype="dm", FUN=mean)Run the code above in your browser using DataLab