Publications by Rcpp Gallery
Gerber Statistic Implementation in Rcpp and OpenMP
Summary Recently new research has appeared on using a co-movement measure to construct the covariance matrix as part of the Modern Portfolio Theory (MPT) style portfolio construction. Below is the abstract of the Gerber, Markowith and Pujara (2015) paper whose methodology is also currently patent pending: Markowitz’s mean-variance MPT has rema...
2200 sym R (7520 sym/3 pcs) 2 img 1 tbl
Hierarchical Risk Parity Implementation in Rcpp and OpenMP
Summary Recent research by Marcos Lopez de Prado aims to improve Markowitz’s Critical Line Algorithm (CLA). The (currently patent-pending) methodology proposes the Hierarchical Risk Parity (HRP) approach which aims to tackle several issues with the original CLA: instability, concentration, and underperformance. HRP applies modern mathematics (...
6483 sym R (7858 sym/4 pcs) 2 img 1 tbl
Hierarchical Risk Parity Implementation in Rcpp and OpenMP
Summary Recently, there has been a new research paper coming out with the goal of improving Markowitz’s Critical Line Algorithm (CLA) published by Marcos Lopez de Prado. The methodology is also currently patent pending and the paper can be downloaded here. The methodology suggested by the paper proposes the Hierarchical Risk Parity (HRP) approa...
6680 sym R (8409 sym/5 pcs) 2 img 1 tbl
Optimizing Code vs Recognizing Patterns with 3D Arrays
Intro As is the case with the majority of posts normally born into existence, there was an interesting problem that arose on recently on StackOverflow. Steffen, a scientist at an unnamed weather service, faced an issue with the amount of computational time required by his triple loop in R. Specifically, Steffen needed to be able to sum over diffe...
11301 sym R (11996 sym/33 pcs) 2 img
Working with Rcpp::StringVector
Vectors are fundamental containers in R. This makes them equally important in Rcpp. Vectors can be useful for storing multiple elements of a common class (e.g., integer, numeric, character). In Rcpp, vectors come in the form of NumericVector, CharacterVector, LogicalVector, StringVector and more. Look in the header file Rcpp/include/Rcpp/vector/i...
10672 sym R (4962 sym/47 pcs) 2 img
Rcpp::algorithm
Introduction A while back I saw a post on StackOverflow where the user was trying to use Rcpp::sugar::sum() on an RcppParallel::RVector. Obviously this doesn’t work and it raised the question “Why doesn’t something more generic exist to provide functions with R semantics that can be used on arbitrary data structures?” As a result, I set ...
2108 sym R (1743 sym/4 pcs) 2 img
Custom Templated as and wrap Functions within Rcpp.
Introduction Consider a need to be able to interface with a data type that is not presently supported by Rcpp. The data type might come from a new library or from within ones own program. In such cases, Rcpp is faced with an issue of consciousness as the new data type is not similar to known types so the autocoversion or seamless R to C++ integra...
4964 sym Python (6832 sym/12 pcs) 2 img
RcppHoney Introduction
Rationale In C++ we often have containers that are not compatible with R or Rcpp with data already in them (std::vector, std::set, etc.). One would like to be able to operate on these containers without having to copy them into Rcpp structures like IntegerVector. RcppHoney aims to address this problem by providing operators and functions with R...
2765 sym R (3023 sym/1 pcs) 2 img
Using Armadillo with SuperLU
Armadillo is very versatile C++ library for linear algebra, brough to R via the RcppArmadillo package. It has proven to be very useful and popular, and is (as of February 2017) used by well over 300 CRAN packages as indicated by the reverse depends / linking-to on its CRAN page. Several earlier posts here on the Rcpp Gallery also demonstrate di...
2626 sym R (761 sym/4 pcs) 2 img
Using Rcpp with C++11, C++14 and C++17
Background When we started the Rcpp Gallery in late 2012, a few of us spent the next four weeks diligently writing articles ensuring that at least one new article would be posted per day. Two early articles covered the then-budding support for C++11. Both First steps in using C++11 with Rcpp and A first lambda function with C++11 and Rcpp starte...
7300 sym R (710 sym/7 pcs) 2 img