Blog Archives

Excel (and French people) are such a pain in the…

November 6, 2014
By
Excel (and French people) are such a pain in the…

A few days ago, I published a post entitled extracting datasets from excel files in a zipped folder, because I wanted to use datasets that were online, in some (zipped) excel format. The first difficult part was the folder with a non-standard character (the French é). Because next week I should be using those dataset in a crash course...

Read more »

Shapefiles from Isodensity Curves

November 3, 2014
By
Shapefiles from Isodensity Curves

Recently, with @3wen, we wanted to play with isodensity curves. The problem is that it is difficult to get – numerically – the equation of the contour (even if we can easily plot it). Consider the following surface (just for fun, in order to illustrate the idea) > f=function(x,y) x*y+(1-x)*(1-y) > u=v=seq(0,1,length=21) > v=seq(0,1,length=11) > f=outer(u,v,f) > persp(u,v,f,theta=angle,phi=10,box=TRUE, +...

Read more »

Extracting datasets from excel files in a zipped folder

October 30, 2014
By
Extracting datasets from excel files in a zipped folder

The title of the post is a bit long, but that’s the problem I was facing this morning: importing dataset from files, online. I mean, it was not a “problem” (since I can always download, and extract manually the files), more a challenge (I should be able to do it in R, directly). The files are located on ressources-actuarielles.net, in a...

Read more »

Kernel Density Estimation with Ripley’s Circumferential Correction

October 21, 2014
By
Kernel Density Estimation with Ripley’s Circumferential Correction

The revised version of the paper Kernel Density Estimation with Ripley’s Circumferential Correction with Ewen Gallic is now online, on hal.archives-ouvertes.fr/. In this paper, we investigate (and extend) Ripley’s circumference method to correct bias of density estimation of edges (or frontiers) of regions. The idea of the method was theoretical and difficult to implement. We provide a simple technique —...

Read more »

Removing Uncited References in a Tex File (with R)

October 18, 2014
By
Removing Uncited References in a Tex File (with R)

Last week, with @3wen, we were working a the revised version of our work on smoothing densities of spatial processes (with edge correction). Usually, once you have revised the paper, some references were added, others were droped. But you need to spend some time, to check that all references are actually mentioned in the paper. For instance, consider the...

Read more »

What happens if we forget a trivial assumption ?

October 4, 2014
By
What happens if we forget a trivial assumption ?

Last week, @dmonniaux published an interesting post entitled l’erreur n’a rien d’original  on  his blog. He was asking the following question : let , and denote three real-valued coefficients, under which assumption on those three coefficients does has a real-valued root ? Everyone aswered , but no one mentioned that it is necessary to have a proper quadratic equation,...

Read more »

Cross Validation for Kernel Density Estimation

October 1, 2014
By
Cross Validation for Kernel Density Estimation

In a post publihed in July, I mentioned the so called the Goldilocks principle, in the context of kermel density estimation, and bandwidth selection. The bandwith should not be too small (the variance would be too large) and it should not be too large (the bias would be too large). Another standard method to select the bandwith, as mentioned...

Read more »

Generating Hurricanes with a Markov Spatial Process

September 30, 2014
By
Generating Hurricanes with a Markov Spatial Process

The National Hurricane Center (NHC) collects datasets with all  storms in North Atlantic, the North Atlantic Hurricane Database (HURDAT). For all sorms, we have the location of the storm, every six jours (at midnight, six a.m., noon and six p.m.). Note that we have also the date, the maximal wind speed – on a 6 hour window – and...

Read more »

R package for Computational Actuarial Science

September 29, 2014
By

A webpage for the book is now hosted on http://cas.uqam.ca/ So far, it is a very basic page, but information regarding the package can be found there. For instance, to install the package, with all the datasets, the R code is > install.packages("CAS...

Read more »

Multiple Tests, an Introduction

September 24, 2014
By
Multiple Tests, an Introduction

Last week, a student asked me about multiple tests. More precisely, she ran an experience over – say – 20 weeks, with the same cohort of – say – 100 patients. An we observe some size=100 nb=20 set.seed(1) X=matrix(rnorm(size*nb),size,nb) (here, I just generate some fake data). I can visualize some trajectories, over the 20 weeks, library(RColorBrewer) cl1=brewer.pal(12,"Set3") cl2=brewer.pal(8,"Set2") cl=c(cl1,cl2)...

Read more »