From a4a821e4afbc37929a089d30fb63df8bf6d9b48e Mon Sep 17 00:00:00 2001 From: Louis-Philippe Caron Date: Fri, 5 Oct 2018 17:41:05 +0200 Subject: [PATCH] Update anomaly_agreement.md --- vignettes/multi-model/anomaly_agreement.md | 24 +++++++++++----------- 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/vignettes/multi-model/anomaly_agreement.md b/vignettes/multi-model/anomaly_agreement.md index 424c485..cc28017 100644 --- a/vignettes/multi-model/anomaly_agreement.md +++ b/vignettes/multi-model/anomaly_agreement.md @@ -36,8 +36,8 @@ library(ggplot2) ### 2- Define the problem and the correspondent data and parameters The aim is to know, compared with a reference period: - - which is the sign of the future anomaly for a certain variable between some models and - - which is the percentage of agreement between models with the main sign. + - what is the sign of the future anomaly for a certain climate variable, and + - what is the percentage of models projecting this anomaly The ilustrative problem is to compare the monthly mean air temperature at 2 m in summer between four different models. The reference period used from the historical simulations to perform the anomalies is 1961 - 1990. While, the future scenario chosen is the rcp2.6 during the period 2006 - 2100. Finally, the region selected in the northern hemisphere is between -40 - 20 ºE and 25 - 60 ºN. @@ -57,7 +57,7 @@ lat <- seq(25, 60, 5) lon <- seq(-35, 20 ,5) ``` -A synthetic sample of data for the reference period is built by adding random perturbation to a sinusoidal function. The latitudinal behavior of the temperature is considered by subtracting randomly a value proportional to the latitud. Furthermore, attributes of time and dimensions are added. +A synthetic sample of data for the reference period is built by adding random perturbation to a sinusoidal function. The latitudinal behavior of the temperature is considered by subtracting randomly a value proportional to the latitude. Furthermore, attributes of time and dimensions are added. ```r multimodel_historical <- NULL @@ -89,7 +89,7 @@ attr(time, "variables") <- metadata attr(multimodel_historical, 'Variables')$dat1$time <- time ``` -A similar procedure is considered to build the synthetic data for the future projections. However, a little trend is added in order to make the data partially more realistic. +A similar procedure is considered to build the synthetic data for the future projections. However, a small trend is added in order to make the data partially more realistic. ```r multimodel_projection <- NULL @@ -122,7 +122,7 @@ attr(time, "variables") <- metadata attr(multimodel_projection, 'Variables')$dat1$time <- time ``` -Now, to objects called `multimodel_historical` and `multimodel_projection` are available in the R environment. A check can be done to the loaded data by comparing with the next lines (due to the random functions the results may differ between each execution): +Now, two objects called `multimodel_historical` and `multimodel_projection` are available in the R environment. A check can be done to the loaded data by comparing with the next lines (due to the random functions the results may differ between each execution): ```r > dim(multimodel_historical) @@ -193,14 +193,14 @@ model var time lon lat 4 1 95 12 8 ``` -+ Also a new dimension will be added by running the function `InsertDim()` in order to obtain the same dimensions of the projections data. `InsertDim()` repeats the original data the required number of times (21 years of future simulations) in the adequated position (the temporal dimension in the summer_projection data is in the third position). ++ A new dimension will be added by running the function `InsertDim()` in order to obtain the same dimensions as the projections data. `InsertDim()` repeats the original data the required number of times (21 years of future simulations) in the adequated position (the temporal dimension in the summer_projection data is in the third position). ```r climatology <- InsertDim(InsertDim(climatology, posdim = 2, lendim = 1), posdim = 3, lendim = 95) ``` -+ The anomaly for each model is obtain by a regular subtraction. ++ The anomaly for each model is obtained by simply subtracting. ```r anomaly <- summer_projection - climatology @@ -208,16 +208,16 @@ anomaly <- summer_projection - climatology ### 4- Multi-model agreement spatial visualitzation -In order to obtain a spatial visualitzation, the temporal mean is performed. So, the time average anomalies for all models is saved in `average` object. `AnoAgree()` function from **ClimProjDiags package** calculates the percentages of models which agrees with a positive or negative mean in each grid point. +In order to obtain a spatial visualitzation, the temporal mean is computed. So, the time average anomalies for all models is saved in the `average` object. `AnoAgree()` function from **ClimProjDiags package** calculates the percentages of models which agrees with a positive or negative mean in each grid point. ```r average <- Mean1Dim(anomaly, which(names(dim(anomaly)) == "time")) agreement <- AnoAgree(average, membersdim = which(names(dim(average)) == "model")) ``` -So, in a four models comparison case, the `agreement` object can take the next values: 100 (all models agree), 75 (only one model has opposite sign), 50 (only two models agree with the mean signal) and 25 (one model agrees with the sign of the mean signal because its magnitude is higher that the other three models) per cent. These values will change with the number of compared models. +So, in a case when four models are being compared, the `agreement` object can take the following values: 100 (all models agree), 75 (only one model has opposite sign), 50 (only two models agree with the mean signal) and 25 (one model agrees with the sign of the mean signal because its magnitude is higher that the other three models). These values will change with the number of compared models. -The next question will be answered by the example plot: Where do 80 % or more models agree in the signal? To obtain this plot the next lines should be running in R. Notice you can modify the threshold by modifying the parameter `agreement_threshold`. The colour map shows the mean temperature anomaly and the dots the model agreement. The plot will be saved with the name "SpatialSummerAgreement.png". +The next question will be answered by the example plot: Where do 80 % or more models agree in the signal? To obtain this plot, the next lines should be run in R. Notice you can modify the threshold by modifying the parameter `agreement_threshold`. The colour map shows the mean temperature anomaly and the dots the model agreement. The plot will be saved with the name "SpatialSummerAgreement.png". ```r agreement_threshold <- 80 @@ -239,7 +239,7 @@ PlotEquiMap(drop(Mean1Dim(average, which(names(dim(average)) == "model"))), ### 5- Multi-model agreement temporal visualization -To visualize the time evolution of multi-model agreement, the spatial average is performed by a grid pixel size using the `WeightedMean` function from the **ClimProjDiags package**. Also, a smooth filter is applied with the `Smoothing()` function from the **s2dverifiction package**. In this example, a 5 years moving window filter is applied by defining the parameter `runmeanlen = 5`. +To visualize the time evolution of multi-model agreement, the spatial average is performed by a grid pixel size using the `WeightedMean` function from the **ClimProjDiags package**. Also, a smooth filter is applied with the `Smoothing()` function from the **s2dverifiction package**. In this example, a 5-year moving window filter is applied by defining the parameter `runmeanlen = 5`. ```r temporal <- drop(WeightedMean(anomaly, lon = lon, lat = lat, mask = NULL)) @@ -280,7 +280,7 @@ ggsave(filename = "TemporalSummerAgreement.png", g, device = NULL, width = 8, height = 5, units = 'in', dpi = 100) ``` -*Note: if a warning appears when plotting the temporal time series, it should be due to the NA's values introduced when smoothing the time series.* +*Note: if a warning appears when plotting the temporal time series, it might be due to the NA's values introduced when smoothing the time series.* ![Temporal evolution of the mean summer agreement of air temperature](TemporalSummerAgreement.png) -- GitLab