cost_functions: Cost functions

Description Usage Arguments Examples

Description

This method uses algebraic method assuming normal distribution of the residuals. This is done by using sd rather than RSE from lm model.

Usage

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
cost_MBE(
  observed,
  predicted,
  SESOI_lower = 0,
  SESOI_upper = 0,
  negative_weight = 1,
  positive_weight = 1,
  na.rm = FALSE
)

cost_MAE(
  observed,
  predicted,
  SESOI_lower = 0,
  SESOI_upper = 0,
  negative_weight = 1,
  positive_weight = 1,
  na.rm = FALSE
)

cost_MSE(
  observed,
  predicted,
  SESOI_lower = 0,
  SESOI_upper = 0,
  negative_weight = 1,
  positive_weight = 1,
  na.rm = FALSE
)

cost_RMSE(
  observed,
  predicted,
  SESOI_lower = 0,
  SESOI_upper = 0,
  negative_weight = 1,
  positive_weight = 1,
  na.rm = FALSE
)

cost_SSE(
  observed,
  predicted,
  SESOI_lower = 0,
  SESOI_upper = 0,
  negative_weight = 1,
  positive_weight = 1,
  na.rm = FALSE
)

cost_MinErr(
  observed,
  predicted,
  SESOI_lower = 0,
  SESOI_upper = 0,
  negative_weight = 1,
  positive_weight = 1,
  na.rm = FALSE
)

cost_MaxErr(
  observed,
  predicted,
  SESOI_lower = 0,
  SESOI_upper = 0,
  negative_weight = 1,
  positive_weight = 1,
  na.rm = FALSE
)

cost_MaxAbsErr(
  observed,
  predicted,
  SESOI_lower = 0,
  SESOI_upper = 0,
  negative_weight = 1,
  positive_weight = 1,
  na.rm = FALSE
)

cost_MaxSqErr(
  observed,
  predicted,
  SESOI_lower = 0,
  SESOI_upper = 0,
  negative_weight = 1,
  positive_weight = 1,
  na.rm = FALSE
)

cost_R_squared(
  observed,
  predicted,
  SESOI_lower = 0,
  SESOI_upper = 0,
  negative_weight = 1,
  positive_weight = 1,
  na.rm = FALSE
)

cost_SESOItoRMSE(
  observed,
  predicted,
  SESOI_lower = 0,
  SESOI_upper = 0,
  negative_weight = 1,
  positive_weight = 1,
  na.rm = FALSE
)

cost_PPER(
  observed,
  predicted,
  SESOI_lower = 0,
  SESOI_upper = 0,
  negative_weight = 1,
  positive_weight = 1,
  na.rm = FALSE
)

cost_MHE(
  observed,
  predicted,
  SESOI_lower = 0,
  SESOI_upper = 0,
  negative_weight = 1,
  positive_weight = 1,
  na.rm = FALSE
)

cost_RMHE(
  observed,
  predicted,
  SESOI_lower = 0,
  SESOI_upper = 0,
  negative_weight = 1,
  positive_weight = 1,
  na.rm = FALSE
)

Arguments

observed

Numeric vector

predicted

Numeric vector

SESOI_lower

Lower smallest effect size of interest threshold

SESOI_upper

Upper smallest effect size of interest threshold

negative_weight

How should negative residuals be weighted? Default is 1

positive_weight

How should positive residuals be weighted? Default is 1

na.rm

Should NAs be removed? Default is FALSE

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
data("yoyo_mas_data")

model <- lm(MAS ~ YoYoIR1, yoyo_mas_data)

observed <- yoyo_mas_data$MAS
predicted <- predict(model)

SESOI_lower <- -0.5
SESOI_upper <- 0.5

# Mean Squared Error
cost_MSE(
  observed = observed,
  predicted = predicted,
  SESOI_lower = SESOI_lower,
  SESOI_upper = SESOI_upper
)

# Mean Absolute Error
cost_MAE(
  observed = observed,
  predicted = predicted,
  SESOI_lower = SESOI_lower,
  SESOI_upper = SESOI_upper
)

# Root Mean Squared Error
cost_RMSE(
  observed = observed,
  predicted = predicted,
  SESOI_lower = SESOI_lower,
  SESOI_upper = SESOI_upper
)

# Bias
cost_MBE(
  observed = observed,
  predicted = predicted,
  SESOI_lower = SESOI_lower,
  SESOI_upper = SESOI_upper
)

# Sum of Squared Errors
cost_SSE(
  observed = observed,
  predicted = predicted,
  SESOI_lower = SESOI_lower,
  SESOI_upper = SESOI_upper
)

# Proportion of Practically Equivalent Residuals
cost_PPER(
  observed = observed,
  predicted = predicted,
  SESOI_lower = SESOI_lower,
  SESOI_upper = SESOI_upper
)

mladenjovanovic/bmbstats documentation built on Aug. 5, 2020, 4:20 p.m.