Blog Archives

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 »

Cont model back after a year

October 16, 2013
By
Cont model back after a year

During ESSA2013 conference I had a discussion about Cont model I have commented a year ago.In original paper Cont highlights that his model produces distribution of returns characterized by positive excess kurtosis. In this post I want to investig...

Read more »

Visualizing optimization process

September 8, 2013
By
Visualizing optimization process

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
By
Genetic drift simulation

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
By

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 »

Regression regularization example

May 31, 2013
By
Regression regularization example

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
By

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
By

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 »

Estimating continuous piecewise linear regression

April 2, 2013
By
Estimating continuous piecewise linear regression

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 j...

Read more »

GNU R loop speed comparison

March 16, 2013
By
GNU R loop speed comparison

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 »