1. A new SAS macro package for PI R&D:
Model Delivery System
Author: Songtao Wan Manager: Joseph (Xiaochen) Li Mentor: Hao Ding
1
2. Model Delivery System’s Introduction
1. Motivation
• It is always a headache for modelers to deliver/document their models.
The processes are well described as:
Time-consuming
Labor-intensive
Repetitive
Vulnerable to human errors
2
2. Solution
• Motivated by my manager Joseph (Xiaochen) Li, I present a new tool:
Three piece-wise SAS macro package: Model Delivery System
• Les Trois Mousquetaires: %convert, %merge, %output
3. Model Delivery System’s Workflow
3
%convert Input:
1.Modeling dataset
2.Parameter dataset
3.Modeled and Structure
variables
Step 1:
Aggregate exposure by both
modeled & structured variables
Step 2:
Obtain factors from
%fitted_parts
Step 3:
Calculate exposure
weighted factor by
structured variables
Step 5:
Addition features:
Level checking
Rebase
Basic stats
Step 4:
Combine other aggregated
model information
%merge Input: output datasets from
%convert with the same structure.
What do:
Merge the input datasets – combining
factors from different coverage/perils
into one dataset.
%output Input: output datasets from
%merge and/or %convert.
What do:
Produce Excel file – outputting merged
datasets into separate tabs.
4. Model Delivery System’s 1st Function: Delivery
4
This is how it looks like in a merged tab for CP,BI,PD and CL
structured variables with levels exposure-weighted factors
Note: all results are coming from simulated data sets
cc7 cc8 cc9 cc10 CP BI PD CL
0 0 0 0 0.991 1.005 1.000 1.007
0 0 0 1 1.015 1.000 1.000 1.016
0 0 0 2 1.021 0.989 1.000 1.002
0 0 0 3 0.997 0.997 1.000 1.012
0 0 1 0 0.997 1.001 1.000 1.000
0 0 1 1 0.995 0.991 1.000 1.006
0 0 1 2 1.022 1.007 1.000 1.006
0 0 1 3 0.991 0.976 1.000 1.008
0 0 2 0 0.991 0.986 1.000 1.012
0 0 2 1 1.015 0.993 1.000 1.009
… … … … … … … …
5. Model Delivery System’s 2nd Function: Documentation
5
This is how it looks like to record model variable “cc1”
model information & structured factor recorded model statistics
Note: all results are coming from simulated data sets
from %dglm output parameter estimate data set
cc1
NUM_
CLAIMS
INCURRED_
LOSS
EARNED_
EXPOSURE
PURE_
PREMIUM
z
INDICATED_
FACTOR
df estimate stderr ci_l ci_u chi_square p_value
SELECTED_
FACTOR
0 98692 392138539.8 3001316.97 130.660 100.00% 1.011 1 0.011 0.01 -0.008 0.029 1.219 0.270 1.005
1 13207 51032729.89 3000724.58 17.010 27.65% 0.135 1 -2 0.02 -2.039 -1.962 10263.426 0.000 0.135
2 98187 386948937.9 2998271.84 129.060 100.00% 1.004 1 0.004 0.01 -0.015 0.022 0.137 0.711 0.995
3 98747 390380096.8 2998800.16 130.180 100.00% 1.000 0 0 0 0 0 1.000
from %spline
6. Model Delivery System’s Available Resources
• The macros and user’s guide book are located at:
• For SAS server TLSASPU6:
/auto/auto_nextgen/TEAM/swan/sas_macro/convert.sas
/auto/auto_nextgen/TEAM/swan/sas_macro/merge.sas
/auto/auto_nextgen/TEAM/swan/sas_macro/output.sas
/auto/auto_nextgen/TEAM/swan/sas_macro/MDS.pdf
• For SAS server TLSASPU7:
/data_team/Data_Home/swan/macro/convert.sas
/data_team/Data_Home/swan/macro/merge.sas
/data_team/Data_Home/swan/macro/output.sas
/data_team/Data_Home/swan/macro/fitted_parts.sas
/data_team/Data_Home/swan/macro/MDS.pdf
6
7. Q & A session
Any Questions?
7
“ Judge a man(woman) by his(her) questions rather than by his(her) answers.”
--- Francois-Marie Arouet, known as Voltaire