Aim of the practice

We will repeat the demo previously done but using a seasonal forecast with several members.

First of all, we must to install or load the downscaleR R-package:

# If we have not installed the "devtools" library we should do it:
# install.packages("devtools")
library(devtools)
## Warning: package 'devtools' was built under R version 3.1.1
## WARNING: Rtools is required to build R packages, but is not currently installed.
## 
## Please download and install Rtools 3.1 from http://cran.r-project.org/bin/windows/Rtools/ and then run find_rtools().
## 
## Attaching package: 'devtools'
## 
## The following objects are masked from 'package:utils':
## 
##     ?, help
## 
## The following object is masked from 'package:base':
## 
##     system.file
# Installing the downscaleR R-package
devtools::install_github(c("SantanderMetGroup/downscaleR.java@stable","SantanderMetGroup/downscaleR@stable","SantanderMetGroup/ecomsUDG.Raccess@stable"))
## Installing github repo downscaleR.java/stable from SantanderMetGroup
## Downloading stable.zip from https://github.com/SantanderMetGroup/downscaleR.java/archive/stable.zip
## Installing package from C:\Users\sixto\AppData\Local\Temp\Rtmp6VRSa5/stable.zip
## Installing downscaleR.java
## "C:/PROGRA~1/R/R-31~1.0/bin/x64/R" --vanilla CMD INSTALL  \
##   "C:\Users\sixto\AppData\Local\Temp\Rtmp6VRSa5\devtools9487bfdcda\downscaleR.java-stable"  \
##   --library="C:/Users/sixto/Documents/R/win-library/3.1"  \
##   --install-tests 
## 
## Installing github repo downscaleR/stable from SantanderMetGroup
## Downloading stable.zip from https://github.com/SantanderMetGroup/downscaleR/archive/stable.zip
## Installing package from C:\Users\sixto\AppData\Local\Temp\Rtmp6VRSa5/stable.zip
## Installing downscaleR
## "C:/PROGRA~1/R/R-31~1.0/bin/x64/R" --vanilla CMD INSTALL  \
##   "C:\Users\sixto\AppData\Local\Temp\Rtmp6VRSa5\devtools9481fdc3468\downscaleR-stable"  \
##   --library="C:/Users/sixto/Documents/R/win-library/3.1"  \
##   --install-tests 
## 
## Installing github repo ecomsUDG.Raccess/stable from SantanderMetGroup
## Downloading stable.zip from https://github.com/SantanderMetGroup/ecomsUDG.Raccess/archive/stable.zip
## Installing package from C:\Users\sixto\AppData\Local\Temp\Rtmp6VRSa5/stable.zip
## Installing ecomsUDG.Raccess
## "C:/PROGRA~1/R/R-31~1.0/bin/x64/R" --vanilla CMD INSTALL  \
##   "C:\Users\sixto\AppData\Local\Temp\Rtmp6VRSa5\devtools9482fa66cd4\ecomsUDG.Raccess-stable"  \
##   --library="C:/Users/sixto/Documents/R/win-library/3.1"  \
##   --install-tests
library(downscaleR)
## Loading required package: rJava
## Loading required package: downscaleR.java
## NetCDF Java Library v4.3.22 (27 May 2014) loaded and ready
## Loading required package: maps
## downscaleR version 0.4-2 (11-Sep-2014) is loaded
library(ecomsUDG.Raccess)
## ecomsUDG.Raccess version 2.2-5 (06 Sep 2014) is loaded
loginECOMS_UDG("username", "password")

We load the observations

gsn.data.dir <- file.path(find.package("downscaleR"), "datasets/observations/GSN_Iberia")
obs <- loadStationData(dataset = gsn.data.dir, var="tmean", lonLim = c(-10,5), latLim = c(34,44), season=c(12,1,2), years = 1991:2010)
## [2014-09-18 09:01:12] Loading data ...
## [2014-09-18 09:01:12] Retrieving metadata ...
## [2014-09-18 09:01:12] Done.

and the seasonal forecast from the ECOMS User Data Gateway, considering again the domain of analysis, the target season and the calibration period. Explore the returned objects and estimate the bias of the forecast in the control period.

# Loading the seasonal forecast: System4_seasonal_15
prd <- loadECOMS(dataset = "System4_seasonal_15", var = "tas", members = 1:9, lonLim = c(-10,5), latLim = c(34,44), season = c(12,1,2), years = 1991:2010, leadMonth = 3, time = "DD")
## [2014-09-18 09:01:12] Defining homogeneization parameters for variable "tas"
## [2014-09-18 09:01:14] Defining geo-location parameters
## [2014-09-18 09:01:14] Defining initialization time parameters
## [2014-09-18 09:01:15] Retrieving data subset ...
## [2014-09-18 09:02:45] Done
# Loading the seasonal forecast: CFSv2_seasonal_16
# prd <- loadECOMS(dataset = "CFSv2_seasonal_16", var = "tas", members = 1:9, lonLim = c(-10,5), latLim = c(34,44), season = c(12,1,2), years = 1991:2010, leadMonth = 3, time = "DD")
# REMEMBER: We should interpolate the observations to the grid of model: we use the method "nearest" and the getGrid function to ensure spatial consistency:
obs <- interpGridData(obs, new.grid = getGrid(prd), method = "nearest")
## Warning: The new longitudes are outside the data extent
## Warning: The new latitudes are outside the data extent
## [2014-09-18 09:02:45] Performing nearest interpolation... may take a while
## [2014-09-18 09:02:51] Done

We could analyze the skill of our multi-member seasonal forecast with the tercileValidation (type ?tercileValidation for more details)

# This is a plot that performs the mean of all stations
tercileValidation(prd, obs = obs)# Raw skill
## Warning: The results presented are the spatial mean of the
## input field

plot of chunk unnamed-chunk-6

Extend the analysis to other regions of the world with different seasonal forecast performance (e.g. Peru, Philipines, etc.)