Learn R Programming

ecospat (version 3.3)

ecospat.CCV.communityEvaluation.prob: Evaluates community predictions directly on the probabilities (i.e., threshold independent)

Description

This function generates a number of community evaluation metrics directly based on the probability returned by the individual models. Instead of thresholding the predictions (ecospat.CCV.communityEvaluation.bin this function directly uses the probability and compares its outcome to null models or average expectations.)

Usage

ecospat.CCV.communityEvaluation.prob(ccv.modeling.data,
    community.metrics=c('SR.deviation','community.AUC','Max.Sorensen',
                         'Max.Jaccard','probabilistic.Sorensen',
                         'probabilistic.Jaccard'),
    parallel = FALSE, 
    cpus = 4)

Value

DataSplitTable

a matrix with TRUE/FALSE for each model run (TRUE=Calibration point, FALSE=Evaluation point)

CommunityEvaluationMetrics.CalibrationSites

a 3-dimensional array containing the community evaluation metrics for the calibartion sites of each run (NA means that the site was used for evaluation)

CommunityEvaluationMetrics.EvaluationSites

a 3-dimensional array containing the community evaluation metrics for the evaluation sites of each run (NA means that the site was used for calibaration)

Arguments

ccv.modeling.data

a 'ccv.modeling.data' object returned by ecospat.CCV.modeling

community.metrics

a selection of community metrics to calculate ('SR.deviation','community.AUC','Max.Sorensen','Max.Jaccard', 'probabilistic.Sorensen','probabilistic.Jaccard'))

parallel

should parallel computing be allowed (TRUE/FALSE)

cpus

number of cpus to use in parallel computing

Author

Daniel Scherrer <daniel.j.a.scherrer@gmail.com>

See Also

ecospat.CCV.createDataSplitTable; ecospat.CCV.communityEvaluation.bin;

Examples

Run this code
  # \donttest{
  #Loading species occurence data and remove empty communities
  testData <- ecospat.testData[,c(24,34,43,45,48,53,55:58,60:63,65:66,68:71)]
  sp.data <- testData[which(rowSums(testData)>0), sort(colnames(testData))]

  #Loading environmental data
  env.data <- ecospat.testData[which(rowSums(testData)>0),4:8]

  #Coordinates for all sites
  xy <- ecospat.testData[which(rowSums(testData)>0),2:3]

  #Running all the models for all species
  myCCV.Models <- ecospat.CCV.modeling(sp.data = sp.data,
                                     env.data = env.data,
                                     xy = xy,
                                     NbRunEval = 2,
                                     minNbPredictors = 10,
                                     VarImport = 2)
                                     
  #Calculating the probabilistic community metrics
  metrics = c('SR.deviation','community.AUC','probabilistic.Sorensen','Max.Sorensen')
  myCCV.Eval.prob <- ecospat.CCV.communityEvaluation.prob(
          ccv.modeling.data = myCCV.Models, 
          community.metrics = metrics)
# }

Run the code above in your browser using DataLab