monitor_performance: Calculate Monitor Prediction Performance

Description Usage Arguments Value See Also Examples

View source: R/monitor_performance.R

Description

This function uses confusion matrix analysis to calculate different measures of predictive performance for every timeseries found in predicted with respect to the observed values found in the single timeseries found in observed.

The requested metric is returned in a dataframe organized with one row per monitor, all available metrics are returned.

Usage

1
2
monitor_performance(predicted, observed, t1, t2, metric = NULL,
  FPCost = 1, FNCost = 1)

Arguments

predicted

ws_monitor object with predicted data

observed

ws_monitor object with observed data

t1

value used to classify predicted measurements

t2

threshold used to classify observed measurements

metric

confusion matrix metric to be used

FPCost

cost associated with false positives (type II error)

FNCost

cost associated with false negatives (type I error)

Value

Dataframe of monitors vs named measure of performance.

See Also

monitorMap_performance

skill_confusionMatrix

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
## Not run: 
# If daily avg data were the prediciton and Spokane were
# the observed, which WA State monitors had skill?
wa <- airnow_load(2017) %>% monitor_subset(stateCodes='WA')
wa_dailyAvg <- monitor_dailyStatistic(wa, mean)
Spokane_dailyAvg <- monitor_subset(wa_dailyAvg, monitorIDs='530630021_01')
threshold <- AQI$breaks_24[4] # Unhealthy
performanceMetrics <- monitor_performance(wa_dailyAvg,
                                          Spokane_dailyAvg,
                                          threshold, threshold)
monitorIDs <- rownames(performanceMetrics)
mask <- performanceMetrics$heidikeSkill &
        !is.na(performanceMetrics$heidikeSkill)
skillfulIDs <- monitorIDs[mask]
skillful <- monitor_subset(wa_dailyAvg, monitorIDs=skillfulIDs)
monitorLeaflet(skillful)

## End(Not run)

PWFSLSmoke documentation built on Oct. 6, 2018, 1:03 a.m.