Skip to content

Commit d89bdcb

Browse files
Cosmetic change
1 parent 842fd9e commit d89bdcb

File tree

1 file changed

+4
-7
lines changed

1 file changed

+4
-7
lines changed

src/gibbs_functions_compare.cpp

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1286,7 +1286,7 @@ double compare_log_pseudolikelihood_ratio_main_differences(NumericMatrix thresho
12861286
denominator_proposed += std::exp(exponent +
12871287
thresholds(variable, category) -
12881288
.5 * proposed_states[category]);
1289-
denominator_current += std::exp(exponent +
1289+
denominator_current += std::exp(exponent +
12901290
thresholds(variable, category) -
12911291
.5 * current_states[category]);
12921292
}
@@ -1312,7 +1312,7 @@ double compare_log_pseudolikelihood_ratio_main_differences(NumericMatrix thresho
13121312
denominator_proposed += std::exp(exponent +
13131313
thresholds(variable, category) +
13141314
.5 * proposed_states[category]);
1315-
denominator_current += std::exp(exponent +
1315+
denominator_current += std::exp(exponent +
13161316
thresholds(variable, category) +
13171317
.5 * current_states[category]);
13181318
}
@@ -1361,17 +1361,14 @@ void compare_metropolis_main_difference_regular_between_model(NumericMatrix thre
13611361
if(indicator(variable, variable) == 0) {
13621362
proposed_state = R::rnorm(current_state, proposal_sd_main_difference(variable, category));
13631363
proposed_states[category] = proposed_state;
1364-
} else {
1365-
proposed_state = 0.0;
1366-
proposed_states[category] = proposed_state;
1367-
}
1368-
if(indicator(variable, variable) == 0) {
13691364
log_prob += R::dcauchy(proposed_state, 0.0, main_difference_scale, true);
13701365
log_prob -= R::dnorm(proposed_state,
13711366
current_state,
13721367
proposal_sd_main_difference(variable, category),
13731368
true);
13741369
} else {
1370+
proposed_state = 0.0;
1371+
proposed_states[category] = proposed_state;
13751372
log_prob -= R::dcauchy(current_state, 0.0, main_difference_scale, true);
13761373
log_prob += R::dnorm(current_state,
13771374
proposed_state,

0 commit comments

Comments
 (0)