Skip to content

Commit 6bec1f2

Browse files
authored
Update R-testing.R
1 parent e93f07c commit 6bec1f2

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

R-testing.R

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,15 +48,15 @@ sprintf("分布式随机数生成时间为 %.2f 秒", Distributed_result$runtime
4848

4949

5050
# metrics for method results
51-
method_metrics <- function(method_result, beta_true) {
51+
method_metrics <- function(method_beta, beta_true) {
5252
beta_index1 = which(beta_true !=0)
53-
beta_index2 = which(method_result$beta !=0)
53+
beta_index2 = which(method_beta !=0)
5454
SC = as.integer( all(beta_index1 %in% beta_index2) )
5555
CF = base::setequal(beta_index2, beta_index1)
5656
AMS = length(beta_index2)
5757
PSR = length( base::intersect(beta_index2, beta_index1) ) / length(beta_index1)
5858
FDR = length( base::setdiff(beta_index2, beta_index1) ) / length(beta_index2)
59-
ME = norm(as.matrix(method_result$beta - beta_true), type = 'f')
59+
ME = norm(as.matrix(method_beta - beta_true), type = 'f')
6060
return(c(SC, CF, AMS, PSR, FDR, ME))
6161
}
6262

@@ -67,3 +67,4 @@ method_metrics <- function(method_result, beta_true) {
6767

6868

6969

70+

0 commit comments

Comments
 (0)