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 upMCMC Repeats #21
MCMC Repeats #21
Conversation
I managed to forget an absolute value in the previous commit, which led to the incorrect choice of MCMC repeats.
Adding the number of MCMC repeats to the history element object.
Including recent issue tickets and pull requests
|
Looks good to me. (Just one trivial comment about a use of fabs.) |
| @@ -118,7 +118,7 @@ namespace smc { | |||
| int staticModelAdapt::calcMcmcRepeats(double acceptProb, double desiredAcceptProb, int initialN, int maxReps){ | |||
| if (acceptProb + 1.0 <= 1e-9){ | |||
| return initialN; | |||
| } else if (acceptProb - 1.0 <= 1e-9){ | |||
| } else if (fabs(acceptProb - 1.0) <= 1e-9){ | |||
adamjohansen
Aug 8, 2017
Collaborator
I'm not sure what @eddelbuettel thinks about abs/fabs but I'd be inclined to just use std::abs in C++ code. Not that it is of any consequence... actually,on this instance I would have been inclined to say
if ((acceptProb- 1.0) >= -1e-9) { ...
as there's not much danger of it being larger than 1+1e-9.
I'm not sure what @eddelbuettel thinks about abs/fabs but I'd be inclined to just use std::abs in C++ code. Not that it is of any consequence... actually,on this instance I would have been inclined to say
if ((acceptProb- 1.0) >= -1e-9) { ...
as there's not much danger of it being larger than 1+1e-9.
LeahPrice
Aug 8, 2017
Author
Collaborator
Thanks Adam. I'll use that suggestion.
Thanks Adam. I'll use that suggestion.
|
On the size of the library directory, I'd been wondering about the root cause of this and haven't got around to looking yet. The RcppSMC.so file is rather larger considering what it does -- is it possible we're statically linking against something which we shouldn't be? If it's the size the library needs to be then that's fair enough, but if we're doing something daft that's inflating it to a size rather larger than that of RcppArmadillo.so (which feels likely under the circumstances) then we should certainly address that. I'll have an investigate later on, but I'd better get on with the day job now. |
|
I also prefer The "size of the library directory" is a C++ side effect we cannot do anything about, sadly. I get that with many packages. |
|
Thanks, Dirk, if it's unavoidable I'll stop worrying about it... |
|
And friend has played some tricks to get |
|
Thanks Adam and Dirk. I won't worry about the size note too much for now then. |
|
Hi Leah, I see these two uses of ~/git/rcppsmc(master)$ ag "abs\(" src/staticModelAdapt.cpp
68: err = abs(f_m);
121: } else if (fabs(acceptProb - 1.0) <= 1e-9){
~/git/rcppsmc(master)$ If it were I'd be explicit and use By the way, it is nice that the compilation proceeds without any warnings. We are at pretty good coding / packaging practices now. |
|
Hi Dirk, for some reason the compiler didn't complain about it but I checked and it wasn't using the double version. Thanks for picking up on that. I'll change the first call to std::abs and the second to Adam's suggestion in the next pull request. |
I accidentally left off an absolute value in one of the calculations for the MCMC repeats. This pull request is focused on
Sorry this is a bit of a step backwards in terms of useful pull requests, but I figured it was preferable to do this separately to the next pull request which contains the examples. I have the code for that available here so I will create a pull request for it after this one is sorted.
I had issues with Gitkraken today and ended up having to set up the clone on my desktop again. I don't think that caused any problems.
Can I please get your opinion on the Travis CI note below?