# Blog Archives

## Color Quantization in R

January 3, 2016
By

In this post, we'll look at a simple method to identify segments of an image based on RGB color values. The segmentation technique we'll consider is called color quantization. Not surprisingly, this topic lends itself naturally to visualization and R makes it easy to render some really cool graphics for the color quantization problem. ...

## Sparse Quadratic Programming with Ipoptr

March 8, 2015
By

This post is a follow up to my last post on quadratic programming facilities in R. A commenter pointed me to the ipoptr project which exposes an R interface to the COIN-OR optimization routine Ipopt. COIN-OR is a suite of optimization utilities implemented in C++ and supported by a back-end of configurable FORTRAN linear...

## More on Quadratic Progarmming in R

February 10, 2015
By

This post is another tour of quadratic programming algorithms and applications in R. First, we look at the quadratic program that lies at the heart of support vector machine (SVM) classification. Then we'll look at a very different quadratic programming demo problem that models the energy of a circus tent. The key...

## Analyzing the 2011-2012 California Health Inteview Survey with R

June 1, 2014
By

The California Health Interview Survey (CHIS) is a remarkable biannual survey of health status, care access, and demographics for California residents. The 2011-2012 public use survey data has recently been released and is freely available after registering at the CHIS site. CHIS currently offers data in SAS, Stata, and SPSS formats. However, thanks to a...

## The Circus Tent Problem with R’s Quadprog

April 20, 2014
By

The MathWorks has an interesting demo on how the shape of a circus tent can be modeled as the solution of a quadratic program in MATLAB. In this post, we'll show how to solve this same problem in R using the quadprog package and also provide the technical details not covered in the Mathwork's example. In...

## Going viral with R’s igraph package

March 23, 2014
By

R's igraph package provides a simple and flexible set of utilities for working with graphs.  In this post, we'll use this package to animate the simulated spread of a disease through a network. Graphs A graph is just a collection of nodes joined by edges: require(igraph)# Specify an undirected graph by hand, using...

January 13, 2014
By

In this post, we'll explore a special type of nonlinear constrained optimization problems called quadratic programs. Quadratic programs appear in many practical applications, including portfolio optimization and in solving support vector machine (SVM) classification problems. There are several packages available to solve quadratic programs in R. Here, we'll work with the quadprog package. Before we dive...

## Generating Ticker Symbols with Markov Chains

November 25, 2013
By

Stock ticker symbols are short character string codes (AAPL for Apple, WMT for Walmart) that uniquely identify stock listings. They originate from the days when stock quotes were transmitted via telegraph. These symbols are often used as tools for branding and companies choose them to be memorable and easily recognized. As a fun and simple...