Monthly Archives: January 2012

hmm: implementation of viterbi algorithm (Durbin, 1998) Part 2

January 29, 2012
By
hmm: implementation of viterbi algorithm (Durbin, 1998) Part 2

Previous post presented the problem of dishonest casino that ocassionally uses loaded die. Sequence of the real states is hidden, and we are trying to figure it out just by looking at the observations (symbols). If we apply our implementation … Continue reading →

Read more »

Visual Summary of #jan25 Twitter Activity

January 29, 2012
By
Visual Summary of #jan25 Twitter Activity

  Last year, I covered a number of the so-called “Twitter protests” in China (#cn220), Iran (#25bahman), and Algeria (#fev12).  Since these protests began in January 2011, the Arab Spring has claimed many members of both ruling and revolting groups … Continue reading →

Read more »

Multiple Factor Model – Fundamental Data

January 28, 2012
By
Multiple Factor Model – Fundamental Data

The Multiple Factor Model can be used to decompose returns and calculate risk. Following are some examples of the Multiple Factor Models: The expected returns factor model: Commonality In The Determinants Of Expected Stock Returns by R. Haugen, N. Baker (1996) The expected returns factor model: CSFB Quantitative Research, Alpha Factor Framework on page 11,

Read more »

Categorizing my expenses

January 28, 2012
By
Categorizing my expenses

In order to analyse my expenses, a classification scheme is necessary. I need to identify categories that are meaningful to me. I decided to go with the “Classification of Individual Consumption by Purpose” (COICOP), for three reasons:It is made by people who have thought more about consumption classification than I ever will. It is feasible to assign bank transactions...

Read more »

Say it in R with "by", "apply" and friends

January 28, 2012
By
Say it in R with "by", "apply" and friends

Iris versicolor (Source: Wikipedia)R is a language, as Luis Apiolaza pointed out in his recent post. This is absolutely true, and learning a programming language is not much different from learning a foreign language. It takes time and a lot of pr...

Read more »

Le Monde puzzle [#755?]

January 27, 2012
By
Le Monde puzzle [#755?]

Le Monde puzzle of last weekend was about sudoku-like matrices. Consider an (n,n) matrix containing the integers from 1 to n². The matrix is “friendly” if the set of the sums of the rows is equal to the set of the sum of the columns. Find examples for n=4,5,6. Why is there no friendly matrix

Read more »

hmm: implementation of viterbi algorithm (Durbin, 1998) Part 1

January 27, 2012
By
hmm: implementation of viterbi algorithm (Durbin, 1998) Part 1

Example in the mentioned book goes as following – dishonest casino uses two types of dice. Fair one that has equal probability of landing on either side (1/6), and the loaded one with 50% chance for getting 6. Your task … Continue reading →

Read more »

heatmaps: controlling the color representation with set data range

January 27, 2012
By
heatmaps: controlling the color representation with set data range

Often you want to set the fixed colors for particular range of your dataset to be sure that the visual output is correctly represented. This is particularly useful for time series data, where the range or your dataset might drastically … Continue reading →

Read more »

Distressing Numbers for Women

January 27, 2012
By
Distressing Numbers for Women

Sometimes I play with non-linguistic data sets recreationally. It's a totally valid hobby! I tend to gravitate towards data on the disparities between men and women, because gender equality is something that matters to me.I've had this one data set for...

Read more »

Replicating NetLogo Fire model

January 27, 2012
By
Replicating NetLogo Fire model

While preparing for the new semester I have started reimplementing standard NetLogo examples in R. The first is Fire model.The simulation in R is presented here:# Forest matrix trees encoding:# 3 – green, 2 – burning, 1 – burnt, 0 – no treesimu...

Read more »