C++ – StatsBlogs Statistics Blogs Sat, 29 Jun 2019 22:19:02 +0000 en-US hourly 1 https://wordpress.org/?v=5.0.2 Not Always C++’s Fault /2019/04/06/not-always-cs-fault/ Sat, 06 Apr 2019 22:58:36 +0000 http://www.win-vector.com/blog/?p=6249 From the recent developer.r-project.org “Staged Install” article: Incidentally, there were just two distinct (very long) lists of methods in the warnings across all installed packages in my run, but repeated for many packages. It turned out that they were lists of exported methods from dplyr and rlang packages. These two packages take very long to … Continue reading Not Always C++’s Fault

The post Not Always C++’s Fault appeared first on StatsBlogs.

]]>
Why RcppDynProg is Written in C++ /2019/04/05/why-rcppdynprog-is-written-in-c/ Fri, 05 Apr 2019 17:18:23 +0000 http://www.win-vector.com/blog/?p=6242 The (matter of opinion) claim: “When the use of C++ is very limited and easy to avoid, perhaps it is the best option to do that […]” (source discussed here) got me thinking: does our own RcppDynProg package actually use C++ in a significant way? Could/should I port it to C? Am I informed enough … Continue reading Why RcppDynProg is Written in C++

The post Why RcppDynProg is Written in C++ appeared first on StatsBlogs.

]]>
C++ is Often Used in R Packages /2019/04/03/c-is-often-used-in-r-packages/ Wed, 03 Apr 2019 16:51:05 +0000 http://www.win-vector.com/blog/?p=6228 The recent r-project article “Use of C++ in Packages” stated as its own summary of recommendation: don’t use C++ to interface with R. A careful reading of the article exposes at least two possible meanings of this: Don’t use C++ to directly call R or directly manipulate R structures. A technical point directly argued (for … Continue reading C++ is Often Used in R Packages

The post C++ is Often Used in R Packages appeared first on StatsBlogs.

]]>
(x=scan())%in%(2*4^(n=0:x)-2^n-1) /2019/03/27/xscanin24n0x-2n-1/ Wed, 27 Mar 2019 23:19:13 +0000 http://xianblog.wordpress.com/?p=38522 One challenge on code golf is to find the shortest possible code to identify whether or not an integer belongs to the binary cyclops numbers which binary expansion is 0, 101, 11011, 1110111, 111101111, &tc. The n-th such number being this leads to the above solution in R (26 bits). The same length as the […]

The post (x=scan())%in%(2*4^(n=0:x)-2^n-1) appeared first on StatsBlogs.

]]>
Timing the Same Algorithm in R, Python, and C++ /2019/01/06/timing-the-same-algorithm-in-r-python-and-c/ Sun, 06 Jan 2019 19:55:34 +0000 http://www.win-vector.com/blog/?p=6054 While developing the RcppDynProg R package I took a little extra time to port the core algorithm from C++ to both R and Python. This means I can time the exact same algorithm implemented nearly identically in each of these three languages. So I can extract some comparative “apples to apples” timings. Please read on … Continue reading Timing the Same Algorithm in R, Python, and C++

The post Timing the Same Algorithm in R, Python, and C++ appeared first on StatsBlogs.

]]>
Three informal case studies: (1) Monte Carlo EM, (2) a new approach to C++ matrix autodiff with closures, (3) C++ serialization via parameter packs /2018/08/17/three-informal-case-studies-1-monte-carlo-em-2-a-new-approach-to-c-matrix-autodiff-with-closures-3-c-serialization-via-parameter-packs/ Fri, 17 Aug 2018 19:00:02 +0000 http://andrewgelman.com/?p=40018 Andrew suggested I cross-post these from the Stan forums to his blog, so here goes. Maximum marginal likelihood and posterior approximations with Monte Carlo expectation maximization: I unpack the goal of max marginal likelihood and approximate Bayes with MMAP and Laplace approximations. I then go through the basic EM algorithm (with a traditional analytic example […]

The post Three informal case studies: (1) Monte Carlo EM, (2) a new approach to C++ matrix autodiff with closures, (3) C++ serialization via parameter packs appeared first on Statistical Modeling, Causal Inference, and Social Science.

The post Three informal case studies: (1) Monte Carlo EM, (2) a new approach to C++ matrix autodiff with closures, (3) C++ serialization via parameter packs appeared first on StatsBlogs.

]]>
Three informal case studies: (1) Monte Carlo EM, (2) a new approach to C++ matrix autodiff with closures, (3) C++ serialization via parameter packs /2018/08/17/three-informal-case-studies-1-monte-carlo-em-2-a-new-approach-to-c-matrix-autodiff-with-closures-3-c-serialization-via-parameter-packs-2/ Fri, 17 Aug 2018 19:00:02 +0000 https://andrewgelman.com/?p=40018 Andrew suggested I cross-post these from the Stan forums to his blog, so here goes. Maximum marginal likelihood and posterior approximations with Monte Carlo expectation maximization: I unpack the goal of max marginal likelihood and approximate Bayes with MMAP and Laplace approximations. I then go through the basic EM algorithm (with a traditional analytic example […]

The post Three informal case studies: (1) Monte Carlo EM, (2) a new approach to C++ matrix autodiff with closures, (3) C++ serialization via parameter packs appeared first on Statistical Modeling, Causal Inference, and Social Science.

The post Three informal case studies: (1) Monte Carlo EM, (2) a new approach to C++ matrix autodiff with closures, (3) C++ serialization via parameter packs appeared first on StatsBlogs.

]]>