Skip to content

Commit 4476b46

Browse files
authored
Update stat.R clean code
clean some comments and remove an unncescessery line
1 parent d157855 commit 4476b46

File tree

1 file changed

+5
-11
lines changed

1 file changed

+5
-11
lines changed

R/stat.R

Lines changed: 5 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -180,14 +180,11 @@ stat <- function(model, observation,
180180

181181
Obs = mean(observation, na.rm = TRUE)
182182
Mod = mean(model, na.rm = TRUE)
183-
MB = mean(model-observation)
184-
MAGE = mean(abs(model-observation))
185-
MNB = mean((model-observation)/observation)
186-
MNGE = mean(abs(model-observation)/observation)
183+
MB = mean(model-observation, na.rm = TRUE)
184+
MAGE = mean(abs(model-observation), na.rm = TRUE)
185+
MNB = mean((model-observation)/observation, na.rm = TRUE)
186+
MNGE = mean(abs(model-observation)/observation, na.rm = TRUE)
187187
NMB = 100 * (Mod-Obs)/Obs
188-
s = model + observation
189-
# MFB = 200 * mean(model/s - observation/s )
190-
# MFE = 200 * mean(abs( model/s - observation/s ))
191188

192189
if(is.na(cutoff_NME[[1]])){
193190
NME = 100 * MAGE / Obs
@@ -206,10 +203,7 @@ stat <- function(model, observation,
206203
FA2 = FA2(model,observation),
207204
RMSE = sqrt(mean((observation - model)^2)),
208205
MB = MB,
209-
ME = MAGE,
210-
# GE = MAGE,
211-
# `MFB (%)` = MFB,
212-
# `MFE (%)` = MFE,
206+
ME = MAGE, # GE
213207
`NMB (%)` = NMB,
214208
`NME (%)` = NME))
215209

0 commit comments

Comments
 (0)