Skip to content

Commit

Permalink
bug fix for drawing too many in a iteration
Browse files Browse the repository at this point in the history
  • Loading branch information
alexkowa committed Nov 12, 2017
1 parent 587e9e2 commit 2daecd6
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions R/simAnnealingDT.R
Original file line number Diff line number Diff line change
Expand Up @@ -92,8 +92,12 @@ simAnnealingDT <- function(data0,totals0,params,sizefactor=2,sample.prob=TRUE,ch
prob_add <- totals_diff[init_group[select_add],prob_add]
prob_remove <- totals_diff[init_group[select_remove],prob_remove]

add_hh <- select_add[sample_int_expj(length(select_add),redraw,prob=prob_add)]-1
remove_hh <- select_remove[sample_int_expj(length(select_remove),redraw,prob=prob_remove)]-1
add_hh <- select_add[sample_int_expj(length(select_add),
min(c(redraw,length(select_add))),
prob=prob_add)]-1
remove_hh <- select_remove[sample_int_expj(length(select_remove),
min(c(redraw,length(select_remove))),
prob=prob_remove)]-1

}else{
prob_remove <- prob_add <- NULL
Expand Down

0 comments on commit 2daecd6

Please sign in to comment.