Articles by arthur charpentier

Using convolutions (S3) vs distributions (S4)

January 24, 2018 | arthur charpentier

Usually, to illustrate the difference between S3 and S4 classes in R, I mention glm (from base) and vglm (from VGAM) that provide similar outputs, but one is based on S3 codes, while the second one is based on S4 codes. Another way to illustrate is to manipulate distributions. Consider ...
[Read more...]

Holt-Winters with a Quantile Loss Function

January 8, 2018 | arthur charpentier

Exponential Smoothing is an old technique, but it can perform extremely well on real time series, as discussed in Hyndman, Koehler, Ord & Snyder (2008)), when Gardner (2005) appeared, many believed that exponential smoothing should be disregarded because it was either a special case of ARIMA modeling or an ad hoc procedure with ... [Read more...]

The myth of interpretability of econometric models

December 8, 2017 | arthur charpentier

There are important discussions nowadays about data modeling, to choose between the “two cultures” (as mentioned in Breiman (2001)), i.e. either econometrics models or machine/statistical learning models. We did discuss this issue recently in Econométrie et Machine Learning (so far only in French) with Emmanuel Flachaire and Antoine ...
[Read more...]

Traveling Salesman

September 26, 2017 | arthur charpentier

In the second part of the course on graphs and networks, we will focus on economic applications, and flows. The first series of slides are on the traveling salesman problem. Slides are available online. [Read more...]

Matching, Optimal Transport and Statistical Tests

July 30, 2017 | arthur charpentier

To explain the “optimal transport” problem, we usually start with Gaspard Monge’s “Mémoire sur la théorie des déblais et des remblais“, where the the problem of transporting a given distribution of matter (a pile of sand for instance) into another (an excavation for instance). This problem ...
[Read more...]

The U.S. Has Been At War 222 Out of 239 Years

March 19, 2017 | arthur charpentier

This morning, I discovered an interesting statistic, America Has Been At War 93% of the Time – 222 Out of 239 Years – Since 1776,  i.e. the U.S. has only been at peace for less than 20 years total since its birth. I wanted to check, get a better understanding and look at other countries ...
[Read more...]

Third Actuarial Pricing Game

January 9, 2017 | arthur charpentier

With the support of ACTINFO Chair and the (French) Institute of Actuaries, our Third Actuarial Pricing Game starts today ! There is a toolbox file available online, with a description of the game : the rules, the dates, and a description of the datasets 3 datasets : one underwriting and one claims databases, for ... [Read more...]

(Advanced) R Crash Course, for Actuaries

January 6, 2017 | arthur charpentier

In two weeks, the third year of the Data Science for Actuaries program will start. I will be there for the introduction to R. The slides are available online (created with slidify) A markdown is also available. I have to thank Ewen for his help on slidify (especially for the ...
[Read more...]

Forcasting Natural Catastrophes (is rather difficult)

January 2, 2017 | arthur charpentier

Following my previous post, I wanted to spend more time, on the time series with “global weather-related disaster losses as a proportion of global GDP” over the time period 1990-2016 that Roger Pilke sent me last night. db=data.frame(year=1990:2016, ratio=c(.23,.27,.32,.37,.22,.26,.29,.15,.40,.28,.14,.09,.24,.18,.29,.51,.13,.17,.25,.13,.21,.29,.25,.2,.15,.12,.12)) In my previous post, I spend some ...
[Read more...]

What is a Linear Trend, by the way?

January 1, 2017 | arthur charpentier

I had a very stranger discussion on twitter (yes, another one), about regression curves. I think it started with a tweet based on some xkcd picture (just for fun, because it was New Year’s Day) “don’t trust linear regressions” https://t.co/exUCvyRd1G pic.twitter.com/O6...
[Read more...]

Rupture Detection

December 13, 2016 | arthur charpentier

There are some graphs that you cannot forget. One graph that I found puzzling was mentioned on Andrew Gelman’s blog, a few years back, and was related to rupture detection What I remember from this graph is that if you want to get a rupture, you can easily find ...
[Read more...]

How long could it take to run a regression

April 6, 2016 | arthur charpentier

This afternoon, while I was discussing with Montserrat (aka @mguillen_estany) we were wondering how long it might take to run a regression model. More specifically, how long it might take if we use a Bayesian approach. My guess was that the time should probably be linear in , the number ... [Read more...]

Where People Live, part 2

April 4, 2016 | arthur charpentier

Following my previous post, I wanted to use another dataset to visualize where people live, on Earth. The dataset is coming from sedac.ciesin.columbia.edu. We you register, you can download the database __ base=read.table("glp00ag15.asc",skip=6) The database is a ‘big’ 1440×572 matrix, in each cell (...
[Read more...]

Classification on the German Credit Database

March 18, 2016 | arthur charpentier

In our data science course, this morning, we’ve use random forrest to improve prediction on the German Credit Dataset. The dataset is __ url="http://freakonometrics.free.fr/german_credit.csv" __ credit=read.csv(url, header = TRUE, sep = ",") Almost all variables are treated a numeric, but actually, most of them ...
[Read more...]

Forecasts with ARIMA Models

March 16, 2016 | arthur charpentier

In our time series class this morning, I was discussing forecasts with ARIMA Models. Consider some simple stationnary AR(1) simulated time series __ n=95 __ set.seed(1) __ E=rnorm(n) __ X=rep(0,n) __ phi=.85 __ for(t in 2:n) X[t]=phi*X[t-1]+E[t] __ plot(X,type="l") If we fit ...
[Read more...]
1 2 3 4 5 6 19

Never miss an update!
Subscribe to R-bloggers to receive
e-mails with the latest R posts.
(You will not see this message again.)

Click here to close (This popup will not appear again)