4159 search results for "git"

The Inverse Herfindahl–Hirschman Index as an “Effective Number of” Parties

December 17, 2012
By
The Inverse Herfindahl–Hirschman Index as an “Effective Number of” Parties

I learned of the passing of Albert Hirschman on December 11, and while better and more instructive tributes to his life can be read elsewhere, I wanted to focus on a little piece of Hirschman’s work that I use all the time: the (inverse) Herfindahl–Hirschman Index. The HHI is basically a measure of market concentration, but...

Read more »

A look at historical Value at Risk

December 17, 2012
By
A look at historical Value at Risk

Historical Value at Risk (VaR) is very popular because it is easy and intuitive: use the empirical distribution of some specific number of past returns for the portfolio. Previously “The estimation of Value at Risk and Expected Shortfall” included an R function to estimate historical VaR. Generating portfolios A useful tool to explore risk models … Continue reading...

Read more »

The Eye of the World as word cloud

December 16, 2012
By
The Eye of the World as word cloud

The Eye of the World is the first book of Robert Jordan's Wheel of Time books. As the last of these books will be published soon, I was wondering if natural language processing can be used to examine books like these. For this purpose I downloaded a co...

Read more »

Possibly slightly better text analysis with lme4

December 16, 2012
By
Possibly slightly better text analysis with lme4

lme4 and its cousin arm are extremely useful for a huge variety of modeling applications (see Gelman and Hill’s book), but today we’re going to do something a little frivolous with them. Namely, we’re going to extend our Denver Debat...

Read more »

Building R packages: missing path to pdflatex

December 15, 2012
By
Building R packages: missing path to pdflatex

Recently whiling trying to build an R package for generalized estimating equation model selection (QICpack on github), I was getting an error related to latex creating the PDF package manuals. It seems like this is a relatively common problem on … Continue reading →

Read more »

Text analysis made too easy with the tm package

December 15, 2012
By
Text analysis made too easy with the tm package

Today’s Gist takes the CNN transcript of the Denver Presidential Debate, converts paragraphs into a document-term matrix, and does the absolute most basic form of text analysis: a raw word count. There are actually quite a few steps in this proc...

Read more »

Le Monde puzzle (#800)

December 14, 2012
By
Le Monde puzzle (#800)

Here is the mathematical puzzle of the weekend edition of Le Monde: Consider a sequence where the initial number is between 1 and 10³, and each term in the sequence is derived from the previous term as follows: if the last digit of the previous term is between 6 and 9, multiply it by 9;

Read more »

d3, Shiny, and R Reporting Performance

December 14, 2012
By
d3, Shiny, and R Reporting Performance

I thought it would be interesting to offer a little different example of how we can use d3, R, and Rstudio Shiny.  This time we will offer a simple example to report portfolio or index performance.  Just as a test of my progress, I also threw...

Read more »

Let it snow!

December 14, 2012
By

A couple days ago I noticed a fun piece of R code by Allan Roberts, which lets you create a digital snowflake by cutting out virtual triangles. Go give it a try. Roberts inspired me to create a whole night sky of snowflakes. I tried to make the snowfall look as organic as possible. There

Read more »

Everything is a Network, featuring the sna package

December 14, 2012
By
Everything is a Network, featuring the sna package

We’ve gotten some requests, through the Ask us anything page, to do some plotting of networks. We may come back to this later, but today’s Gist shows how you can plot pretty much literally anything as a network. First, we go back to our

Read more »