Utility Spread and Financial Turbulence

May 23, 2011
By
Utility Spread and Financial Turbulence

THIS IS NOT INVESTMENT ADVICE.  YOU ARE RESPONSIBLE FOR YOUR OWN GAINS AND LOSSES. In Long XLU Short SPY Part 2 (More History), I explored the defensive nature of the spread and its potential as a bond substitute in troublesome periods for stocks...

Read more »

May 2011 Guerrilla Classes: Light Bulb Moments

May 23, 2011
By

It's impossible to know what will constitute a light bulb moment for someone else. In the recent Guerrilla classes (GBoot and GCaP), we seemed to be having many more than our usual quota of such moments. So much so, that I decided to keep a list. The first was mine. Asa H. was having trouble...

Read more »

May 2011 Guerrilla Classes: Light Bulb Moments

May 23, 2011
By

It's impossible to know what will constitute a light bulb moment for someone else. In the recent Guerrilla classes (GBoot and GCaP), we seemed to be having many more than our usual quota of such moments. So much so, that I decided to keep a list. The first was mine. Asa H. was having trouble...

Read more »

New York, September 8/9, 2011 – Portfolio Selection and Optimization in Practice

May 23, 2011
By

(This article was first published on Rmetrics blogs, and kindly contributed to R-bloggers) To leave a comment for the author, please follow the link and comment on his blog: Rmetrics blogs. R-bloggers.com offers daily e-mail updates about R news and tutorials on topics such as: visualization (ggplot2, Boxplots, maps, animation), programming (RStudio, Sweave, LaTeX, SQL, Eclipse, git, hadoop, Web...

Read more »

Summarize Data by Several Variables

May 23, 2011
By
Summarize Data by Several Variables

Here's an example how to conveniently summarize data with the cast function (package reshape). By the way you see how this could be done "in-conveniently" by hand. You also see how a for-loop works and how a matrix is constructed and fill...

Read more »

Preparing RTextTools Beta Release for Catania 2011

Right now our development team is busy preparing a conference release of RTextTools for The 4th Annual Conference of the Comparative Policy Agendas Project at the University of Catania in Sicily. One of the key issues we've had thus far is memory consumption with very large datasets.In the past week we've pushed out a slew of

Read more »

Specific differences between Ledoit-Wolf and factor models

May 22, 2011
By
Specific differences between Ledoit-Wolf and factor models

What can we learn about the difference in structure between a Ledoit-Wolf variance matrix and a corresponding factor model variance? Previously We’ve generated a set of random portfolios with constraints on the risk fractions of a Ledoit-Wolf variance matrix, and a corresponding set of random portfolios with risk fraction constraints from a statistical factor model. … Continue reading...

Read more »

Legends in ggplot2

May 22, 2011
By
Legends in ggplot2

A simple plot takes a few lines of coding:g1 <- ggplot(d, aes(birth.year))g2 <- g1 + geom_line(aes(y=alive0, linetype="Famale")) +  geom_line(aes(y=alive1, linetype="Male")) + scale_linetype_discrete(name = "")g3 <- g2 + geom_point(aes(y=...

Read more »

Legends in ggplot2

May 22, 2011
By
Legends in ggplot2

A simple plot takes a few lines of coding:g1 <- ggplot(d, aes(birth.year))g2 <- g1 + geom_line(aes(y=alive0, linetype="Famale")) +  geom_line(aes(y=alive1, linetype="Male")) + scale_linetype_discrete(name = "")g3 <- g2 + geom_point(aes(y=...

Read more »

Music file graphs with R

May 22, 2011
By
Music file graphs with R

Today we will use R to extract some interesting summary statistics regarding the music files stored in the computer. For all mp3 files I keep certain metadata in their ID3 tag. We will use this information to explore the distribution of music files with respect to the year of release. All the following are done

Read more »

Comparing Student outcomes with Research Output (using R and ggplot2′s text labels)

May 22, 2011
By
Comparing Student outcomes with Research Output (using R and ggplot2′s text labels)

In this post, I take a look at some league table data recently published by the Guardian. I also provide …Continue reading »

Read more »

Terry’s spiel

May 22, 2011
By
Terry’s spiel

“We don’t need likelihood functions; we just need to know how to simulate from (…) We don’t need models with sufficient statistics; we just need summary statistics (…) We don’t need to be Bayesian; we just need to be approximately so. We don’t need theory to tell us our method works; we just need

Read more »

Slowing down matrix multiplication in R

May 21, 2011
By
Slowing down matrix multiplication in R

After I realized that some aspects of R’s implementation are rather inefficient, one of the first things I looked at was matrix multiplication.  There I found a huge performance penalty for many matrix multiplies, a penalty which remains in the current version, 2.13.0.  As discussed below, eliminating this penalty speeds up long vector dot products

Read more »

The distribution of interestingness

The distribution of interestingness

On April 22, David Landy posed a question about the distribution of interestingness values in response to my April 3rd post on “Interestingness Measures.”  He noted that the survey paper by Hilderman and Hamilton that I cited there makes the following comment:“Our belief is that a useful measure of interestingness should generate index values that are reasonably distributed throughout...

Read more »

The distribution of interestingness

The distribution of interestingness

On April 22, David Landy posed a question about the distribution of interestingness values in response to my April 3rd post on “Interestingness Measures.”  He noted that the survey paper by Hilderman and Hamilton that I cited there makes the following comment:“Our belief is that a useful measure of interestingness should generate index values that are reasonably distributed throughout...

Read more »

[Project Euler] – Problem 58

May 21, 2011
By
[Project Euler] – Problem 58

Starting with 1 and spiralling anticlockwise in the following way, a square spiral with side length 7 is formed.37 36 35 34 33 32 3138 17 16 15 14 13 30Read More: 597 Words Totally

Read more »

Defaults, Lists and Classes: A Functional Post

May 20, 2011
By
Defaults, Lists and Classes: A Functional Post

In this post, I demonstrate a couple of useful tricks to writing functions in R. The context is a function I wrote called called samp() that allows for an easy demonstration of sampling distribution properties.DefaultsBy default, this function draws K...

Read more »

Defaults, Lists and Classes: A Functional Post

May 20, 2011
By
Defaults, Lists and Classes: A Functional Post

In this post, I demonstrate a couple of useful tricks to writing functions in R. The context is a function I wrote called called samp() that allows for an easy demonstration of sampling distribution properties.DefaultsBy default, this function draws K...

Read more »

My programming journey

May 20, 2011
By
My programming journey

When clearing out some of my old programming books the other day I realised how far I’d come with programming over the years, and the number of different technologies that I have used over time. I thought I’d do a little summary post going from first programming experience to now – and it’s amazing what’s

Read more »

Long XLU Short SPY Part 2 (More History)

May 20, 2011
By
Long XLU Short SPY Part 2 (More History)

THIS IS NOT INVESTMENT ADVICE.  YOU ARE RESPONSIBLE FOR YOUR OWN GAINS AND LOSSES. The Fed is on a roll adding BAC ML Bond Indicies and now complete history for the four primary Dow Jones Indexes, so I wanted to extend my first post Long XLU Shor...

Read more »

Hacking the Kinect with R

May 20, 2011
By

I was browsing through the draft abstract booklet for this year's worldwide R user conference useR! 2011, and noticed this abstract: KinectR – Kinect interface to R Landon Jensen Microsoft launched the Kinect for Xbox 360 in late 2010 and it quickly broke records as the fastest selling consumer electronics device in history (8 million units sold in the...

Read more »

Long XLU Short SPY

May 20, 2011
By
Long XLU Short SPY

THIS IS NOT INVESTMENT ADVICE.  YOU ARE RESPONSIBLE FOR YOUR OWN GAINS AND LOSSES. I spend my days and nights wondering what a bond manager should do if he/she doesn’t like bonds, but also cannot sit in 0% cash.  I generally dislike spreads...

Read more »

Spreads and Stress

May 20, 2011
By
Spreads and Stress

Since we have the Gifts from BAC ML and the Federal Reserve, I thought I should look at another interesting element of bonds.  Bond spreads act as a very strong symbol of financial stability and confidence.  The St. Louis Fed Stress Index is ...

Read more »

Smaller or greater? – episode II

May 20, 2011
By
Smaller or greater? – episode II

In a previous post I introduced the following game: Suppose you play the following game: Someone holds a set of cards with the numbers {1,2,…,N} in random order, opens up the first card and asks if the next card is greater or smaller. Every time you predict correctly, you get one point, while every wrong

Read more »

Great circles, raster, sp and lattice

Great circles, raster, sp and lattice

Recently I found a post at FlowingData with a detailed tutorial to map connections with great circles with R. The tutorial of FlowingData is excellent, but I feel more comfortable with the sp classes and methods, and with the lattice and latticeExtra packages. Besides, I want to use the free spatial data available from the

Read more »

10 reasons why you should learn R

May 20, 2011
By

10. Can't crack that hard Sudoku problem?? Use R!9. Want to pick a skill that will give you an early adopter advantage?? Learn R! It is the leading open source statistical and data analysis programming language, and is heating up! 8. Need to ...

Read more »

10 reasons why you should learn R

May 20, 2011
By

10. Can't crack that hard Sudoku problem?? Use R!9. Want to pick a skill that will give you an early adopter advantage?? Learn R! It is the leading open source statistical and data analysis programming language, and is heating up! 8. Need to ...

Read more »

Syntax highlighting of R code at WordPress.com

May 20, 2011
By
Syntax highlighting of R code at WordPress.com

If your WordPress blog is hosted at WordPress.com (like this one), you may know that source code in posts is formatted and highlighted using a shortcode, as explained here. Until recently, R was not on the list of supported languages (neither was Perl), but I noticed today that both of them are now supported. This

Read more »

Porting Stata-like Marginal Effects to LaTeX

May 19, 2011
By
Porting Stata-like Marginal Effects to LaTeX

The TimeSeriesIreland Blog posted an excellent start on a function that automatically computes marginal effects for probit and logit models. As I have always wanted an easy-to-use function that computes and reports marginal effects in R, I was elated ...

Read more »