Changes between Version 5 and Version 6 of udg/ecoms/RPackage/examples/visualization


Ignore:
Timestamp:
May 16, 2016 1:09:44 PM (6 years ago)
Author:
dfrias
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • udg/ecoms/RPackage/examples/visualization

    v5 v6  
    6868[[Image(image-20160513-160454.png)]]
    6969
    70 In order to compare the predictions against the observations, these need to be in the same reference grid. We use the interpolation capabilities of `downscaleR` to this aim:
    71 
    72 {{{#!text/R
    73 obsintp <- interpGrid(tx.obs,
    74                   new.coordinates = getGrid(tx.forecast),
    75                   method = "nearest")
    76 ## [2016-05-13 16:06:45] Calculating nearest neighbors...
    77 ## [2016-05-13 16:06:45] Performing nearest interpolation... may take a while
    78 ## [2016-05-13 16:06:45] Done
    79 ## Warning message:
    80 ## In interpGrid(tx.obs, new.coordinates = getGrid(tx.forecast), method = "nearest") :
    81 ##   The new longitudes are outside the data extent
    82 }}}
    8370
    8471We next show different forecast visualization plots:
     
    8875== Tercile plot
    8976
    90 Tercile plots are very useful in order to obtain a quick overview of the overall skill of the predictions over a region of interest.
     77Tercile plots are very useful in order to obtain a quick overview of the overall skill of the predictions over a region of interest. First of all, we select a target year for which the predictions are to be analysed:
    9178
    9279{{{#!text/R
     80year.target <- 1995
    9381tercilePlotS4(prd, obs, year.target, detrend = TRUE, color.pal = "bw")
    9482## Warning messages:
     
    10997== Bubble plots
    11098
    111 
    112 While the tercile plot provides an areal overview, to focus on particular regions bubble plots are very useful. First of all, we select a target year for which the predictions are to be analysed:
     99While the tercile plot provides an areal overview, to focus on particular regions bubble plots are very useful.
     100In order to compare the predictions against the observations for every grid point these need to be in the same reference grid. We use the interpolation capabilities of `downscaleR` to this aim:
    113101
    114102{{{#!text/R
    115 year.target <- 1995
     103obsintp <- interpGrid(tx.obs,
     104                  new.coordinates = getGrid(tx.forecast),
     105                  method = "nearest")
     106## [2016-05-13 16:06:45] Calculating nearest neighbors...
     107## [2016-05-13 16:06:45] Performing nearest interpolation... may take a while
     108## [2016-05-13 16:06:45] Done
     109## Warning message:
     110## In interpGrid(tx.obs, new.coordinates = getGrid(tx.forecast), method = "nearest") :
     111##   The new longitudes are outside the data extent
     112}}}
     113
     114
     115{{{#!text/R
     116bubblePlotS4(prd,
     117             obs,             
     118             year.target,
     119             detrend = FALSE,
     120             size.as.probability=TRUE,
     121             score = TRUE)
     122}}}
     123
     124
     125[[Image(image-20160516-124550.png)]]
     126
     127The bubble plot represents the most likely tercile in colors, the probability of that tercile with the size of the bubble (optional) and the skill of the forecast system for that tercile as transparency of the bubble (optional). Currently, the skill score used is the ROCSS. The color palete for the terciles (blue, grey, red) can be reversed (e.g for precipitation) using the `color.reverse=TRUE` option.
     128
     129Pie charts instead of bubbles can be drawn indicating the predicted likelihood of each tercile, as in this example (using the `piechart=TRUE` option).
     130
     131
     132{{{#!text/R
    116133bubblePlotS4(prd,
    117134             obs,             
     
    126143
    127144
    128 
    129 The bubble plot represents the most likely tercile in colors, the probability of that tercile with the size of the bubble (optional) and the skill of the forecast system for that tercile as transparency of the bubble (optional). Currently, the skill score used is the ROCSS. Pie charts instead of bubbles can be drawn indicating the predicted likelihood of each tercile, as in this example (using the `piechart=TRUE` option).
    130 
    131 
    132145Using the bubble plot allows for instance to test the effect of data detrending, as we suggested in the previous example that may be the source of some -artificial- skill in the north-eastern sector of the study area. We control this through the logical argument `detrend`:
    133146
     
    136149bubblePlotS4(prd,
    137150             obs,
    138              piechart = TRUE,
    139151             year.target,
    140152             detrend = TRUE,
    141              score = TRUE,
    142              color.reverse = TRUE)
     153             piechart = TRUE,
     154             score = TRUE
     155             )
    143156}}}
    144157