Publications by Bogumił Kamiński

Possible error in Bayesian bootstrap

08.11.2012

After my last post on Bayesian bootstrap I got a question why the sample from Dirichlet distribution is taken as weights for calculating mean in the procedure and not as weights used for sampling from the original data set. Actually this mistake is subtle and occurs even in textbooks, see example Chernick (2008), page 122. In this po...

2175 sym 2 img

ESSA2013 Conference

24.11.2012

It has been just announced that during ESSA2013 conference I am planning to organize a special track on “Statistical analysis of simulation models”. I hope to get some presentations using GNU R to promote it in social simulation community.It is obvious that GNU R excels in analysis of simulation data. However, very often it can be...

2990 sym 2 img

Bridge hand distribution: simulation vs exact calculation

08.12.2012

Recently I played bridge with my friends. Being frustrated with several consecutive poor hand distributions we asked ourselves a question what is the probability of having a hand good enough for a small slam. A well known rule of thumb is that you need 33+ HCP for 6NT. But we could not find information about the probability of such an...

2534 sym 2 img

Predictive models in R: a new book in Polish

14.12.2012

Together with Mateusz Zawisza I have just published a new book in Polish on building predictive models in GNU R. It can be bought at Oficyna Wydawnicza SGH. The book presents complete examples of basic data mining processes.Although the book is in Polish, sources of all procedures used in it, which are available on my website, can be...

2061 sym 2 img

Wrapper functions in GNU R

26.12.2012

Recently I have been working with GNU R optimization routines a lot. Function optim has a nice trace option that allows to monitor optimization progress. Another standard function optimize has no such feature but it is possible to add outside tracking to it.Let us start with an example from documentation:f function (x, a) { (x ...

2669 sym

Solving 9-puzzle with GNU R

04.01.2013

During holiday break I have decided to solve 9-puzzle, which is 3×3 variant of a well known 15-puzzle. The solution has proven to be a nice application of igraph package. Warning: this time the code takes a bit more tame than usual in my posts to execute.9-puzzle is a problem where numbers from 1 to 8 are placed on a board that ha...

4472 sym 2 img

Times per second benchmark

05.03.2013

In GNU R the simplest way to measure execution time of a piece code is to use system.time. However, sometimes I want to find out how many times some function can be executed in one second. This is especially useful when we want to compare functions that have significantly different execution speed.Fortunately times per second benchma...

2237 sym

Hexadecimal literals in GNU R

11.03.2013

Recently I have used hexadecimal numbers in GNU R. The way they are parsed surprised me and is inconsistent with Java. As R Language Definition pdf only briefly mentions hexadecimal numbers here is what I have found.First I have checked the following code:0x11# 170x1.1# 17I seemed that GNU R drops the decimal point. So I have checked ...

1311 sym

GNU R loop speed comparison

16.03.2013

Recently I had several discussions about using for loops in GNU R and how they compare to *apply family in terms of speed. I have not seen a direct benchmark comparing them so I decided to execute one (warning: some of the code presented today takes long time to execute).First I have started by comparing the speed of assignment opera...

1895 sym R (1172 sym/2 pcs) 4 img

Estimating continuous piecewise linear regression

02.04.2013

When talking about smoothing splines a simple point to start with is a continuous piecewise linear regression with fixed knots. I did not find any simple example showing how to estimate the it in GNU R so I have created a little snippet that does the job.Assume you are given continuous predictor x and continuous predicted variable y....

1924 sym R (828 sym/1 pcs) 2 img