# Monthly Archives: January 2013

## The components garch model in the rugarch package

January 28, 2013
By

How to fit and use the components model. Previously Related posts are: A practical introduction to garch modeling Variability of garch estimates garch estimation on impossibly long series Variance targeting in garch estimation The model The components model (created by Engle and Lee) generally works better than the more common garch(1,1) model.  Some hints about … Continue reading...

## I thought R was a letter…intro/installation

January 27, 2013
By

I will make a confession. This past summer, I didn’t spend my spare time watching relentlessly addicting TV shows nor clubbing in San Francisco. Instead, I checked out figures. No, not the sort of figures you’re probably thinking about. The ones that are included in research papers and have the potential to be beautiful works of

## European Fishing

January 27, 2013
By

I am playing around with Eurostat data and ggplot2 a bit more. As I progress it seems the plotting gets more easy, the data pre-processing a bit more simple and the surprises on the data stay.Eurostat dataThe data used are fish_fleet (number of ships) and fish_pr (production=catch+aquaculture). After a bit of year selection, 1992 and later, I decided to...

## A slightly different introduction to R, part II

January 27, 2013
By

In part I, we looked at importing data into R and simple ways to manipulate data frames. Once we’ve gotten our data safely into R, the first thing we want to do is probably to make some plots. Below, we’ll make some simple plots of the made-up comb gnome data. If you want to play

## Regression tree using Gini’s index

January 27, 2013
By
$Y$

In order to illustrate the construction of regression tree (using the CART methodology), consider the following simulated dataset, > set.seed(1) > n=200 > X1=runif(n) > X2=runif(n) > P=.8*(X1<.3)*(X2<.5)+ + .2*(X1<.3)*(X2>.5)+ + .8*(X1>.3)*(X1<.85)*(X2<.3)+ + .2*(X1>.3)*(X1<.85)*(X2>.3)+ + .8*(X1>.85)*(X2<.7)+ + .2*(X1>.85)*(X2>.7) > Y=rbinom(n,size=1,P) > B=data.frame(Y,X1,X2) with one dichotomos varible (the variable of interest, ), and two continuous ones (the explanatory ones  and ). > tail(B) Y...

## Tracking Number of Historical Clusters

January 26, 2013
By

In the prior post, Optimal number of clusters, we looked at methods of selecting number of clusters. Today, I want to continue with clustering theme and show historical Number of Clusters time series using these methods. In particular, I will look at the following methods of selecting optimal number of clusters: Minimum number of clusters

## ggplot2 multiple boxplots with metadata

January 26, 2013
By

Recently I was asked for an advice of how to plot values with an additional attached condition separating the boxplots. This turns out to be ugly in base graphics, but amazingly simple in ggplot2.

## Learning R using a Chemical Reaction Engineering Book: Part 3

January 26, 2013
By
$Learning R using a Chemical Reaction Engineering Book: Part 3$

In case you missed previous parts, the links to them are listed below. Part 1 Part 2 In this part, I tried to recreate the examples in section A.2.3 of the computational appendix in the reaction engineering book (by Rawlings and … Continue reading →

## Learning R using a Chemical Reaction Engineering Book: Part 2

January 26, 2013
By
$Learning R using a Chemical Reaction Engineering Book: Part 2$

In case you missed part 1, you can view it here. In this part, I tried to recreate the examples in section A.2.2 of the computational appendix in the reaction engineering book by Rawlings and Ekerdt. Solving a nonlinear system of equations … Continue reading →

## Code Pollution With Command Prompts

January 26, 2013
By

This is not the first time I have ranted about command prompts, but I cannot help ranting about them whenever I saw them in source code. In short, a piece of source code with command prompts is like a bag of cooked shrimps in the market -- it does not make sense, and an otherwise good thing is...