Skip to content

Commit

Permalink
Merge pull request #519 from dtcenter/issue_516_mode_csi
Browse files Browse the repository at this point in the history
fix for the implementation of OBJCSI and OBJACSI MODE statistics to m…
  • Loading branch information
TatianaBurek authored Feb 15, 2024
2 parents df5bfcf + c381d4e commit 324580d
Showing 1 changed file with 16 additions and 8 deletions.
24 changes: 16 additions & 8 deletions R_work/include/agg_stat_bootstrap.R
Original file line number Diff line number Diff line change
Expand Up @@ -493,12 +493,24 @@ calc3d_OBJFAS=function(d){
return ( alcOBJFAS(d[d$object_type == '3d',]) ) ;
}



calcOBJCSI=function(d){
return ( nrow(d[ d$fcst_flag == 1 & d$matched_flag == 0, ]) /
( nrow(d[ d$simple_flag == 1 & d$matched_flag == 1, ]) + 2 *
nrow(d[ d$simple_flag == 1 & d$matched_flag == 0, ]) ) ) ;
return ( ( nrow(d[ d$simple_flag == 1 & d$matched_flag == 1, ]) / 2 ) /
( ( nrow(d[ d$simple_flag == 1 & d$matched_flag == 1, ]) / 2 ) +
nrow(d[ d$simple_flag == 1 & d$matched_flag == 0, ]) )
)
}

calcOBJACSI=function(d){
return ( ( sum(d[ d$simple_flag == 1 & d$matched_flag == 1, ]$area) / 2 ) /
( ( sum(d[ d$simple_flag == 1 & d$matched_flag == 1, ]$area) / 2 ) +
sum(d[ d$simple_flag == 1 & d$matched_flag == 0, ]$area) )
)
}



calc2d_OBJCSI=function(d){
return ( calcOBJCSI(d[d$object_type == '2d',]) ) ;
}
Expand Down Expand Up @@ -959,11 +971,7 @@ calc3d_OBJVFAS=function(d){
return ( calcOBJAFAS(d[d$object_type == '3d',]) ) ;
}

calcOBJACSI=function(d){
return ( sum( d[ d$simple_flag == 1 & d$matched_flag == 1, ]$area ) /
(sum( d[ d$simple_flag == 1 & d$matched_flag == 1, ]$area ) + 2 *
sum( d[ d$simple_flag == 1 & d$matched_flag == 0, ]$area )) ) ;
}


calc2d_OBJACSI=function(d){
return ( calcOBJACSI(d[d$object_type == '2d',]) ) ;
Expand Down

0 comments on commit 324580d

Please sign in to comment.