-
Notifications
You must be signed in to change notification settings - Fork 13
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Switching to a population level object #2
Conversation
Instead of having a particle level object, this version uses a population level object with values stored in an std::vector and log weights stored in an arma::vec. An MCMC step was also added to Initialise().
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks pretty good!
The Travis CI run failed, and that is partly my fault as the setup is fairly rigid. The package now needs RcppArmadillo, and we have to add this.
That is as easy as:
1 file changed, 1 insertion(+), 1 deletion(-)
.travis.yml | 2 +-
modified .travis.yml
@@ -13,7 +13,7 @@ before_install:
- ./run.sh bootstrap
install:
- - ./run.sh install_aptget r-cran-rcpp
+ - ./run.sh install_aptget r-cran-rcpp r-cran-rcpparmaillo
script:
- ./run.sh run_tests
Can you please try this?
Sure, thank you for the lines to fix this! It looks like it passed this time. |
I think with that we're good. Let's wait for @adamjohansen to take a peek at it, but I think we got this one covered now. Yay! (As for going forward: go to the travis-ci.org website and assign your rcppsmc (and/or other repos you want tested. You need to turn this one at a time for new repos. Forks usually work as is, but because you were not set up before it did not automagically work. This is hugely worth it so I recommend you look into it.) |
Cool, thank you! Yeah it'll be nice to not get a surprise failure with Travis CI when I do future pull requests. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There are a few small things (indentation etc) in here which we can clean up later.
and removing particle.h because it was replaced by population.h in a previous commit.
Using Rcpp attributes, using a namespace for each example and switching to armadillo vectors where possible in the examples.
Thanks for the additional commits. I think it might be best to just hold off committing until @adamjohansen is back online (which should be today) and we can finalize this. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks great to me. Thanks both of you and apologies for the slow reply...
inst/include/sampler.h
Outdated
@@ -112,6 +115,8 @@ namespace smc { | |||
double GetParticleLogWeightN(long n) const { return pPopulation.GetLogWeightN(n); } | |||
///Return the unnormalized weight of particle n | |||
double GetParticleWeightN(long n) const { return pPopulation.GetWeightN(n); } | |||
///Return the unnormalized weight of particle n |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does this comment match what the function actually does?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah yes you're right, thanks. I meant to say "Return the unnormalised weights of the particles". I'll fix that up now.
Also sorry Adam, I for some reason thought that my commits today wouldn't show up on this pull request. I hope this wasn't too annoying for you to review. |
You could revert these commits. Not yet saying you should, just saying you could. If you want commits to be somewhere else, create a branch first. What happened here is perfectly logical and a feature -- one wants to be able to add to / augment a pull request. |
But I think we're good. here. Let me merge this now, and then we can do smaller / simpler follow-up PRs. |
@LeahPrice One thing you want to look into is defining your username and email:
"Unknown" is not the type of credit you want in the long run. |
Okay cool, thanks. I still haven't fixed that comment for the function so I'll do that in another pull request then. |
Instead of having a particle level object, this version uses a population level object with values stored in an std::vector and log weights stored in an arma::vec.
An MCMC step was also added to Initialise().