-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathcalc.rmseP.R
69 lines (42 loc) · 911 Bytes
/
calc.rmseP.R
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
##Calculate RMSE%
#Error calculation
#'
#' @param Pred predicted values
#' @param Ref Reference values
#'
#' @return E Error in %
EP<-function(Pred,Ref){
E=(Pred-Ref)/Ref
E
}
#Calculation of SE %
#'
#' @param Pred predicted values
#' @param Ref Reference values
#'
#' @return SE Standard Error in %
seP<-function(Pred,Ref){
SE= (EP(Pred, Ref))^2
return(SE)
}
#Calculation of MSE %
#'
#' @param Pred predicted values
#' @param Ref Reference values
#'
#' @return MSE Mean Squared Error in %
mseP<-function(Pred,Ref){
MSE= mean(seP(Pred, Ref))
return(MSE)
}
#Calculation of RMSE %
#'
#' @param Pred predicted values
#' @param Ref Reference values
#'
#' @return RMSE in %
rmseP<-function(Pred,Ref){
MSE= sqrt(mseP(Pred, Ref))
return(MSE)
}
##################################################