Actuarial Modeling in R CAS Predictive Modeling Seminar Las Vegas October, 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.
Introduction to Graphics in R Department of Statistical Sciences and Operations Research Computation Seminar Series Speaker: Edward Boone
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)
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.
Welcome to E-Prime E-Prime refers to the Experimenter’s Prime (best) development studio for the creation of computerized behavioral research. E-Prime is.
1 Loss Triangle Philosophy Leigh J. Halliwell, FCAS, MAAA Consulting Actuary CARe Seminar Boston, MA May 19, 2008 Leigh J. Halliwell,
Statistical analysis and modeling of neural data Lecture 4 Bijan Pesaran 17 Sept, 2007.
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 
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)
Hello World CE-105 Fall 2006 By: Engr. Faisal ur Rehman.
Copyright ©: SAMSUNG & Samsung Hope for Youth. All rights reserved Tutorials Software: Building apps Suitable for: Advanced.
1 An Introduction – UCF, Methods in Ecology, Fall 2008 An Introduction By Danny K. Hunt & Eric D. Stolen Getting Started with R (with speaker notes)
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.
The Cost of Financing Insurance Version 2.0 Glenn Meyers Insurance Services Office Inc. CAS Ratemaking Seminar March 13, 2001.
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.
Actuarial Modeling in R CAS Spring Meeting June, 2007 Glenn Meyers, FCAS, MAAA Jim Guszcza, FCAS, MAAA.
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.
Using the ‘R’ Language for Bioinformatics
The Common Shock Model for Correlations Between Lines of Insurance
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.
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
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.
An Introduction to R Statistical Computing AMS 597 Stony Brook University Spring 2009 By Tianyi Zhang.
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.
© 2015 by Wade Rogers Introduction to R Cytomics Workshop December, 2015.
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.
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.
Introduction to R Aedín Culhane
Darrin Rogers (not any kind of R expert guy) Department of Psychology & Anthropology University of Texas – Pan American 4/14/2011.
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
Deep Feedforward Networks
R programming language
Modeling and Simulation CS 313
Introduction to Summary Statistics
R Programming.
Introduction to Summary Statistics
May 31-June 2, 2016, Missouri Botanical Garden
Introduction to Matlab
R Statistical Language
Presentation transcript:

Actuarial Modeling in R CAS Predictive Modeling Seminar Las Vegas October, 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 –Developed by Ross Ihaka & Robert Gentlemen at U. Aukland –Maintained/Developed by R development Core Team 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

12 A Neural Net

Example 3 Non-Linear Predictive Modeling

14 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

15 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

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

Example 5 Collective Risk Model Example

19 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

21 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

22 A Package in R for Actuarial Science – ASTIN Colloquium actuar: an R package for Actuarial Science by 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. Also has an excellent discussion of R under the “Software and Technology” forum. My nomination for the best reference from that site