High-Performance Computing with R

December 25, 2008
By
High-Performance Computing with R

Dirk has posted a new version of slides for a tutorial "Introduction to High-Performance Computing with R".

Read more »

Very flattering

December 24, 2008
By

Good friend and fellow Oak Park / River Forest runner Paul Oppenheim used his column in the local weekly for some very flattering words about the marathon runners in our informal running group and even highlighting my personal World Marathon Majors adventure. I may just have to keep a copy for my epitaph.

Read more »

Statistics for Neuroscience (Neuroscience 9506b)

December 23, 2008
By
Statistics for Neuroscience (Neuroscience 9506b)

This coming winter term (Jan-Apr, 2009) I will be teaching my graduate seminar in the Graduate Program in Neuroscience, Statistics for Neuroscience (Neuroscience 9506b). The course webpage can be found . I will be doing two things differently this … Continue reading →

Read more »

gdata gains trimSum function

December 20, 2008
By
gdata gains trimSum function

I was doing some drawing in R and I needed to trim some values to keep the data (x axis) in reasonable limits, but I did not want to loose that info. Therefore, I summed the values that would be trimmed. Since I was repeating this, I wrote a function a...

Read more »

Rtools and Cygwin on MS Windows

December 20, 2008
By
Rtools and Cygwin on MS Windows

Duncan Murdoch provides Rtools which ease the installation of tools that are needed to do R package development/testing on MS Windows. The Rtools is a collection of various tools. However, if you also use Cygwin on MS Windows, you can expect problems s...

Read more »

Extra moments measure

December 16, 2008
By

The following functions are intended to replicate calculations for taking higher moments of hedge fund returns into account in analyzing particular investments.  Most of the formulae are taken from various EDHEC research papers.# All returns...

Read more »

R matrices in C functions

December 13, 2008
By

Using the .C() function in R, you can only pass vectors. Since R stores matrices columnwise as vectors anyhow, they can be passed to your C function as vectors (along with the number of rows in the matrix) and then accessed in familiar manner...

Read more »

R matrices in C functions

December 13, 2008
By

Using the .C() function in R, you can only pass vectors. Since R stores matrices columnwise as vectors anyhow, they can be passed to your C function as vectors (along with the number of rows in the matrix) and then accessed in familiar manner...

Read more »

Memory limit management in R

December 13, 2008
By
Memory limit management in R

R keeps all the data in RAM. I think I read somewhere that S+ does not hold all the data in RAM, which makes S+ slower than R. On the other hand, when we have a lot of data, R chockes. I know that SAS at some "periods" keeps data (tables) on disk in sp...

Read more »

Functions for portfolio analysis

December 11, 2008
By

Functions include:1. efficient.portfolio      compute minimum variance portfolio subject to target return2. globalMin.portfolio      compute global minimum variance portfolio3. tangency.portf...

Read more »

Convert Splus to R

December 10, 2008
By

Suppose you have got used to Splus and want to switch to R software (why bother to change? R is free while Splus is not, fair enough?), what can you do? since there are many functions in S-PLUS that are missing in R, one way is to understand the functions and write your owns, working N hours without sleep...

Read more »

Computational Finance with R

December 5, 2008
By
Computational Finance with R

Krishna Kumar, Jan Vecer and the great folks at REvolution computing put on a great event at the beautiful Columbia University campus on the Upper West Side of New York.Presentations by Whit Armstrong, Anthony Brockwell, Bryan Lewis, Scott Payseur, Pet...

Read more »

Some of my other R-resources

December 5, 2008
By

I am running this blog as a kind of learning journal, so I can look up some of the solutions I come up when I run into problems on my way to R-mastery. I have some other R-related resources which may be of interest to other R-fellas.A much more structu...

Read more »

Some of my other R-resources

December 5, 2008
By

I am running this blog as a kind of learning journal, so I can look up some of the solutions I come up when I run into problems on my way to R-mastery. I have some other R-related resources which may be of interest to other R-fellas.A much more structu...

Read more »

First and easy steps with R and Sweave

November 28, 2008
By
First and easy steps with R and Sweave

What really sold me to the idea of using Sweave and therefore (re)learning LaTeX was the idea of Reproducible Research. Charlie Geyer has put together some examples how to mix and match R and LaTeX with Sweave. Today's goal therefore is to run his examples and to see, what problems I run into :)Allright, if you all...

Read more »

First and easy steps with R and Sweave

November 28, 2008
By
First and easy steps with R and Sweave

