Skip to content

Commit

Permalink
Merge branch 'ComeOn'
Browse files Browse the repository at this point in the history
  • Loading branch information
donotdespair committed Oct 2, 2022
2 parents 3a4d0e1 + dbcb2c3 commit 75768ef
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
3 changes: 1 addition & 2 deletions inst/tinytest/test_compute_regime_probabilities.R
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,6 @@ expect_identical(
)



# for filtered
set.seed(1)
suppressMessages(
Expand Down Expand Up @@ -86,7 +85,6 @@ expect_true(
)



# for smoothed
set.seed(1)
suppressMessages(
Expand All @@ -102,6 +100,7 @@ expect_true(
)



# for bsvar
set.seed(1)
suppressMessages(
Expand Down
7 changes: 7 additions & 0 deletions src/msh.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,13 @@ mat smoothing_msh (

for (int t=T-2; t>=0; --t) {
smoothed.col(t) = (PR_TR * (smoothed.col(t+1)/(PR_TR.t() * filtered.col(t)) )) % filtered.col(t);
if (any(smoothed.col(t) < 0) || any(smoothed.col(t) > 1)) {
for (int m=0; m<M; m++) {
if (smoothed(m,t) > 1) {smoothed(m,t) = 1;}
if (smoothed(m,t) < 0) {smoothed(m,t) = 0;}
}
smoothed.col(t) = smoothed.col(t) / accu(smoothed.col(t));
}
} // END t loop

return smoothed;
Expand Down

0 comments on commit 75768ef

Please sign in to comment.