Actuarial Outpost
 
Go Back   Actuarial Outpost > Actuarial Discussion Forum > Property - Casualty / General Insurance
FlashChat Actuarial Discussion Preliminary Exams CAS/SOA Exams Cyberchat Around the World Suggestions

Actuarial Jobs by State

New York  New Jersey  Connecticut  Massachusetts 
California  Florida  Texas  Illinois  Colorado


Reply
 
Thread Tools Display Modes
  #1  
Old 01-03-2018, 06:07 PM
Hari Seldon Hari Seldon is offline
CAS
 
Join Date: Sep 2015
College: Hard Knocks
Posts: 8
Default Contiguous territory assigments/recommendations in R?

Hi,

Does anyone know if there is a package in R which can help assign contiguous territories based on zip? Like, your data matrix contains zip and some loss metric, and then you run through an R package where R recommends some specific territory by zip assignments while taking into account distance between zip centroids(which can be a lat/long included in the data matrix provided by the user) as well as some consideration for minimizing between variance within territories and maximizing between variance between territories?

Bueller? Bueller?

thanks,

Hari Seldon
Reply With Quote
  #2  
Old 01-04-2018, 11:12 AM
examsarehard examsarehard is offline
Member
CAS
 
Join Date: May 2011
Posts: 518
Default

Not aware of any, but you could modify a k-means clustering algorithm to traverse a network graph if you really needed to enforce the contiguity constraint.
Reply With Quote
  #3  
Old 01-04-2018, 11:46 AM
Klaymen's Avatar
Klaymen Klaymen is offline
Member
CAS
 
Join Date: Oct 2001
Studying for the Last Reformation
Posts: 18,648
Default

Don't forget to reverses the polarity of the neutron flow first.
__________________

Trust in the Lord and do good; dwell in the land and enjoy safe pasture. Take delight in the Lord, and he will give you the desires of your heart. Commit your way to the Lord; trust in him and he will do this: He will make your righteous reward shine like the dawn, your vindication like the noonday sun. (Psalm 37:3-6)
Reply With Quote
  #4  
Old 01-04-2018, 01:28 PM
Hari Seldon Hari Seldon is offline
CAS
 
Join Date: Sep 2015
College: Hard Knocks
Posts: 8
Default

Quote:
Originally Posted by examsarehard View Post
Not aware of any, but you could modify a k-means clustering algorithm to traverse a network graph if you really needed to enforce the contiguity constraint.
I recognize some of these words. Certainly there is a kmeans function in R(don't recall the package.)

But what do you mean by network graph?
Reply With Quote
  #5  
Old 01-04-2018, 04:51 PM
examsarehard examsarehard is offline
Member
CAS
 
Join Date: May 2011
Posts: 518
Default

Quote:
Originally Posted by Hari Seldon View Post
I recognize some of these words. Certainly there is a kmeans function in R(don't recall the package.)

But what do you mean by network graph?
If you use a normal clustering algorithm, you could group the zipcodes into territories, but there's no way to guarantee that the territories would be contiguous. You would need a dataset that tells you which zipcodes touch other zipcodes which could be represented as a graph:

https://en.wikipedia.org/wiki/Graph_...e_mathematics)

There are packages like iGraph that create clusters within graphs, but the algorithms are usually based on maximizing the number of connections between the nodes, and not on the variance of a weight such as loss cost.

You might be able to dig up some package or code for social networks that does something close enough to what you want. This problem doesn't seem that unique if you think about it.

But if you can't find anything and you aren't comfortable enough customizing your own algorithm, I would just run a regular clustering procedure on the loss costs and zipcode centroids, and hope the results are contiguous enough that you can just hand-tweak any outliers.
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


All times are GMT -4. The time now is 10:18 AM.


Powered by vBulletin®
Copyright ©2000 - 2018, Jelsoft Enterprises Ltd.
*PLEASE NOTE: Posts are not checked for accuracy, and do not
represent the views of the Actuarial Outpost or its sponsors.
Page generated in 0.27459 seconds with 11 queries