FATE simulationR/POST_FATE.graphic_validationStatistics.R
POST_FATE.graphic_validationStatistics.RdThis 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
)a string corresponding to the main directory
or simulation name of the FATE simulation
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
an integer, or a vector of integer,
corresponding to the simulation year(s) that will be used to extract PFG
relative abundance maps
a data.frame with 4 columns : PFG,
X, Y, obs
(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
(optional) default TRUE.
If TRUE,
plot(s) will be processed, otherwise only the calculation and reorganization
of outputs will occur, be saved and returned
(optional) default 1.
The number of
resources that can be used to parallelize the unzip/zip of raster
files
A list containing one data.frame object with the
following columns, and one ggplot2 object :
PFGconcerned plant functional group
AUC.sdstandard deviation of the AUC values
sensitivity.sdstandard deviation of the sensitivity values
specificity.sdstandard deviation of the specificity values
variablename of the calculated statistic among
sensitivity, specificity, TSS and AUC
valuevalue of the corresponding statistic
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 :
validationStatisticscontaining the data.frame
detailed above
One POST_FATE_[...].pdf file is created :
GRAPHIC_B
validationStatisticsto assess the modeling quality of each PFG based on given observations within the studied area
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 :
PFGthe concerned plant functional group
X, Ythe coordinates of each observation, matching with the
projection of the mask of name.simulation
obseither 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 :
to produce maps of PFG presence / absence from modelled
abundances
(see POST_FATE.binaryMaps)