My treebase package is now up on the CRAN repository. (Source code is up, the binaries should appear soon). Here’s a few introductory examples to illustrate some of the functionality of the package. Thanks in part to new data deposition … Continue reading → [Read more...]
Everyday, a poor soul tries to understand copulas by reading the corresponding Wikipedia page, and gives up in despair. The incomprehensible mess that one finds there gives the impression that copulas are about as accessible as tensor theory, which is a shame, because they are actually a very nice tool. ... [Read more...]
A recent question on one of the LinkedIn groups about the advantages of using R over commercial tools like SAS or IBM SPSS Modeller drew lots of comments for R. We like R a lot and we use it extensively, but I also wanted to balance the discussion. R is ...
Couple of R programming (mainly infrastructure/workflow) related topics discussed at the Los Angeles R users group in a tutorial/demo-like form (targeted mainly to beginners) by Szilard Pafka and Jeroen Ooms: how easy it is to create a simple package for … Continue reading →
A common approach to reducing risk associated with financial portfolios is diversification. A portfolio made of components that are all highly correlated with each other -- a portfolio composed solely of financial stocks, for example -- is risky, because if there's a wide-spread crisis that affects the banking sector, all ... [Read more...]
In my previous post, I employed a rather crude and non-parametric approach to see if I could predict the direction of stock returns using the function runs.test(). Lets go a step further and try modelling this with a parametric econometric approach. The company that I choose for the study ... [Read more...]
Someone asked me how to move a directory full of files from one place to another using R. The easiest way I've found is as follows (where "oldpath" is the existing directory and "newpath" is the new directory):file.copy(list.files(oldpath),newpath)
In general, the standard practice for correcting for population stratification in genetic studies is to use principal components analysis (PCA) to categorize samples along different ethnic axes. Price et al. published on this in 20...
The “Minimum Correlation Algorithm” is a term I stumbled at the CSS Analytics blog. This is an Interesting Risk Measure that in my interpretation means: minimizing Average Portfolio Correlation with each Asset Class for a given level of return. One might try to use Correlation instead of Covariance matrix in ... [Read more...]
Carl Boettiger, a graduate student at UC Davis, just got two packages on CRAN. One is treebase, which which handshakes with the Treebase API. The other is rfishbase, which connects with the Fishbase, although I believe just scrapes XML cont...
And now for something a bit more esoteric….
I recently wrote a function to deal with a strange problem. Writing the function ended up being a fun challenge related to computing on the R language itself.
Here’s the problem: Write a function that tak... [Read more...]
The book is by Manfred Gilli, Dietmar Maringer and Enrico Schumann. I haven’t actually seen the book, so my judgement of it is mainly by the cover (and knowing the first two authors). The parts of the book closest to my heart are optimization, particularly portfolio optimization, and particularly ...
An R Cookbook can be found at http://code.ca-net.org/R%20Cookbook. It is a short web document presenting dozens of examples on - Accessing Database with packages RSQLite, RMySQL, RdbiPgSQL and RODBC; - Reading and Writing Data; - Date/Time variable; - Graphics; - … Continue reading → [Read more...]
This is the first in a series of blog posts in which I use the R package GGPlot2 to examine real world data. In this post, I construct a line graph of U.S. shoe consumption from 1995 to 2007. A recent survey conducted by Shop Smart magazine found that the average ... [Read more...]
Bubbles. I’m no expert in behavioral economics, but bubbles seem to be well understood (after they occur) although they seem hard to detect (at least in the eyes of outsiders and late bubble participants). This post won’t tell you how to avoid bubbles, but might give you some ... [Read more...]
For anyone who wants to estimate linear or nonlinear mixed-effects models (aka random-effects models, hierarchical models or multilevel models) using the R language, the Quantum Forest blog has several recent posts that will be of interest. Written by Luis Apiolaza from the School of Forestry at the University of Canterbury ... [Read more...]
We (Edwin de Jonge and me) have recently updated our editrules package. The most important new features include (beta) support for categorical data. However, in this post I'm going to show some visualizations we included, made possible by Gabor Csardi's … Continue reading → [Read more...]
Starting to write a blog I need a way how to publish my R codes. One possibility would be to just add some formatting with Pretty R. Nice, but I miss a repository with all codes ever submitted and possibility to make corrections.The final solution was ... [Read more...]
In most mixed linear model packages (e.g. asreml, lme4, nlme, etc) one needs to specify only the model equation (the bit that looks like y ~ factors...) when fitting simple models. We explicitly say nothing about the covariances that complete … Continue reading → [Read more...]