Skip to content

Commit

Permalink
fix for the implementation of OBJCSI and OBJACSI MODE statistics to m…
Browse files Browse the repository at this point in the history
…atch the definition listed in the MET documentation #516
  • Loading branch information
TatianaBurek committed Feb 15, 2024
1 parent df5bfcf commit c381d4e
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 c381d4e

Please sign in to comment.