accuracy_stats: Functions to compute accuracy statistics for SDMs

Description Usage Arguments Value See Also Examples

Description

Given a validation set, calculate root mean-squared error (rmse) or predictive deviance for Bernoulli (1 or 0) data (devBern).

Usage

1
2
rmse(truth, prediction)
devBern(truth, prediction)

Arguments

truth

The true value from the validation set. rmse is a general purpose error metric and can theoretically be used for any type of data. devBern is valid only for binary (1, 0) data.

prediction

The predicted value from the model. For devBern this should be the predicted probability of presence (1 in the truth).

Value

A single number giving the metric of interest.

See Also

dbinom

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
# generate 100 fake datapoints
n <- 100

# 'true' probability of presence
prob <- runif(n)
# true presence/absence
y <- rbinom(n, 1, prob)

# predicted probability of presence
pred <- runif(n)

# Bernoulli deviance of the prediction from the validation set
devBern(y, pred)

# root mean squared error of predicted from true probability of presence
rmse(prob, pred)

SEEG-Oxford/seegSDM documentation built on May 9, 2019, 11:08 a.m.