Example 9.19: Demonstrating the central limit theorem

January 11, 2012
By
Example 9.19: Demonstrating the central limit theorem

A colleague recently asked "why should the average get closer to the mean when we increase the sample size?" We should interpret this question as asking why the standard error of the mean gets smaller as n increases. The central limit theorem shows t...

Read more »

Annual Average Retail Gas Prices (adjusted for inflation) – United States

January 11, 2012
By
Annual Average Retail Gas Prices (adjusted for inflation) – United States

Description: Annual retail gas prices since 1950, split by Leaded and Unleaded and adjusted for inflation. Data: http://www.eia.gov/totalenergy/data/annual/index.cfm Analysis: Gas prices have spiked sharply twice since 1949.  Even though ...

Read more »

Time Series Cointegration in R

January 11, 2012
By

Cointegration can be a valuable tool in determining the mean reverting properties of 2 time series. A full description of cointegration can be found on Wikipedia. Essentially, it seeks to find stationary linear combinations of the two vectors. The be...

Read more »

Playing MP3s in Ruby on Windows

January 11, 2012
By

I recently needed to play music in Ruby in order to create an alarm clock of sorts. The code to do this was (surprise surprise) fairly simple, but I want to post it for posterity. require 'win32ole'player = WIN32OLE.new('WMPlayer.OCX')player.OpenPlay...

Read more »

Introduction to Kaggle Algorithmic Trading Challenge

January 11, 2012
By
Introduction to Kaggle Algorithmic Trading Challenge

I recently participated in the Kaggle Algorithmic Trading Competition under the username VikP. For those who do not know what Kaggle is, it is a web site where individuals and corporations can host data analysis competitions. This particular competit...

Read more »

Time Series Cointegration in R

January 11, 2012
By
Time Series Cointegration in R

Cointegration can be a valuable tool in determining the mean reverting properties of 2 time series. A full description of cointegration can be found on Wikipedia. Essentially, it seeks to find stationary linear combinations of the two vectors. The b...

Read more »

Playing MP3s in Ruby on Windows

January 10, 2012
By
Playing MP3s in Ruby on Windows

I recently needed to play music in Ruby in order to create an alarm clock of sorts. The code to do this was (surprise surprise) fairly simple, but I want to post it for posterity.

Read more »

Introduction to Kaggle Algorithmic Trading Challenge

January 10, 2012
By
Introduction to Kaggle Algorithmic Trading Challenge

I recently participated in the Kaggle Algorithmic Trading Competition under the username VikP. For those who do not know what Kaggle is, it is a web site where individuals and corporations can host data analysis competitions. This particular competitio...

Read more »

Create a New Ruby Process in Windows

January 10, 2012
By
Create a New Ruby Process in Windows

I recently had a problem whereby I needed one Ruby program to spawn another Ruby program, but I did not need or want the two programs to interact after the second program was instantiated. I solved this issue by using the system function in Ruby and th...

Read more »

Using R in Ruby

January 10, 2012
By
Using R in Ruby

Integrating R into more traditional programming languages can be incredibly rewarding due to R’s powerful built-in statistical tools, but it can also be extremely frustrating at times. Thankfully, like much else to do with Ruby, integrating R and Rub...

Read more »

Time Series Cointegration in R

January 10, 2012
By
Time Series Cointegration in R

Cointegration can be a valuable tool in determining the mean reverting properties of 2 time series. A full description of cointegration can be found on Wikipedia. Essentially, it seeks to find stationary linear combinations of the two vectors. The bel...

Read more »

Playing MP3s in Ruby on Windows

January 10, 2012
By
Playing MP3s in Ruby on Windows

I recently needed to play music in Ruby in order to create an alarm clock of sorts. The code to do this was (surprise surprise) fairly simple, but I want to post it for posterity. require 'win32ole'player = WIN32OLE.new('WMPlayer.OCX')player.OpenPlayer('C:\alarm.mp3') This will open a new instance of Windows Media Player that plays the selected song. Note that win32ole should be installed by default, and does not need to be installed as…

Read more »

