Posts Tagged ‘ Poisson ’

scala-glm: Regression modelling in Scala

June 21, 2017
By
scala-glm: Regression modelling in Scala

Introduction As discussed in the previous post, I’ve recently constructed and delivered a short course on statistical computing with Scala. Much of the course is concerned with writing statistical algorithms in Scala, typically making use of the scientific and numerical computing library, Breeze. Breeze has all of the essential tools necessary for building statistical algorithms, … Continue reading scala-glm: Regression modelling in Scala

Read more »

Simple Distributions for Mixtures?

February 3, 2016
By
Simple Distributions for Mixtures?

The idea of GLMs is that given some covariates,  has a distribution in the exponential family (Gaussian, Poisson, Gamma, etc). But that does not mean that  has a similar distribution… so there is no reason to test for a Gamma model for  before running a Gamma regression, for instance. But are there cases where it might work? That the non-conditional distribution is the same (same family at least) than the conditional ones? For…

Read more »

Calling R from Scala sbt projects using rscala

August 15, 2015
By
Calling R from Scala sbt projects using rscala

Overview In the previous post I showed how the rscala package (which has replaced the jvmr package) can be used to call Scala code from within R. In this post I will show how to call R from Scala code. I have previously described how to do this using jvmr. This post is really just … Continue reading Calling R from Scala sbt projects using rscala

Read more »

Calling R from Scala sbt projects using rscala

August 15, 2015
By
Calling R from Scala sbt projects using rscala

Overview In the previous post I showed how the rscala package (which has replaced the jvmr package) can be used to call Scala code from within R. In this post I will show how to call R from Scala code. I have previously described how to do this using jvmr. This post is really just … Continue reading Calling R from Scala sbt projects using rscala

Read more »

I Fought the (distribution) Law (and the Law did not win)

April 27, 2015
By
I Fought the (distribution) Law (and the Law did not win)

A few days ago, I was asked if we should spend a lot of time to choose the distribution we use, in GLMs, for (actuarial) ratemaking. On that topic, I usually claim that the family is not the most important parameter in the regression model. Consider the following dataset > db <- data.frame(x=c(1,2,3,4,5),y=c(1,2,4,2,6)) > plot(db,xlim=c(0,6),ylim=c(-1,8),pch=19) To visualize a regression model, use the following code > nd=data.frame(x=seq(0,6,by=.1)) > add_predict = function(reg){…

Read more »

Reinterpreting Lee-Carter Mortality Model

November 18, 2014
By
Reinterpreting Lee-Carter Mortality Model

Last week, while I was giving my crash course on R for insurance, we’ve been discussing possible extensions of Lee & Carter (1992) model. If we look at the seminal paper, the model is defined as follows Hence, it means that This would be a (non)linear model on the logarithm of the mortality rate. A non-equivalent, but alternative expression might be which could be obtained as a Gaussian model, with…

Read more »

The odds of a cluster of airplane accidents

August 2, 2014
By
The odds of a cluster of airplane accidents

Recently, there have been a lot of airplane accidents. July, 17th 2014, Hrabove, Ukraine, Malaysia Airlines, Boeing 777, fatalities 298 (/298) July, 23rd 2014, Magong, Taiwan, TransAsia Airways, ATR 72-500, fatalities 47 (/58) July, 24th 2014, Aguelhok, Mali, Air Algerie, Mc Donnell Douglas MD-83, fatalities 116 (/116) It is simple to find a lot of datasets about airplane crashes. For instance on http://ntsb.gov/aviationquery. The dataset is nice, with a lot…

Read more »

37% chance

December 21, 2013
By
37% chance

I don’t know if you ever realized, before, but it is quite common to have 37% chance that something happened (or actually “not happened” if we want to be more rigorous). For instance, consider a  grid, and draw  points randomly (and uniformely). Then, around 37% cells are empty. Or if you consider a cell, on that grid, there is 37% chance, that the cell is empty. You can look, on the…

Read more »

GLM, non-linearity and heteroscedasticity

October 23, 2013
By
GLM, non-linearity and heteroscedasticity

Last week in the non-life insurance course, we’ve seen the theory of the Generalized Linear Models, emphasizing the two important components the link function (which is actually the key component in predictive modeling) the distribution, or the variance function Just to illustrate, consider my favorite dataset ­lin.mod = lm(dist~speed,data=cars) A linear model means here where the residuals are assumed to be centered, independent, and with identical variance. If we visualize that linear…

Read more »

Loi de Poisson

September 20, 2013
By

Suite du cours ACT2121, de préparation pour l’examen P de la SOA (probability). Un nouveaux jeu d’exercices, sur le thème 6 (tel que classifié dans le livre de Jacques Labelle, qui servira de référence pour ce cours) Loi de Poisson #6 ACT2...

Read more »


Subscribe

Email:

  Subscribe