Publications by arthur charpentier
Reproducibility and randomness
With Stéphane Tufféry, we were working this week on a chapter of a book, entitled Statistical Learning in Actuarial Science. The chapter should be based on R functions, and we wanted to reproduce some outputs he previously obtained with SAS. The good thing is that even complex functions (logistic regression, regression trees, etc) produce the s...
2909 sym R (1038 sym/5 pcs) 8 img 3 tbl
Playing cards, with R
In my courses on R, I usually show how to insert a picture as a background for a graph. But it is also to see the picture as an object, and to insert it in a graph everywhere we like to see it, as explained on the awesome blog http://rsnippets.blogspot.ca/…. (in a post published in January 2012). I wanted to insert cards in a graph. Cards can b...
2703 sym R (1255 sym/8 pcs) 16 img 1 tbl
From a random generator to a sample function
This week-end, I wrote a post since I had some trouble to generate a sample random sample with R, to reproduce one obtained by a co-author, with SAS (generated using Fishman and Moore (1982) used in function RANUNI). I was lucky since another contributor for that book, Christrophe Dutang, got the anwer to the last question I asked: is it possibl...
3434 sym R (1621 sym/8 pcs) 8 img
Playing cards in Vegas?
In a previous post, a few weeks ago, I mentioned that I will be in Las Vegas by the end of July. And I took the opportunity to write a post on roulette(s). Since some colleagues told me I should take some time to play poker there, I guess I have to understand how to play poker… so I went back to basics on cards, and shuffling techniques. Now, ...
8843 sym R (4647 sym/17 pcs) 48 img
Generating a Markov chain vs. computing the transition matrix
A couple of days ago, we had a quick chat on Karl Broman‘s blog, about snakes and ladders (see http://kbroman.wordpress.com/…) with Karl and Corey (see http://bayesianbiologist.com/….), and the use of Markov Chain. I do believe that this application is truly awesome: the example is understandable by anyone, and computations (almost any kin...
7984 sym R (4688 sym/18 pcs) 104 img 2 tbl
Are parallel computations worth it ?
Yesterday, Daniel Marcelino published an interesting post on his blog, untitled Parallel Processing: When does it worth ? I was asking myself the same question for a chapter I am currently writing. And I did like his approach, so I tried, on my computer to do the same. I did use three packages to run parallel R codes, > library(multicore) > libra...
3395 sym R (1209 sym/8 pcs) 22 img 2 tbl
How old is the oldest person you know?
Last week, we had a discussion with some colleagues about the fact that – in order to prepare for the SOA exams – we did not have time (so far) to mention results on extreme values in our actuarial program. I did gave an introduction in my nonlife actuarial models class, but it was only an introduction, in three hours, in order to illustrate ...
5432 sym R (878 sym/7 pcs) 30 img
Visualizing densities of spatial processes
We recently uploaded on http://hal.archives-ouvertes.fr/hal-00725090 a revised version of our work, with Ewen Gallic (a.k.a. @3wen) on Visualizing spatial processes using Ripley’s correction: an application to bodily-injury car accident location In this paper, we investigate (and extend) Ripley’s circumference method to correct bias of densit...
3767 sym R (2466 sym/12 pcs) 16 img
Exposure as a possible explanatory variable
Iin insurance pricing, the exposure is usually used as an offset variable to model claims frequency. As explained many times on this blog (e.g. here), and in my notes, if we have to identical drivers, but one with an exposure of 6 months, and the other one of one year, it should be natural to assume that, on average, the second driver will have t...
6456 sym R (7858 sym/16 pcs) 24 img
Residuals from a logistic regression
I always claim that graphs are important in econometrics and statistics ! Of course, it is usually not that simple. Let me come back to a recent experience. A got an email from Sami yesterday, sending me a graph of residuals, and asking me what could be done with a graph of residuals, obtained from a logistic regression ? To get a better understa...
3270 sym R (1345 sym/9 pcs) 20 img