Introduction to Kaggle Algorithmic Trading Challenge

January 10, 2012
By
Introduction to Kaggle Algorithmic Trading Challenge

I recently participated in the Kaggle Algorithmic Trading Competition under the username VikP. For those who do not know what Kaggle is, it is a web site where individuals and corporations can host data analysis competitions. This particular competition involved the prediction of how the prices of 50,000 observations of 102 different securities at the tick level recovered after both buyer and seller initiated liquidity shocks. Each competitor was provided…

Read more »

Create a New Ruby Process in Windows

January 10, 2012
By
Create a New Ruby Process in Windows

I recently had a problem whereby I needed one Ruby program to spawn another Ruby program, but I did not need or want the two programs to interact after the second program was instantiated. I solved this issue by using the system function in Ruby and the Windows start command. system('start ruby.exe C:\script.rb') This will create a new Ruby window, which will run the specified script, and close when it…

Read more »

Using R in Ruby

January 10, 2012
By
Using R in Ruby

Integrating R into more traditional programming languages can be incredibly rewarding due to R's powerful built-in statistical tools, but it can also be extremely frustrating at times. Thankfully, like much else to do with Ruby, integrating R and Ruby is quite a simple process. To begin, install the gem rinruby and require it in your script. gem install rinruby require 'rubygems'require 'rinruby' There is no further installation or configuration required.…

Read more »

Looping through factor variables

January 10, 2012
By
Looping through factor variables

Today, I was chatting to a friend who is working on his Ph.D thesis which coincidently is about my favorite topic: campaign contributions. We discussed about analyzing probabilities of a particular group to grasp more money than the others, partic...

Read more »

Two Quotes to Summarize Opposing Positions on “Is Bayes Posterior just Quick and Dirty Confidence?”

January 9, 2012
By

A central theme of Don Fraser's article, titled "Is Bayes Posterior just Quick and Dirty Confidence?", was that Bayesian confidence regions have approximate, and sometimes poor frequentist coverage (i.e., the frequency with which a confidence region contains the true parameter value under repeated sampling). Fraser has this warning: The failure to make true assertions with [...]

Read more »

Spectral Clustering

January 9, 2012
By

The motivation for the K-Means clustering code in the previous post was to have a look at spectral clustering. Spectral clustering can deal with data sets that K-Means can’t as the following plot shows. Spectral clustering relies on some linear &...

Read more »

Feedback from vignette survey

January 8, 2012
By
Feedback from vignette survey

Many thanks to all who participated in the survey about writing R package vignettes.Following my post last Thursday the responses came in quickly in the evening and all day on Friday. Since Saturday the response rate has been decreasing constantly and ...

Read more »

Number of Results Outside the Margin of Error has a Margin of Error Too.

January 8, 2012
By

I was reading a few tweets recently about the number of polls expect to produce results outside the margin of error (MoE). For example @mysterypollster tweets, "...keep in mind that 1 poll in 20 should produce a result outside MoE, we've had almost tha...

Read more »

Coat of arms of Poland challenge

January 5, 2012
By
Coat of arms of Poland challenge

Last week I have experimented with coloring map of Poland in national colors. Vaidotas Zemlys improved on my effort by adding colors to map of Lithuania and posted a challenge to also add coat of arms to the plot. This proved to be a nice exe...

Read more »

Example 9.18: Constructing the fastest relay team via enumeration

January 5, 2012
By
Example 9.18: Constructing the fastest relay team via enumeration

In competitive swimming, the medley relay is a team event in which four different swimmers each swim one of the four strokes: freestyle, breaststroke, backstroke, and butterfly. In general, every swimmer might be able swim any given stroke. How can w...

Read more »

Frank is a scoundrel, probably

January 5, 2012
By
Frank is a scoundrel, probably

My friend Ted Bunn wrote an article, "Who knows what evil lurks in the hearts of men? The Bayesian doesn’t care," inspired in part by one of my posts, "Repeated tests: how bad can it be?" He presents this scenario: Frank and Betsy are wondering whe...

Read more »


Subscribe

Email:

  Subscribe