Publications by Bogumił Kamiński

Simulatin speed: GNU R vs Julia

22.11.2013

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 us go down to a comparison:Here is my GNU R code:library(e1071)cont.run function(bur...

2087 sym 2 img

Simulation speed: GNU R vs Julia

23.11.2013

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 us go down to a comparison:Here is my GNU R code:library(e1071)cont.run function(bur...

2087 sym 2 img

Speeding up model bootstrapping in GNU R

02.12.2013

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 time I am going to tackle the latter.An area in which I use simulation in GNU R on a d...

4305 sym

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

28.12.2013

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 bad for GNU R).The task is very simple (and typical):generate 10000 elements sample fr...

3919 sym

Tuning optim with parscale

26.01.2014

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 solve recently. We have two explanatory variables x1 and x2, The issue is that x1 range...

2876 sym

RGolf

16.05.2014

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 target format data frame.So the challenge today will be to write a shortest code i...

3345 sym

RGolf: rolling window

30.05.2014

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 that generates the test data set.n y set.seed(1)d                 v = runif(...

2845 sym

RGolf: NGSL Scrabble

14.06.2014

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 language. I have prepared the list as a NGSL101.txt file for download.Let us move to the task. Lo...

2615 sym 2 img

R Scrabble: Part 2

25.06.2014

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 in the USA.The ques...

6863 sym 6 img

Comparing localsolver with Rglpk on k-medoids example

16.07.2014

Recently I have coauthored a new localsolver package that can be used to solve large scale optimization problems from R. It is a wrapper around commercial solver that is free for academia. If you are interested why it is worthwhile to give it a look – read on.There is a host of packages on optimization CRAN Task View so why bother...

5983 sym