What really sold me to the idea of using Sweave and therefore (re)learning LaTeX was the idea of Reproducible Research. Charlie Geyer has put together some examples how to mix and match R and LaTeX with Sweave. Today's goal therefore is to run his examples and to see, what problems I run into :)Allright, if you all...

Read more »

Sweave.sh plays with cacheSweave

November 26, 2008
By
Sweave.sh plays with cacheSweave

I have added support for caching to Sweave.sh script as implemented in cacheSweave R package written by Roger D. Peng. Now, one can set caching on for chunks that are time consuming (data import, some calculations, ...) and the Sweaving process will r...

Read more »

Calculating an N50 from Velvet output

November 25, 2008
By

In sequencing circles the N50 length is a useful heuristic for judging the quality of an assembly. Here is my definition of N50 length, which you may or may not find intuitive:N50 length is the length of the shortest contig such that the sum of contigs of equal length or longer is at least 50% of the total length...

Read more »

Calculating an N50 from Velvet output

November 25, 2008
By

In sequencing circles the N50 length is a useful heuristic for judging the quality of an assembly. Here is my definition of N50 length, which you may or may not find intuitive: N50 length is the length of the shortest contig such that the sum of contigs of equal length or longer is at least 50% of the total length...

Read more »

Use anchoring to lose years off your age

November 21, 2008
By
Use anchoring to lose years off your age

It is well known in psychology that the way a question is asked can strongly influence the answer. For example, if you spin a random number wheel and later have people guess the proportion of United Nations countries that are African, their answers clo...

Read more »

Setting up Textmate to use R

November 21, 2008
By
Setting up Textmate to use R

After becoming frustrated using the StatET plugin for Eclipse on my Mac (sometimes the R console would start and sometimes not), I decided to use Textmate instead. Textmate allows you to install extra bundles which are plug-ins to add some new function...

Read more »

Setting up Textmate to use R

November 21, 2008
By
Setting up Textmate to use R

After becoming frustrated using the StatET plugin for Eclipse on my Mac (sometimes the R console would start and sometimes not), I decided to use Textmate instead. Textmate allows you to install extra bundles which are plug-ins to add some new function...

Read more »

Plot symbols in R

November 18, 2008
By

In the plot environment, the "pch" parameter decides the symbol of your output. There are about 130 symbols hard coded and passed into "pch."However, there are still some symbols that are not in these 130 pch's. For instance, there is no checkmark. To plot checkmark or other symbols, we can use symbol() in the expression()...

Read more »

Plot symbols in R

November 18, 2008
By

In the plot environment, the "pch" parameter decides the symbol of your output. There are about 130 symbols hard coded and passed into "pch."However, there are still some symbols that are not in these 130 pch's. For instance, there is no checkmark. To plot checkmark or other symbols, we can use symbol() in the expression()...

Read more »

Call C from R and R from C

November 17, 2008
By

Several years ago, while a research associate at the University of Chicago, I had the privilege of sitting in on a course taught by Peter Rossi: Bayesian Applications in Marketing and MicroEconometrics. This course -- one I recommend to anyone at U Chicago who is interested in statistics -- was an incredibly clear treatment of Bayesian...

Read more »

Call C from R and R from C

November 17, 2008
By

Several years ago, while a research associate at the University of Chicago, I had the privilege of sitting in on a course taught by Peter Rossi: Bayesian Applications in Marketing and MicroEconometrics. This course -- one I recommend to anyone at U Chicago who is interested in statistics -- was an incredibly clear treatment of Bayesian...

Read more »

Multivariate dependence with copulas

November 17, 2008
By

Classes (S4) of commonly used copulas including elliptical (normal and t), Archimedean (Clayton, Gumbel, Frank, and Ali-Mikhail-Haq), extreme value (Husler-Reiss and Galambos), and other families (Plackett and Farlie-Gumbel-Morgenstern). Methods for d...

Read more »

Sweave Engine for TeXShop

November 17, 2008
By
Sweave Engine for TeXShop

Sweave is an awesome utility for including the output of R code in a LaTeX document which I have started using regularly. TeXShop is my favorite editor/viewer for LaTeX under Mac OS X for many reasons. One of which is the speed of the edit -> compile -> view process which it enables. Therefore, I

Read more »

Using the booktabs package with Sweave and xtable

November 16, 2008
By
Using the booktabs package with Sweave and xtable

The xtable package in R can output R data as latex tables. Used in conjunction with Sweave it is possible to automatically generate tables in a report. Needless to say this provides a really appealing possibility of never typing data into a table again. The only problem is that I think the default latex tables

Read more »