Skip to content
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

Create 2021-09-05-simulation-smoother-using-rcpparmadillo.Rmd #136

Merged
merged 2 commits into from Sep 7, 2021

Conversation

donotdespair
Copy link
Contributor

Dear Dirk,

This is Tomasz from the University of Melbourne. Thank you so much for your contributions to R development and for the family of Rcpp packages. I have been working a lot on working with this software and decided that I will try to contribute to the RcppGallery with a note or two (if time permits) to address a slightly different audience than some other posts.

I am an econometrician developing methodology for applied macroeconomic research. The field operates heavily on Bayesian multivariate time series models that require MCMC estimation on parameter spaces with heavily inflated dimensions. The computational feasibility increasingly determines the feasibility of the research project. Therefore, more and more interest in Rcpp in the field.

The submitted note demonstrates three RcppArmadillo implementations of sampling random draws from a multivariate normal distribution specified by a precision matrix of special types. It addresses econometricians and statisticians beginning their journey of developing codes for their statistical algorithms using Rcpp. I have consulted this note with other academics, PhD students, and some industry specialists and was very surprised by their positive feedback. I think it entirely makes sense to facilitate Rcpp learning and applications to such a group. Therefore, the note.

I am open to your suggestions for improving it and I am happy to learn from your feedback.

I hope that you will find this note worthy of being included in the RcppGallery.

Kind Regards,

Tomasz

This note demonstrates three RcppArmadillo implementations of sampling random draws from a multivariate normal distribution specified by a precision matrix of special types. It is written by an econometrician and addresses econometricianc and statisticians begiining their journey of developing codes for their statistical algorithms using Rcpp.
@eddelbuettel
Copy link
Member

That looks quite comprehensive, thank you. (We generally prefer an issue ticket and quick discussion about scope and merit, as opposed to 'unannounced' PRs like this.) One really quick comment: You should not need the RNGScope instances which get added automatically (see eg Rcpp-FAQ vignette). I noticed that our (very old !!) example for Gibbs sampler and alike still have this so I should remove it there too.

+ deleted line RNGScope scp; from the cpp listings
+ edited one paragraph so that it corresponds closer to this change
@donotdespair
Copy link
Contributor Author

I entirely understand! And this is also how I would usually approach the submission. I'm a bit outside of the IT circles and was not sure how this works though. I also could not find your email address on any page, thought that this must be intentional, and wanted to respect your privacy by simply following the recommendations from the RcppGallery contributions section.

I have already committed and pushed the recommended changes, however, please take your time with providing any further feedback or requests for changes. I'm not in a rush :)

Indeed, I noticed that the packages whose source code I studied, stochvol and shrinkTVP, do not include this line. I thought that this might be due to the code being contained in the packages that could resolve the issue elsewhere. However, I found that c functions in GIGrvg have some such lines. I'll study the FAQ again. I read it at the very beginning of my learning process where some things were not that clear to me yet. Many thanks!

@donotdespair
Copy link
Contributor Author

OK, now, of course, I see your email address in the documentation of the packages. Anyway, the storyline is true I could have been sloppy in my search limiting it to just some websites...

@eddelbuettel
Copy link
Member

Thanks for making the update. In the meantime I also filed an issue and updated the examples in a PR where the RNGScope was left in one case where i could be remove (\pi simulation) and used stronger language in the old-old example using inline (for Gibbs and RNG timing).

And yes, MCMC users have been some of our earliest and strongest adopters, Gregor included, as well of course as Sanjog.

Lastly, the "I am a bit outside of IT circles" made me smile. I am trying to tell my undergrads about "git(hub) as a way of life" and need to prepare a lecture and example about PRs today so this really is not a 'techie' thing. But there are indeed many still not used it, and there is a bit a of barrier. Anyway, your PR looks good but 'talk first' is good too (and we say so here for Rcpp itself. But I don't mention it stringly enough in the very article about Contributing to the Gallery so I shall add it there too.

@eddelbuettel
Copy link
Member

Sorry for the delay but some other things needed taking care of. Merging now.

(And we seem to have an issue with mathjax and the inline display which is a pity. )

@eddelbuettel eddelbuettel merged commit 8ad4a98 into RcppCore:gh-pages Sep 7, 2021
eddelbuettel added a commit that referenced this pull request Sep 7, 2021
@eddelbuettel eddelbuettel mentioned this pull request Sep 7, 2021
@eddelbuettel
Copy link
Member

Updating mathjax to v3 appears to help, see #137 and #138. Should be corrected in due course.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants