Monthly Archives: December 2010

R with Vim

December 2, 2010
By
R with Vim

For all those who think that Vim is The Editor for text files, and simultaneously think that R is The EnvironmentForStatisticalAnalysisAndGraphics. After trying out various options for intergrating Vim with R I settled on the following configuration: Use Vim-R-pluginfor editing R code files, R documentation files (*.Rd) as well as the Sweave files. Apart from

Read more »

Random variable generation (Pt 2 of 3)

December 2, 2010
By
Random variable generation (Pt 2 of 3)

Acceptance-rejection methods This post is based on chapter 1.4 of Advanced Markov Chain Monte Carlo. Another method of generating random variates from distributions is to use acceptance-rejection methods. Basically to generate a random number from , we generate a RN from an envelope distribution , where .  The acceptance-rejection algorithm is as follows: Repeat until

Read more »

Statistique de l’assurance STT6705V, partie 12

December 2, 2010
By
Statistique de l’assurance STT6705V, partie 12

The final course (since courses end this week in Montréal) can be watched here and there. The drawings from the course can be downloaded here (including last week's). First, to come back on last week's course , we considered Lee-carter model, i.e....

Read more »

Rd2roxygen: Convert Rd to roxygen documentation

December 1, 2010
By

must admit that I have been tired of maintaining my R packages for a long time, and the main reason is I feel really uncomfortable with writing R documentations (Rd). The required structure of an R package mainly includes two directories R and man — the former for the R source code (typically functions), and

Read more »

Recent developments in the drug war

December 1, 2010
By
Recent developments in the drug war

The Mexican government recently released data on all crime statistics from January 1997 to October 2010, as reported by the various police forces operating in Mexico. This information provides an unprecedented look at what has happened since the drug war began and allows for a frank assessment of the deterioration of security in Mexico.

Read more »

Recent developments in the drug war

December 1, 2010
By
Recent developments in the drug war

The Mexican government recently released data on all crime statistics from January 1997 to October 2010, as reported by the various police forces operating in Mexico. This information provides an unprecedented look at what has happened since the drug war began and allows for a frank assessment of the deterioration of security in Mexico.

Read more »

Online Resources for Learning R

December 1, 2010
By
Online Resources for Learning R

Online classes are an easy and convenient way to learn more about a topic of interest. Not surprisingly, there are a variety of online resources, free and otherwise, to learn more about R. From online graduate classes, to the more “learn at your own pace” approach, here are some resources I have found useful: Programming

Read more »

Le Monde puzzle [48]

December 1, 2010
By
Le Monde puzzle [48]

This week(end), the Le Monde puzzle can be (re)written as follows (even though it is presented as a graph problem): Given a square 327×327 symmetric matrix A, where each non-diagonal entry is in {1,2,3,4,5} and , does there exist a triplet (i,j,k) such that Solving this problem in R is very easy. We can create

Read more »

How to create PDF reports with R

December 1, 2010
By
How to create PDF reports with R

Sweave is a literate programming system included with R. It makes it possible to create a PDF document containing not just text, but also tables and charts generated from R. The process is automated, so once you've created an Sweave document (which includes both LaTeX text markup and R commands), you can create the formatted text and insert the...

Read more »

How to create PDF reports with R

December 1, 2010
By
How to create PDF reports with R

Sweave is a literate programming system included with R. It makes it possible to create a PDF document containing not just text, but also tables and charts generated from R. The process is automated, so once you've created an Sweave document (which includes both LaTeX text markup and R commands), you can create the formatted text and insert the...

Read more »