Actuarial Modeling in R CAS Spring Meeting June, 2007 Glenn Meyers, FCAS, MAAA Jim Guszcza, FCAS, MAAA.

Slides:



Advertisements
Similar presentations
Introduction to R! for Actuaries Histograms
Advertisements

1 General Iteration Algorithms by Luyang Fu, Ph. D., State Auto Insurance Company Cheng-sheng Peter Wu, FCAS, ASA, MAAA, Deloitte Consulting LLP 2007 CAS.
Copula Regression By Rahul A. Parsa Drake University &
Introduction to Graphics in R Department of Statistical Sciences and Operations Research Computation Seminar Series Speaker: Edward Boone
Actuarial Modeling in R CAS Predictive Modeling Seminar Las Vegas October, 2007 Glenn Meyers, FCAS, MAAA Jim Guszcza, FCAS, MAAA.
Christopher Dougherty EC220 - Introduction to econometrics (chapter 2) Slideshow: a Monte Carlo experiment Original citation: Dougherty, C. (2012) EC220.
TRIM Workshop Arco van Strien Wildlife statistics Statistics Netherlands (CBS)
1 Methods of Experimental Particle Physics Alexei Safonov Lecture #21.
R Mohammed Wahaj. What is R R is a programming language which is geared towards using a statistical approach and graphics Statisticians and data miners.
An Introduction to Stochastic Reserve Analysis Gerald Kirschner, FCAS, MAAA Deloitte Consulting Casualty Loss Reserve Seminar September 2004.
Generalised linear models
Log-linear and logistic models
Linear and generalised linear models
Linear and generalised linear models Purpose of linear models Least-squares solution for linear models Analysis of diagnostics Exponential family and generalised.
How to Use the R Programming Language for Statistical Analyses Part I: An Introduction to R Jennifer Urbano Blackford, Ph.D. Department of Psychiatry Kennedy.
1 A MONTE CARLO EXPERIMENT In the previous slideshow, we saw that the error term is responsible for the variations of b 2 around its fixed component 
Modern Navigation Thomas Herring
What is R Muhammad Omer. What is R  R is the programing language software for statistical computing and data analysis  The R language is extensively.
Introduction to R Statistical Software Anthony (Tony) R. Olsen USEPA ORD NHEERL Western Ecology Division Corvallis, OR (541)
Copyright ©: SAMSUNG & Samsung Hope for Youth. All rights reserved Tutorials Software: Building apps Suitable for: Advanced.
Stephen Mildenhall September 2001
Lecture 4 MATLAB Windows Arithmetic Operators Maintenance Functions
A B C Q R S! Coilín Minto Department of Biology, Dalhousie University.
Objectives Understand what MATLAB is and why it is widely used in engineering and science Start the MATLAB program and solve simple problems in the command.
Intro to R R is a free version of S-plus R is a free version of S-plus Can be used interactively but script or syntax files are commonly used to record.
A Beginner’s Guide to Bayesian Modelling Peter England, PhD EMB GIRO 2002.
CHAPTER 14 MULTIPLE REGRESSION
More on Stochastic Reserving in General Insurance GIRO Convention, Killarney, October 2004 Peter England and Richard Verrall.
Practical GLM Modeling of Deductibles
Using Neural Networks to Predict Claim Duration in the Presence of Right Censoring and Covariates David Speights Senior Research Statistician HNC Insurance.
Piotr Wolski Introduction to R. Topics What is R? Sample session How to install R? Minimum you have to know to work in R Data objects in R and how to.
1 Computer Programming (ECGD2102 ) Using MATLAB Instructor: Eng. Eman Al.Swaity Lecture (1): Introduction.
The Common Shock Model for Correlations Between Lines of Insurance
Approximation of Aggregate Losses Dmitry Papush Commercial Risk Reinsurance Company CAS Seminar on Reinsurance June 7, 1999 Baltimore, MD.
Using Software in Teaching Statistics Damon Berridge, Centre for Applied Statistics, Dept of Mathematics & Statistics ESRC NCRM.
Testing Models on Simulated Data Presented at the Casualty Loss Reserve Seminar September 19, 2008 Glenn Meyers, FCAS, PhD ISO Innovative Analytics.
Getting Started with MATLAB 1. Fundamentals of MATLAB 2. Different Windows of MATLAB 1.
Data Mining: Neural Network Applications by Louise Francis CAS Annual Meeting, Nov 11, 2002 Francis Analytics and Actuarial Data Mining, Inc.
Estimating the Predictive Distribution for Loss Reserve Models Glenn Meyers Casualty Loss Reserve Seminar September 12, 2006.
Likelihood Methods in Ecology November 16 th – 20 th, 2009 Millbrook, NY Instructors: Charles Canham and María Uriarte Teaching Assistant Liza Comita.
Introduction to Programming in R Department of Statistical Sciences and Operations Research Computation Seminar Series Speaker: Edward Boone
1 GLM I: Introduction to Generalized Linear Models By Curtis Gary Dean Distinguished Professor of Actuarial Science Ball State University By Curtis Gary.
The Cost of Financing Insurance Version 2.0 Glenn Meyers Insurance Services Office Inc. CAS Ratemaking Seminar March 8, 2002.
Institute for Mathematics and Its Applications
© Department of Statistics 2012 STATS 330 Lecture 20: Slide 1 Stats 330: Lecture 20.
WFM 6311: Climate Risk Management © Dr. Akm Saiful Islam WFM 6311: Climate Change Risk Management Akm Saiful Islam Lecture-7:Extereme Climate Indicators.
CSSE463: Image Recognition Day 11 Lab 4 (shape) tomorrow: feel free to start in advance Lab 4 (shape) tomorrow: feel free to start in advance Test Monday.
Modeling the Loss Process for Medical Malpractice Bill Faltas GE Insurance Solutions CAS Special Interest Seminar … Predictive Modeling “GLM and the Medical.
1 7. What to Optimize? In this session: 1.Can one do better by optimizing something else? 2.Likelihood, not LS? 3.Using a handful of likelihood functions.
On Predictive Modeling for Claim Severity Paper in Spring 2005 CAS Forum Glenn Meyers ISO Innovative Analytics Predictive Modeling Seminar September 19,
Basics of Biostatistics for Health Research Session 1 – February 7 th, 2013 Dr. Scott Patten, Professor of Epidemiology Department of Community Health.
Practical GLM Analysis of Homeowners David Cummings State Farm Insurance Companies.
CSSE463: Image Recognition Day 11 Due: Due: Written assignment 1 tomorrow, 4:00 pm Written assignment 1 tomorrow, 4:00 pm Start thinking about term project.
PROGRAMMING IN R Introduction to R. In this session I will: Introduce you to the R program and windows Show how to install R Write basic programs in R.
Stochastic Loss Reserving with the Collective Risk Model Glenn Meyers ISO Innovative Analytics Casualty Loss Reserving Seminar September 18, 2008.
2000 SEMINAR ON REINSURANCE PITFALLS IN FITTING LOSS DISTRIBUTIONS CLIVE L. KEATINGE.
A Stochastic Framework for Incremental Average Reserve Models Presented by Roger M. Hayne, PhD., FCAS, MAAA Casualty Loss Reserve Seminar September.
Introduction to CADStat. CADStat and R R is a powerful and free statistical package [
Session C7: Dynamic Risk Modeling Loss Simulation Model Working Party Goals & Progress Report Mark R. Shapland, FCAS, ASA, MAAA Consulting Actuary Casualty.
Estimating the Predictive Distribution for Loss Reserve Models Glenn Meyers ISO Innovative Analytics CAS Annual Meeting November 14, 2007.
Introductory Data Analysis F73DA2. Contact Times (Spring Term 2008) Monday 4: : Lecture in LT3 Tuesday 2: : Lecture in LT3 Wednesday
Reserving for Medical Professional Liability Casualty Loss Reserve Seminar September 10-11, 2001 New Orleans, Louisiana Rajesh Sahasrabuddhe, FCAS, MAAA.
With the support of the LPP programme of the European Union 1 This project has been funded with support from the European Commission. This publication.
Modeling and Simulation CS 313
Modeling and Simulation CS 313
Introduction to Summary Statistics
Introduction to Summary Statistics
Discrete Event Simulation - 4
Significant models of claim number Introduction
Introduction to Matlab
Presentation transcript:

Actuarial Modeling in R CAS Spring Meeting June, 2007 Glenn Meyers, FCAS, MAAA Jim Guszcza, FCAS, MAAA

1 Contents R Background, Installing R on Your PC R Warm-up Examples 1-6

R Background

3 R is an open-source statistical programming language Pre-History: –R is based on the S statistical programming language developed at Bell labs in the 1980’s –The commercial package S-plus is based on the S language –R is an open-source implementation of the S language Features: –R is a high-level, object-oriented programming environment –R has advanced graphical capabilities –Statisticians around the world contribute add-on packages –Highly interactive in nature –Allows for experimentation and creativity –Known as “the statistician’s calculator”

4 Installing R Go to Or just type “R” into Google and click “I feel lucky” Click on “Download CRAN on the left of the screen” Click on one of the USA CRAN mirror sites Click on “Windows (95 and later)” Click on “base” Right-click on R win32.exe “Save target as” into any directory After you’ve downloaded this setup program, double-click on it and follow the instructions

5 Add-on Packages Click on “Packages” –Select “Install Package(s) Select a CRAN mirror

6 Add-on Packages “Packages” window will appear Select “MASS” and click OK MASS stands for Modern Applied Statistics in S By Venables and Ripley … add anything else you like. It’s all free There are hundreds of add-on packages available

R Warm-Up R as a Calculator Assignments Vectors, Matrices, Data Frames Getting Help Linear Models Maximum Likelihood Estimation

Example 1 Estimating a non-trivial loss distribution

9 Example 1: Fitting a Non-trivial Loss Distribution Here is a size-of-loss histogram for 539 claims Let’s estimate the true distribution that generated these claims.

Example 2 Curve Fitting

11 Example 2: Curve Fitting In this dataset, Y has a non- linear relationship with X Let’s fit a curve to this data

Example 3 Non-Linear Predictive Modeling

13 Example 3: Predictive Modeling Problem We have data on 369 Workers Comp claims –Age of claimant –Distance to work –Claim Duration Let’s build a model to predict Duration using Age and Distance

14 Tinn-R ( T his i s n ot n otepad) – A text editor for R Search Tinn-R on Google Free download Helpful in a lot of little ways

Example 4 Generalized Additive Model (GAM) Example

16 Generalized Additive Model (GAM) Similar to Generalized Linear Model (GLM) –Allows for non-linear predictors Select mgcv package

Example 5 Collective Risk Model Example

18 Collective Risk Model Easily viewed as a simulation –Select  from a gamma distribution with mean 1 and variance c –Select N from a Poisson distribution with mean · Note – This process gives a negative binomial distribution –Select N claims from a Pareto distribution –X = Sum of the N claims Fast calculation with FFT’s –Discretize claim severity distribution Reference Loss Models by Klugman, Panjer and Willmot –p 185 and p 656 (2 nd Edition)

Example 6 Parameter Risk in Loss Reserving

20 Parameter Risk in Loss Reserve Estimates Expected Loss Payment in Lag t = Premium·ELR·((t|a,b)-(t-1|a,b) Observed loss in Lag t has an overdispersed Poisson distribution with Mean = Expected Loss Payment in Lag t Estimate ELR, a and b by maximum likelihood –Repeat on OD Poisson simulated data from fixed ELR, a and b References –Clark, CAS Forum (Fall 2003) –England and Verrall, PCAS 2001

21 A Package in R for Actuarial Science – ASTIN Colloquium actuar: an R package for Actuarial Science Vincent Goulet The actuar project is a package of Actuarial Science functions for the R statistical system. The project was launched in 2005 and the package is available on CRAN (Comprehensive R Archive Network) since February The current version of the package contains functions for use in the fields of risk theory, loss distributions and credibility theory. This talk will present the most recent developments and demonstrate how the package can be useful in teaching, research and practice.