Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upSwitching 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().
|
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_testsCan 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 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. |
|
This looks great to me. Thanks both of you and apologies for the slow reply... |
| @@ -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 | |||
adamjohansen
Jul 24, 2017
Collaborator
Does this comment match what the function actually does?
Does this comment match what the function actually does?
LeahPrice
Jul 24, 2017
Author
Collaborator
Ah yes you're right, thanks. I meant to say "Return the unnormalised weights of the particles". I'll fix that up now.
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().