Blog Archives

Introduction to RcppNT2

January 31, 2016
By
Introduction to RcppNT2

Modern CPU processors are built with new, extended instruction sets that optimize for certain operations. A class of these allow for vectorized operations, called Single Instruction / Multiple Data (SIMD) instructions. Although modern compilers will use these instructions when possible, they are often unable to reason about whether or not a particular block of code can be executed using SIMD instructions. The Numerical Template Toolbox...

Read more »

Writing fast asynchronous SGD/AdaGrad with RcppParallel

January 23, 2016
By
Writing fast asynchronous SGD/AdaGrad with RcppParallel

Word embeddings After Tomas Mikolov et al. released word2vec tool, there was a boom of articles about words vector representations. One of the greatest is GloVe, which did a big thing by explaining how such algorithms work. It also refolmulates word2vec optimization as a special kind of factoriazation for word cooccurences matrix. This post is devided into two main...

Read more »

Serialize and Deserialize a C++ Object in Rcpp

November 6, 2015
By
Serialize and Deserialize a C++ Object in Rcpp

This post shows how to serialize a c++ object to the raw vector in R and deserialize it with the help of Rcereal and BH. First, please install the Rcpp, Rcereal, and BH from CRAN and enable the support of C++11 via Sys.setenv("PKG_CXXFLAGS"="-std=c++11"). We can use the cereal library and boost iostreams in Rcpp. The following example shows a toy C++...

Read more »

Stochastic SIR Epidemiological Compartment Model

April 24, 2015
By
Stochastic SIR Epidemiological Compartment Model

Introduction This post is a simple introduction to Rcpp for disease ecologists, epidemiologists, or dynamical systems modelers - the sorts of folks who will benefit from a simple but fully-working example. My intent is to provide a complete, self-contained introduction to modeling with Rcpp. My hope is that this model can be easily modified to run any dynamical simulation that has dependence on the...

Read more »

Call matplotlib from R

April 1, 2015
By
Call matplotlib from R

Motivation I often use Python and matplotlib for exploring measurement data (from e.g. accelerometers), even if I use R for the actual analysis. The reason is that I like to be able to flexibly zoom into different parts of the plot using the mouse and this works well for me with matplotlib. So I decided to try to call matplotlib from R using...

Read more »

Parsing Dates and Times

March 21, 2015
By
Parsing Dates and Times

Motivation R has excellent for dates and times via the built-in Date and POSIXt classes. Their usage, however, is not always as straightforward as one would want. Certain conversions are more cumbersome than we would like: while as.Date("2015-03-22"), would it not be nice if as.Date("20150322") (a format often used in logfiles) also worked, or for that matter as.Date(20150322L) using an integer variable, or...

Read more »

Create an R-tree data structure using Rcpp and Boost::Geometry

December 26, 2014
By
Create an R-tree data structure using Rcpp and Boost::Geometry

Introduction The purpose of this post is to show how to use Boost::Geometry library which was introduced recently in Rcpp. Especially, we focus on R-tree data structure for searching objects in space because only one spatial index is implemented - R-tree Currently in this library. Boost.Geometry which is part of the Boost C++ Libraries gives us algorithms for solving geometry problems. In this library, the...

Read more »

Sampling Importance Resampling (SIR) and social revolution.

October 22, 2014
By
Sampling Importance Resampling (SIR) and social revolution.

Motivation The purpose of this gallery post is several fold: to demonstrate the use of the new and improved C++-level implementation of R’s sample() function (see here) to demonstrate the Gallery’s new support for images in contributed posts to demonstrate the usefulness of SIR for updating posterior beliefs given a sample from an arbitrary prior distribution Application: Foreign Threats and Social Revolution The...

Read more »

Implementing an EM Algorithm for Probit Regressions

September 30, 2014
By
Implementing an EM Algorithm for Probit Regressions

Users new to the Rcpp family of functionality are often impressed with the performance gains that can be realized, but struggle to see how to approach their own computational problems. Many of the most impressive performance gains are demonstrated with seemingly advanced statistical methods, advanced C++–related constructs, or both. Even when users are able to understand how various demonstrated features operate in isolation, examples...

Read more »

Using RcppArmadillo with bigmemory

July 24, 2014
By
Using RcppArmadillo with bigmemory

The bigmemory package allows users to create matrices that are external to R, stored either in RAM or on disk, allowing them to be bigger than the system RAM, and allowing them to be shared across R sessions. While these objects are defined by the big.matrix class in R, they are really just wrappers that point to external memory. The actual objects are implemented...

Read more »

Sponsors

Mango solutions



plotly webpage

dominolab webpage



Zero Inflated Models and Generalized Linear Mixed Models with R

Quantide: statistical consulting and training

datasociety

http://www.eoda.de





ODSC

ODSC

CRC R books series





Six Sigma Online Training









Contact us if you wish to help support R-bloggers, and place your banner here.

Never miss an update!
Subscribe to R-bloggers to receive
e-mails with the latest R posts.
(You will not see this message again.)

Click here to close (This popup will not appear again)