Blog Archives

R Scrabble: Part 2

June 25, 2014
By
R Scrabble: Part 2

Ivan Nazarov and Bartek Chroł gave very interesting comments to my last post on counting number of subwords in NGSL words. In particular they proposed large speedups of my code. So I thought to try checking a larger data set. So today I will work with TWL2006 - the official word authority for tournament Scrabble...

Read more »

RGolf: NGSL Scrabble

June 14, 2014
By
RGolf: NGSL Scrabble

It is last part of RGolf before summer. As R excels in visualization capabilities today the task will be to generate a plot.We will work with NGSL data - a list of 2801 important vocabulary words for students of English as a second ...

Read more »

RGolf: rolling window

May 30, 2014
By

I have learned a lot from my last RGolf post. Therefore today I have another problem from practice.You have a data set on values of contracts signed by ten salesmen. It has three columns: person id (p), contract value (v) and time (t).Here is the code ...

Read more »

RGolf

May 16, 2014
By

Its time for some fun today - because its Friday as David Smith says :).There are many code golf sites, even some support R. However, most of them are algorithm oriented. A true RGolf competition should involve transforming a source data frame to some ...

Read more »

Tuning optim with parscale

January 26, 2014
By

I often get questions what is the use of parscale parameter in optim procedure in GNU R. Therefore I have decided to write a simple example showing its usage and importance. The function I test is a simplified version of estimation problem I had to sol...

Read more »

GNU R vs Julia: is it only a matter of devectorization?

December 28, 2013
By

Recently I have read a post on benefits of code devectorization in Julia. The examples given there inspired me to perform my own devectorization exercise. I decided to use bootstrapping as a test ground. The results are quite interesting (and not so ba...

Read more »

Speeding up model bootstrapping in GNU R

December 2, 2013
By

After my last post I have recurringly received two questions: (a) is it worthwhile to analyze GNU R speed in simulations and (b) how would simulation speed compare between GNU R and Python. In this post I want to address the former question and next ti...

Read more »

Simulatin speed: GNU R vs Julia

November 22, 2013
By
Simulatin speed: GNU R vs Julia

Recently there is a lot of noise about Julia. I have decided to test its speed in simulation tasks on my toy Cont model. I thought I had vectorized my GNU R code pretty well, but Julia is much faster.The model was described in my earlier posts so let u...

Read more »

Calibration of p-value under variable selection: an example

November 14, 2013
By
Calibration of p-value under variable selection: an example

Very often people report p-values for linear regression estimates after performing variable selection step. Here is a simple simulation that shows that such a procedure might lead to wrong calibration of such tests.Consider a simple data generating pro...

Read more »

Cont model – Part II

October 28, 2013
By
Cont model – Part II

In my last post I have investigated properties of Cont model (you can download the paper here). Today I would like to show how we can use simulations to further simplify its analysis.First let us start with the observation that the model does not reall...

Read more »