diff --git a/vignettes/Figures/MultiModelSkill_cor_tas_1992-2012.png b/vignettes/Figures/MultiModelSkill_cor_tas_1992-2012.png deleted file mode 100644 index 13cdd7e1203254f071e77311df840d4e706277b0..0000000000000000000000000000000000000000 Binary files a/vignettes/Figures/MultiModelSkill_cor_tas_1992-2012.png and /dev/null differ diff --git a/vignettes/Figures/MultiModelSkill_cor_tas_1993-2012.png b/vignettes/Figures/MultiModelSkill_cor_tas_1993-2012.png new file mode 100644 index 0000000000000000000000000000000000000000..d87618198c05bcc4ec3fa3e9cf26dd9c5432bb55 Binary files /dev/null and b/vignettes/Figures/MultiModelSkill_cor_tas_1993-2012.png differ diff --git a/vignettes/Figures/MultiModelSkill_rms_tas_1992-2012.png b/vignettes/Figures/MultiModelSkill_rms_tas_1992-2012.png deleted file mode 100644 index 7b10d1e9bff9b4b026a24aaf1820983b06225227..0000000000000000000000000000000000000000 Binary files a/vignettes/Figures/MultiModelSkill_rms_tas_1992-2012.png and /dev/null differ diff --git a/vignettes/Figures/MultiModelSkill_rms_tas_1993-2012.png b/vignettes/Figures/MultiModelSkill_rms_tas_1993-2012.png new file mode 100644 index 0000000000000000000000000000000000000000..199ab861e264bcb25a48959b8dfcbefb179dc473 Binary files /dev/null and b/vignettes/Figures/MultiModelSkill_rms_tas_1993-2012.png differ diff --git a/vignettes/Figures/MultiModelSkill_rmsss_tas_1992-2012.png b/vignettes/Figures/MultiModelSkill_rmsss_tas_1992-2012.png deleted file mode 100644 index 607bcb675f9cae4c44129e483f5fefedab6b8a8c..0000000000000000000000000000000000000000 Binary files a/vignettes/Figures/MultiModelSkill_rmsss_tas_1992-2012.png and /dev/null differ diff --git a/vignettes/Figures/MultiModelSkill_rmsss_tas_1993-2012.png b/vignettes/Figures/MultiModelSkill_rmsss_tas_1993-2012.png new file mode 100644 index 0000000000000000000000000000000000000000..c8ab0c65bee47265e5b1c0990ff72ce4a5f56cf2 Binary files /dev/null and b/vignettes/Figures/MultiModelSkill_rmsss_tas_1993-2012.png differ diff --git a/vignettes/Figures/MultivarRMSE_gloseas5_tas_prlr_1992-2012.png b/vignettes/Figures/MultivarRMSE_gloseas5_tas_prlr_1992-2012.png deleted file mode 100644 index c652c2d2d0f6b792b6658cdb27011f6c690211a5..0000000000000000000000000000000000000000 Binary files a/vignettes/Figures/MultivarRMSE_gloseas5_tas_prlr_1992-2012.png and /dev/null differ diff --git a/vignettes/Figures/MultivarRMSE_gloseas5_tas_prlr_1993-2012.png b/vignettes/Figures/MultivarRMSE_gloseas5_tas_prlr_1993-2012.png new file mode 100644 index 0000000000000000000000000000000000000000..14d7055e00914ddf144262d07dc8af2b6d1c8c3e Binary files /dev/null and b/vignettes/Figures/MultivarRMSE_gloseas5_tas_prlr_1993-2012.png differ diff --git a/vignettes/MultiModelSkill_vignette.Rmd b/vignettes/MultiModelSkill_vignette.Rmd index 3c043b3ada5ee550a8e799982cbde7ad31425687..c32bfa2facc05dcfe4770e43dc0cd4f9f86920bc 100644 --- a/vignettes/MultiModelSkill_vignette.Rmd +++ b/vignettes/MultiModelSkill_vignette.Rmd @@ -1,6 +1,8 @@ --- author: "Nuria Perez" date: "`r Sys.Date()`" +revisor: "Eva Rifà" +revision date: "March 2023" output: rmarkdown::html_vignette vignette: > %\VignetteEngine{knitr::knitr} @@ -41,11 +43,11 @@ clim_var = 'tas' ``` -The simulations available for these models are covering the period 1992-2012. So, the starting and ending dates can be defined by running the following lines: +The simulations available for these models are covering the period 1993-2012. So, the starting and ending dates can be defined by running the following lines: ```r -ini <- 1992 +ini <- 1993 fin <- 2012 start <- as.Date(paste(ini, mth, "01", sep = ""), "%Y%m%d") end <- as.Date(paste(fin, mth, "01", sep = ""), "%Y%m%d") @@ -97,10 +99,10 @@ The corresponding data is saved in the element `data` of each object, while othe ```r > dim(exp$data) dataset member sdate ftime lat lon - 3 9 21 3 35 64 + 3 9 20 3 35 64 > dim(obs$data) dataset member sdate ftime lat lon - 1 1 21 3 35 64 + 1 1 20 3 35 64 Lat <- exp$coords$lat Lon <- exp$coords$lon ``` @@ -119,11 +121,9 @@ The dimensions are preserved: ``` > str(ano_exp$data) - num [1:21, 1, 1, 1:3, 1:35, 1:64] 0.0235 1.5511 1.3932 -0.3437 -5.9858 ... - - attr(*, "dimensions")= chr [1:6] "sdate" "dataset" "member" "ftime" ... + num [1:20, 1:3, 1:9, 1:3, 1:35, 1:64] -1.3958 -0.0484 -0.1326 0.3621 -5.6905 ... > str(ano_obs$data) - num [1:21, 1, 1, 1:3, 1:35, 1:64] 0.0235 1.5511 1.3932 -0.3437 -5.9858 ... - - attr(*, "dimensions")= chr [1:6] "sdate" "dataset" "member" "ftime" ... + num [1:20, 1, 1, 1:3, 1:35, 1:64] 1.551 1.393 -0.344 -5.986 -0.27 ... ``` The ACC is obtained by running the `CST_MultiMetric` function defining the parameter 'metric' as correlation. The function also includes the option of computing the Multi-Model Mean ensemble (MMM). @@ -141,10 +141,10 @@ While other relevant data is being stored in the corresponding element of the ob ```r > str(AnomDJF$data) List of 4 - $ corr : num [1:4, 1, 1:35, 1:64] 0.576 0.649 0.142 0.535 0.459 ... - $ p.val : num [1:4, 1, 1:35, 1:64] 0.003146 0.000735 0.269773 0.00624 0.01825 ... - $ conf.lower: num [1:4, 1, 1:35, 1:64] 0.192 0.3013 -0.3087 0.1342 0.0336 ... - $ conf.upper: num [1:4, 1, 1:35, 1:64] 0.807 0.844 0.54 0.785 0.743 ... + $ corr : num [1:4, 1, 1:35, 1:64] 0.584 0.649 0.131 0.565 0.484 ... + $ p.val : num [1:4, 1, 1:35, 1:64] 0.0034 0.000989 0.291589 0.00475 0.015262 ... + $ conf.lower: num [1:4, 1, 1:35, 1:64] 0.192 0.289 -0.331 0.163 0.053 ... + $ conf.upper: num [1:4, 1, 1:35, 1:64] 0.816 0.848 0.542 0.806 0.763 ... > names(AnomDJF) [1] "data" "dims" "coords" "attrs" > names(AnomDJF$attrs$Datasets) @@ -167,10 +167,10 @@ PlotCombinedMap(AnomDJF$data$corr[,1,,], lon = Lon, lat = Lat, map_select_fun = width = 14, height = 8) ``` -The next figure is the map of the maximum positive Anomaly Correlation Coefficient (ACC) among the three individual models from EUROSIP and the multimodel ensemble. ACC for each model is calculated between their respective predicted ensemble mean anomalies and the anomalies of the observed temperature obtained from ERAINT for winter (DJF) seasons over the period 1992-2012. Blue, red, yellow and black colors indicate that the maximum correlation is obtained for GloSea5, ECMWF, MF and the Multi-Model Mean respectively (similar to figure 3 in Mishra et al., 2018). +The next figure is the map of the maximum positive Anomaly Correlation Coefficient (ACC) among the three individual models from EUROSIP and the multimodel ensemble. ACC for each model is calculated between their respective predicted ensemble mean anomalies and the anomalies of the observed temperature obtained from ERAINT for winter (DJF) seasons over the period 1993-2012. Blue, red, yellow and black colors indicate that the maximum correlation is obtained for GloSea5, ECMWF, MF and the Multi-Model Mean respectively (similar to figure 3 in Mishra et al., 2018). -![Max Skills Correlation](../vignettes/Figures/MultiModelSkill_cor_tas_1992-2012.png) +![Max Skills Correlation](./Figures/MultiModelSkill_cor_tas_1993-2012.png) @@ -180,7 +180,7 @@ The same function can be used to compute the RMS error by defining the parameter ```r AnomDJF <- CST_MultiMetric(exp = ano_exp, obs = ano_obs, metric = 'rms', - multimodel = TRUE) + multimodel = TRUE) ``` The following lines are necessary to obtain the plot which visualizes the best model given this metric for each grid point. @@ -198,7 +198,7 @@ PlotCombinedMap(AnomDJF$data$rms[,1,,], lon = Lon, lat = Lat, map_select_fun = m width = 14, height = 8) ``` -![Max Skills RMS](../vignettes/Figures/MultiModelSkill_rms_tas_1992-2012.png) +![Max Skills RMS](./Figures/MultiModelSkill_rms_tas_1993-2012.png) ### 4.- Computing and plotting Root Mean Square error Skill Scores (RMSSS) @@ -226,4 +226,4 @@ PlotCombinedMap(AnomDJF$data$rmsss[,1,,], lon = Lon, lat = Lat, width = 14, height = 8) ``` -![Max Skills RMSSS](../vignettes/Figures/MultiModelSkill_rmsss_tas_1992-2012.png) +![Max Skills RMSSS](./Figures/MultiModelSkill_rmsss_tas_1993-2012.png) diff --git a/vignettes/MultivarRMSE_vignette.Rmd b/vignettes/MultivarRMSE_vignette.Rmd index 3571972fb86be9d1973fc7a6e2c3c73db3899882..744350a8a083a9b0fdbe1a4e75cfec78c45951d6 100644 --- a/vignettes/MultivarRMSE_vignette.Rmd +++ b/vignettes/MultivarRMSE_vignette.Rmd @@ -1,6 +1,8 @@ --- author: "Deborah Verfaillie" date: "`r Sys.Date()`" +revisor: "Eva Rifà" +revision date: "March 2023" output: rmarkdown::html_vignette vignette: > %\VignetteEngine{knitr::knitr} @@ -40,11 +42,11 @@ temp = 'tas' precip = 'prlr' ``` -The simulations available for this model cover the period 1992-2012. So, the starting and ending dates can be defined by running the following lines: +The simulations available for this model cover the period 1993-2012. So, the starting and ending dates can be defined by running the following lines: ```r -ini <- 1992 +ini <- 1993 fin <- 2012 start <- as.Date(paste(ini, mth, "01", sep = ""), "%Y%m%d") end <- as.Date(paste(fin, mth, "01", sep = ""), "%Y%m%d") @@ -104,10 +106,10 @@ Loading the data using `CST_Load` allows to obtain two lists, one for the experi ``` > dim(exp_T$data) dataset member sdate ftime lat lon - 1 9 21 3 35 64 + 1 9 20 3 35 64 > dim(obs_T$data) dataset member sdate ftime lat lon - 1 1 21 3 35 64 + 1 1 20 3 35 64 ``` Latitudes and longitudes of the common grid can be saved: @@ -129,11 +131,9 @@ The original dimensions are preserved and the anomalies are stored in the `data` ``` > str(ano_exp_T$data) - num [1:21, 1, 1:9, 1:3, 1:35, 1:64] NA -1.3958 -0.0484 -0.1326 0.3621 ... - - attr(*, "dimensions")= chr [1:6] "sdate" "dataset" "member" "ftime" ... + num [1:20, 1, 1:9, 1:3, 1:35, 1:64] -1.3958 -0.0484 -0.1326 0.3621 -5.6905 ... > str(ano_obs_T$data) - num [1:21, 1, 1, 1:3, 1:35, 1:64] 0.0235 1.5511 1.3932 -0.3437 -5.9858 ... - - attr(*, "dimensions")= chr [1:6] "sdate" "dataset" "member" "ftime" ... + num [1:20, 1, 1, 1:3, 1:35, 1:64] 1.551 1.393 -0.344 -5.986 -0.27 ... ``` Two lists containing the experiment ,`ano_exp`, and the observation, `ano_obs`, lists should be put together to serve as input of the function to compute multivariate RMSEs. @@ -163,11 +163,11 @@ The function `CST_MultivarRMSE` returns the multivariate RMSE value for 2 or mor ```r > class(mvrmse) > str(mvrmse$data) -num [1, 1, 1:35, 1:64] 985671 1017234 1023947 1017777 1217653 ... + num [1, 1, 1:35, 1:64] 1002261 1034354 1041180 1034907 1238147 ... > str(mvrmse$attrs$Variable) List of 2 $ varName : chr [1:2] "tas" "prlr" - $ metadata:List of 2 + $ metadata:List of 6 ..$ tas :List of 7 .. ..$ use_dictionary : logi FALSE .. ..$ units : chr "K" @@ -176,6 +176,18 @@ List of 2 .. ..$ daily_agg_cellfun : chr "none" .. ..$ monthly_agg_cellfun: chr "none" .. ..$ verification_time : chr "none" + ..$ lon : num [1:64(1d)] 0 1.41 2.81 4.22 5.62 ... + .. ..- attr(*, "cdo_grid_name")= chr "r256x128" + .. ..- attr(*, "data_across_gw")= logi TRUE + .. ..- attr(*, "array_across_gw")= logi FALSE + .. ..- attr(*, "first_lon")= num 340 + .. ..- attr(*, "last_lon")= num 68.9 + .. ..- attr(*, "projection")= chr "none" + ..$ lat : num [1:35(1d)] 73.8 72.4 71 69.6 68.2 ... + .. ..- attr(*, "cdo_grid_name")= chr "r256x128" + .. ..- attr(*, "first_lat")= num [1(1d)] 26 + .. ..- attr(*, "last_lat")= num [1(1d)] 73.8 + .. ..- attr(*, "projection")= chr "none" ..$ prlr:List of 7 .. ..$ use_dictionary : logi FALSE .. ..$ units : chr "m s-1" @@ -184,6 +196,18 @@ List of 2 .. ..$ daily_agg_cellfun : chr "none" .. ..$ monthly_agg_cellfun: chr "none" .. ..$ verification_time : chr "none" + ..$ lon : num [1:64(1d)] 0 1.41 2.81 4.22 5.62 ... + .. ..- attr(*, "cdo_grid_name")= chr "r256x128" + .. ..- attr(*, "data_across_gw")= logi TRUE + .. ..- attr(*, "array_across_gw")= logi FALSE + .. ..- attr(*, "first_lon")= num 340 + .. ..- attr(*, "last_lon")= num 68.9 + .. ..- attr(*, "projection")= chr "none" + ..$ lat : num [1:35(1d)] 73.8 72.4 71 69.6 68.2 ... + .. ..- attr(*, "cdo_grid_name")= chr "r256x128" + .. ..- attr(*, "first_lat")= num [1(1d)] 26 + .. ..- attr(*, "last_lat")= num [1(1d)] 73.8 + .. ..- attr(*, "projection")= chr "none" ``` The following lines plot the multivariate RMSE @@ -191,11 +215,10 @@ The following lines plot the multivariate RMSE ```r PlotEquiMap(mvrmse$data, lon = Lon, lat = Lat, filled.continents = FALSE, - toptitle = "Multivariate RMSE tas, prlr 1992 - 2012", colNA = "white", - bar_limits = c(0,2.5), cols = brewer.pal(n = 5, name = 'Reds')) + toptitle = "Multivariate RMSE tas, prlr 1993 - 2012", colNA = "white") ``` -![Multivariate RMSE](./Figures/MultivarRMSE_gloseas5_tas_prlr_1992-2012.png) +![Multivariate RMSE](./Figures/MultivarRMSE_gloseas5_tas_prlr_1993-2012.png)