Hierarchical models with RStan (Part 1)

Real-world data sometime show complex structure that call for the use of special models. When data are organized in more than one level, hierarchical models are the most relevant tool for data analysis. One classic example is when you record student performance from different schools, you might decide to record student-level variables (age, ethnicity, social … Continue reading Hierarchical models with RStan (Part 1)

Fonctions récursives (avec R)

Les fonctions récursives sont des fonctions qui s'appellent elle mêmes lors de leurs exécution voir: https://fr.wikipedia.org/wiki/Fonction_r%C3%A9cursive. Un des challenges posé par Cédric sur son site: http://cedric-pupka.com/?p=117 , nous mets au défi de crée une fonction factorielle qui est récursive. Voici une solution en R: #factoriel récursive f<-function(x){   tmp<-1   if(x>0){     tmp<-f(x-1)*x   } … Continue reading Fonctions récursives (avec R)