Articles by Bogumił Kamiński

Visualizing optimization process

September 8, 2013 | Bogumił Kamiński

One of the approaches to graph drawing is application of so called force-directed algorithms. In its simplest form the idea is to layout the nodes on plane so that all edges in the graph have approximately equal length. This problem has very intuitive ... [Read more...]

Genetic drift simulation

August 13, 2013 | Bogumił Kamiński

While preparing for the new teaching semester I have created an implementation of NetLogo GenDrift P local in GNU R.The model works as follows. Initially a square grid having side size is randomly populated with n types of agen... [Read more...]

Testing function agruments in GNU R

June 28, 2013 | Bogumił Kamiński

Recently I have read a nice post on ensuring that proper arguments are passed to a function using GNU R class system. However, I often need a more lightweight solution to repetitive function argument testing.The alternative idea is to test function arg... [Read more...]

Testing function arguments in GNU R

June 28, 2013 | Bogumił Kamiński

Recently I have read a nice post on ensuring that proper arguments are passed to a function using GNU R class system. However, I often need a more lightweight solution to repetitive function argument testing.The alternative idea is to test function arguments against a specified pattern given in a ... [Read more...]

Regression regularization example

May 31, 2013 | Bogumił Kamiński

Recently I needed a simple example showing when application of regularization in regression is worthwhile. Here is the code I came up with (along with basic application of parallelization of code execution). Assume you have 60 observations and 50 expla... [Read more...]

Model fitting exam problem

May 20, 2013 | Bogumił Kamiński

Recently I have run an exam where the following question had risen many problems for students (here I give its shortened formulation). You are given the data generating process y = 10x + e, where e is error term. Fit linear regression using lm, ne... [Read more...]

Missing tikzDevice

April 30, 2013 | Bogumił Kamiński

I love using tikzDevice. When preparing LaTeX documents I switched to prepare all graphs in GNU R and then port them to TeX using tikzDevice. Recently I have moved to GNU R 3.0.0 and was shocked to find that this package is no longer available on CRAN.... [Read more...]

GNU R loop speed comparison

March 16, 2013 | Bogumił Kamiński

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 tak... [Read more...]

Hexadecimal literals in GNU R

March 11, 2013 | Bogumił Kamiński

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 c... [Read more...]

Times per second benchmark

March 5, 2013 | Bogumił Kamiński

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 function... [Read more...]

Solving 9-puzzle with GNU R

January 4, 2013 | Bogumił Kamiński

During holiday break I have decided to solve 9-puzzle, which is 3x3 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... [Read more...]

Wrapper functions in GNU R

December 26, 2012 | Bogumił Kamiński

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 pos... [Read more...]

ESSA2013 Conference

November 24, 2012 | Bogumił Kamiński

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 ... [Read more...]

Possible error in Bayesian bootstrap

November 8, 2012 | Bogumił Kamiński

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 i... [Read more...]

Simple Bayesian bootstrap

November 2, 2012 | Bogumił Kamiński

Bootstrapping is a very popular statistical technique. However, its Bayesian analogue proposed by Rubin (1981) is not very common. I was looking for an example of its implementation in GNU R and could not find one so I decided to write a snippet presen... [Read more...]

Plotting Watts-Strogatz model

September 21, 2012 | Bogumił Kamiński

Recently I wanted to reproduce Figure 2 from Watts and Strogatz (1998). The task using igraph is simple but an interesting task was annotation of the resulting plot.Watts-Strogatz model generates graphs that have so called small-world ne... [Read more...]
1 2 3 4

Never miss an update!
Subscribe to R-bloggers to receive
e-mails with the latest R posts.
(You will not see this message again.)

Click here to close (This popup will not appear again)