Skip to content

Commit 8f70fd5

Browse files
For metric docs
1 parent 093ccc1 commit 8f70fd5

1 file changed

Lines changed: 9 additions & 6 deletions

File tree

src/metrics.jl

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,10 @@ end
139139
"""
140140
NSE(obs, sim)
141141
142-
The Nash-Sutcliffe Efficiency score
142+
The Nash-Sutcliffe Efficiency score.
143+
144+
Ranges from 1.0 to -∞, where values below zero indicate the mean of
145+
observations would outperform a model.
143146
"""
144147
function NSE(obs, sim)
145148
return 1.0 - sum((obs .- sim) .^ 2) / sum((obs .- mean(obs)) .^ 2)
@@ -164,7 +167,7 @@ end
164167
"""
165168
RMSE(obs, sim)
166169
167-
Root Mean Square Error
170+
Root Mean Square Error.
168171
"""
169172
function RMSE(obs, sim)
170173
return (sum((sim .- obs) .^ 2) / length(sim))^0.5
@@ -186,7 +189,7 @@ end
186189
"""
187190
ADJ_R2(obs, sim, p::Int64)::Float64
188191
189-
Adjusted R²
192+
Adjusted R².
190193
191194
# Arguments
192195
- `obs::Vector` : observations
@@ -204,15 +207,15 @@ end
204207
"""
205208
MAE(obs, sim)
206209
207-
Mean Absolute Error
210+
Mean Absolute Error.
208211
"""
209212
MAE(obs, sim) = mean(abs.(sim .- obs))
210213

211214

212215
"""
213216
ME(obs, sim)
214217
215-
Mean Error
218+
Mean Error.
216219
"""
217220
ME(obs, sim) = mean(sim .- obs)
218221

@@ -471,7 +474,7 @@ function mKGE(obs, sim; scaling=(1.0, 1.0, 1.0))::Float64
471474
# Timing (Pearson's correlation)
472475
r = Statistics.cor(obs, sim)
473476
if isnan(r)
474-
# can happen if obs or sim is a constant (std of 0)
477+
# Can happen if obs or sim is a constant (std of 0)
475478
r = all(obs .== sim) ? 1.0 : 0.0
476479
end
477480

0 commit comments

Comments
 (0)