Skip to content

Working with a moving window (introducing seasonality)

miturbide edited this page Jun 11, 2018 · 18 revisions

By default, the whole train period as defined by the user is considered to calibrate the methods. It is also interesting to correct each day of the year (doy) independently by using a moving window centered on each doy to calibrate the correction. Therefore, instead of having one correction function for the whole period , there would be one correction for each doy. The user can specify the length (in days) of the moving window by means of the property CorrectionWindow.

# precipitation
data(VALUE_Iberia_pr)
y <- VALUE_Iberia_pr
data(NCEP_Iberia_pr)
x <- gridArithmetics(NCEP_Iberia_pr, 86400, operator = "*")

cal <- biasCorrection(y = y, x = x,
                            precipitation = TRUE,
                            method = "eqm",
                            wet.threshold = 0.1)

cal.win <- biasCorrection(y = y, x = x,
                            precipitation = TRUE,
                            method = "eqm",
                            window = c(30, 15),
                            wet.threshold = 0.1)
# precipitation
quickDiagnostics(y, x, cal, type = "daily", location = c(-2.0392, 43.3075))

# precipitation
quickDiagnostics(y, x, cal.win, type = "daily", location = c(-2.0392, 43.3075))

# time series plotting for Igueldo station
Igueldo.cal <- subsetGrid(cal, station.id = "000234")
Igueldo.cal.win <- subsetGrid(cal.win, station.id = "000234")
Ig.coords <- getCoordinates(Igueldo.cal)
temporalPlot(Igueldo.cal, Igueldo.cal.win, cols = c("blue", "green"), x.axis = "index")


<-- Home page of the Wiki

print(sessionInfo())
Clone this wiki locally