View source: R/skill.R View source: R/createPlots.R
skillScore | R Documentation |
Computes threshold-based skill scores including TSS (True Skill Statistic) and AUC (Area Under the Curve) for fishery stock assessment models.
skillScore(x, y, threshold = NULL, reference = 1)
x |
Numeric vector of model predictions (e.g., estimated stock biomass) |
y |
Numeric vector of observed values (e.g., survey biomass index) |
threshold |
Optional numeric vector of decision thresholds for classification |
reference |
Reference value for stock status classification (default = 1, typical BMSY threshold) |
Data.frame containing optimal threshold and associated metrics:
ref: Optimal reference threshold
TP: True positives at threshold
TN: True negatives at threshold
FP: False positives at threshold
FN: False negatives at threshold
TSS: True Skill Statistic (TPR - FPR)
TPR: True Positive Rate (sensitivity)
FPR: False Positive Rate (1 - specificity)
AUC: Area Under ROC Curve
# Simulate stock assessment data
obs_status <- rlnorm(100, meanlog = log(1), sdlog = 0.5)
pred_status <- obs_status * exp(rnorm(100, sd = 0.3))
skillScore(pred_status, obs_status > 1, reference = 1)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.