This script is designed to produce a graphical representation of several statistics (sensitivity, specificity, TSS, AUC) for quality assessment for one (or several) specific FATE simulation year.

POST_FATE.graphic_validationStatistics(
  name.simulation,
  file.simulParam = NULL,
  years,
  mat.PFG.obs,
  opt.ras_habitat = NULL,
  opt.doPlot = TRUE,
  opt.no_CPU = 1
)

Arguments

name.simulation

a string corresponding to the main directory or simulation name of the FATE simulation

file.simulParam

default NULL.
A string corresponding to the name of a parameter file that will be contained into the PARAM_SIMUL folder of the FATE simulation

years

an integer, or a vector of integer, corresponding to the simulation year(s) that will be used to extract PFG relative abundance maps

mat.PFG.obs

a data.frame with 4 columns : PFG, X, Y, obs

opt.ras_habitat

(optional) default NULL.
A string corresponding to the file name of a raster mask, with an integer value within each pixel, corresponding to a specific habitat

opt.doPlot

(optional) default TRUE.
If TRUE, plot(s) will be processed, otherwise only the calculation and reorganization of outputs will occur, be saved and returned

opt.no_CPU

(optional) default 1.
The number of resources that can be used to parallelize the unzip/zip of raster files

Value

A list containing one data.frame object with the following columns, and one ggplot2 object :

tab

PFG

concerned plant functional group

AUC.sd

standard deviation of the AUC values

sensitivity.sd

standard deviation of the sensitivity values

specificity.sd

standard deviation of the specificity values

variable

name of the calculated statistic among sensitivity, specificity, TSS and AUC

value

value of the corresponding statistic

plot

ggplot2 object, representing the values for each PFG of these four validation statistics (sensitivity, specificity, TSS, AUC)

One POST_FATE_TABLE_YEAR_[...].csv file is created :

validationStatistics

containing the data.frame detailed above

One POST_FATE_[...].pdf file is created :

GRAPHIC_B
validationStatistics

to assess the modeling quality of each PFG based on given observations within the studied area

Details

This function allows to obtain, for a specific FATE simulation and a specific parameter file within this simulation, PFG validation statistic values and one preanalytical graphic.

Observation records (presences and absences) are required for each PFG within the mat.PFG.obs object :

PFG

the concerned plant functional group

X, Y

the coordinates of each observation, matching with the projection of the mask of name.simulation

obs

either 0 or 1 to indicate presence or absence

For each PFG and each selected simulation year, raster maps are retrieved from the results folder ABUND_REL_perPFG_allStrata and lead to the production of one table :

  • the value of several statistics to evaluate the predictive quality of the model for each plant functional group
    (sensitivity, specificity, auc, TSS = sensitivity + specificity - 1)

If a raster mask for habitat has been provided, the values and graphics will be also calculated per habitat.

It requires that the POST_FATE.relativeAbund function has been run and that the folder ABUND_REL_perPFG_allStrata exists.

This .csv file can then be used by other functions :

Author

Isabelle Boulangeat, Damien Georges, Maya Guéguen