Learn R Programming

aqp (version 2.3)

mu_confusion_matrix: Map unit confusion matrix and other classification measures

Description

This function reverse engineers a confusion matrix and other classification measures from soil map unit component percentages (i.e. composition) and area (i.e. acres).

Usage

mu_confusion_matrix(
  x,
  mapunit = "nationalmusym",
  cophase = "coiid",
  comppct = "comppct_r",
  muacres = "muacres"
)

Value

list a confusion matrix, overall purity (OP) (i.e. overall accuracy), map unit purity (MP) (i.e. user accuracy), class representation (CR) (i.e. producer accuracy), and Shannon entropy (E). The measure names were selected to be consistent with the alternative terms proposed by Lark (1995) and Brus (2011).

Arguments

x

data.frame

mapunit

character column name containing the mapunit identifier (e.g. nationalmusym)

cophase

character column name containing the soil component phase identifier (e.g. coiid or paste(compname, localphase))

comppct

character column name containing the component percent (e.g. comppct_r)

muacres

character column name containing the total area of the mapunit (e.g. muacres)

Author

Stephen Roecker

Details

mu_confusion_matrix There are several common statistical measures used to gauge the accuracy of categorical maps. These measures are typically not estimated for soil surveys but can be inferred from a map unit’s soil component composition percentages and size (i.e. acres). In general, overall purity or accuracy (OP) is related to map unit kind (e.g. consociations vs complexes). For several reasons, the “true” accuracies are unknown, and these values should be interpreted as Bayesian prior estimates. However, it is likely that the estimates are optimistic if they haven't been derived from an external validation. Existing and future digital soil mapping products could be used to validate how optimistic the current OA estimates are.

References

  • Brus DJ, Kempen B, Heuvelink GBM. 2011. Sampling for validation of digital soil maps. European Journal of Soil Science. 62(3):394–407. tools:::Rd_expr_doi("10.1111/j.1365-2389.2011.01364.x")

  • Lark RM. 1995. Components of accuracy of maps with special reference to discriminant analysis on remote sensor data. International Journal of Remote Sensing. 16(8):1461–1480. tools:::Rd_expr_doi("10.1080/01431169508954488")

See Also

tauW(), shannonEntropy(), confusionIndex()

Examples

Run this code

# example data
mu <- rbind(
    data.frame(mapunit = "A", cophase = c("Alpha", "Beta"), comppct = c(90, 10), muacres = 100),
    data.frame(mapunit = "B", cophase = c("Beta", "Alpha"), comppct = c(70, 30), muacres = 1000)
    )

mu_confusion_matrix(mu, mapunit = "mapunit", cophase = "cophase", comppct = "comppct")

Run the code above in your browser using DataLab