Actuarial Outpost
 
Go Back   Actuarial Outpost > Exams - Please Limit Discussion to Exam-Related Topics > SoA/CAS Preliminary Exams > Exam PA: Predictive Analytics
FlashChat Actuarial Discussion Preliminary Exams CAS/SOA Exams Cyberchat Around the World Suggestions



Reply
 
Thread Tools Search this Thread Display Modes
  #201  
Old 05-16-2019, 04:50 PM
Josh Peck Josh Peck is offline
Member
SOA
 
Join Date: Dec 2016
College: Towson University
Posts: 99
Default

I sat for the December sitting, scored very high on the analytics portion, but very low on the writing portion, and barley failed overall.

I'm pretty upset they just changed the format of the exam because I thought I would have any easy pass this time just by reviewing the material and copying their writing format for the December sitting.

It still doesn't seem like it should be too bad, but I'm just about done reviewing and I'll probably be checking this forum regularly now.

Whaddup everyone

Also, I'm not sure anyone posted this yet, but it was in the Decmber thread and helped me a lot
https://www.r-bloggers.com/in-depth-...expert-videos/
__________________
P FM MFE C PA

Last edited by Josh Peck; 05-16-2019 at 04:54 PM..
Reply With Quote
  #202  
Old 05-16-2019, 07:02 PM
lindy3730's Avatar
lindy3730 lindy3730 is offline
Member
SOA
 
Join Date: Oct 2016
Location: Los Angeles
Studying for FA
College: UC Berkeley
Posts: 58
Default

Quote:
Originally Posted by Josh Peck View Post
I sat for the December sitting, scored very high on the analytics portion, but very low on the writing portion, and barley failed overall.

I'm pretty upset they just changed the format of the exam because I thought I would have any easy pass this time just by reviewing the material and copying their writing format for the December sitting.

It still doesn't seem like it should be too bad, but I'm just about done reviewing and I'll probably be checking this forum regularly now.

Whaddup everyone

Also, I'm not sure anyone posted this yet, but it was in the Decmber thread and helped me a lot
https://www.r-bloggers.com/in-depth-...expert-videos/

Thanks for sharing! Gotta look into these videos after I get more familiar with module materials
__________________
__________________
Prelims: P FM MFE MLC C PA
VEE: Statistics Economics Finance
APC

FAP: 1 2 3 4 IA 6 7 FA
Reply With Quote
  #203  
Old 05-17-2019, 02:56 PM
Squeenasaurus Squeenasaurus is offline
Member
SOA
 
Join Date: Jul 2016
College: Illinois State University
Favorite beer: Lagunitas
Posts: 185
Default

A couple things I was hoping to get some input on. Does anyone have a good way to check the residuals for a glmnet object? For a glm object all you have to do is plot(glm) and you'll get four model diagnostic plots. Any way to do a similar thing for a regularized regression model?

The only solution I can think of is to create a glm using the exact same features and coefficients as the glmnet model. Though any other easier ways to do this would be appreciated.

Also on the topic of regularized regression, the family choices for a glmnet object don't include any positivite-continuous distributions such as Gamma. What options do we have for making a regularized GLM with something like a Gamma distribution + log link?

Last edited by Squeenasaurus; 05-17-2019 at 03:13 PM..
Reply With Quote
  #204  
Old 05-17-2019, 04:04 PM
midwesterner midwesterner is offline
SOA
 
Join Date: Apr 2019
College: UVA
Posts: 21
Default

Quote:
Originally Posted by Squeenasaurus View Post
A couple things I was hoping to get some input on. Does anyone have a good way to check the residuals for a glmnet object? For a glm object all you have to do is plot(glm) and you'll get four model diagnostic plots. Any way to do a similar thing for a regularized regression model?

The only solution I can think of is to create a glm using the exact same features and coefficients as the glmnet model. Though any other easier ways to do this would be appreciated.

Also on the topic of regularized regression, the family choices for a glmnet object don't include any positivite-continuous distributions such as Gamma. What options do we have for making a regularized GLM with something like a Gamma distribution + log link?
For glmnet, simply set y= log(target) to force a log-link function. You can't set your distribution to gamma, but applying a gaussian assumption to your distribution given an X observation, and forcing a log link, will imply that your actual y value has nonconstant variance (the log has constant variance of normal errors, so the exponential will have growing variance).

This is a proxy to get to your gamma distribution, but not exactly perfect. It's the best you can do with the glmnet() function, and certainly will be good enough in the context of the exam.
Reply With Quote
  #205  
Old 05-17-2019, 04:06 PM
midwesterner midwesterner is offline
SOA
 
Join Date: Apr 2019
College: UVA
Posts: 21
Default

Quote:
Originally Posted by Squeenasaurus View Post
A couple things I was hoping to get some input on. Does anyone have a good way to check the residuals for a glmnet object? For a glm object all you have to do is plot(glm) and you'll get four model diagnostic plots. Any way to do a similar thing for a regularized regression model?

The only solution I can think of is to create a glm using the exact same features and coefficients as the glmnet model. Though any other easier ways to do this would be appreciated.

Also on the topic of regularized regression, the family choices for a glmnet object don't include any positivite-continuous distributions such as Gamma. What options do we have for making a regularized GLM with something like a Gamma distribution + log link?
In terms of checking the plot(glmnet), simply set a glm with the same variables and plot that. You won't have the exact same coefficients, but it's certainly sufficient to check if something is blatantly off.
Reply With Quote
  #206  
Old 05-17-2019, 04:38 PM
Squeenasaurus Squeenasaurus is offline
Member
SOA
 
Join Date: Jul 2016
College: Illinois State University
Favorite beer: Lagunitas
Posts: 185
Default

Quote:
Originally Posted by midwesterner View Post
For glmnet, simply set y= log(target) to force a log-link function.
I don't agree with this. Modeling a log-transformed target variable is not the same as giving the model a log link function.
Reply With Quote
  #207  
Old 05-17-2019, 04:50 PM
RiskyBusiness7 RiskyBusiness7 is offline
Member
SOA
 
Join Date: Apr 2018
Posts: 53
Default

Quote:
Originally Posted by Squeenasaurus View Post
I don't agree with this. Modeling a log-transformed target variable is not the same as giving the model a log link function.
can anyone give a description of what a link function is in layman's terms? not getting the difference between that and a transformation.
Reply With Quote
  #208  
Old 05-17-2019, 05:09 PM
midwesterner midwesterner is offline
SOA
 
Join Date: Apr 2019
College: UVA
Posts: 21
Default

Quote:
Originally Posted by Squeenasaurus View Post
I don't agree with this. Modeling a log-transformed target variable is not the same as giving the model a log link function.
A log link function implies that given a series of predictors, your target variable follows a distribution function of your family with mean of e^{XB}.

Modeling a log(target) implies that ln(target) has a mean of XB with a distribution of your family function.

You are right that E[f(x)] =/= f(E[x]). So they are not the same. But in the context of glmnet(), I am not sure a better approach exists.

Last edited by midwesterner; 05-17-2019 at 05:26 PM..
Reply With Quote
  #209  
Old 05-17-2019, 06:34 PM
Squeenasaurus Squeenasaurus is offline
Member
SOA
 
Join Date: Jul 2016
College: Illinois State University
Favorite beer: Lagunitas
Posts: 185
Default

Quote:
Originally Posted by RiskyBusiness7 View Post
can anyone give a description of what a link function is in layman's terms? not getting the difference between that and a transformation.
Let's say you have a GLM with a Normal distribution and a log link function. That's essentially saying:

Y ~ Normal(mu, sigma)

The link function comes into play by specifying a relationship the mean of this distribution has with the predictor variables.

ln[E(Y)] = B0 + B1*X1 + ... + Bp*Xp + error
or
E(Y) = mu = e^(B0 + B1*X1 + ... + Bp*Xp + error)

Notice how this says the expected value will always be positive but it places no restriction on the actual Y values. They can still be negative because it is normally distributed.


Now let's say you have a OLS linear model (AKA a GLM with a Normal distribution and identity link function) but you log-transformed the target variable instead. This is saying:

ln(Y) ~ Normal(mu, sigma)

The link function is the identity so its simply saying:

E[ln(Y)] = mu = B0 + B1*X1 + ... + Bp*Xp + error

Notice how here we are saying the actual Y values must always be positive. If you look closely, Y actually follows a LogNormal distribution. This will then also always produce positive expected values for Y.


In short, they are not the same because E[ln(Y)] != ln[E(Y)]
Reply With Quote
  #210  
Old 05-19-2019, 11:12 AM
Gettin Lucky In Kentucky Gettin Lucky In Kentucky is offline
Member
SOA
 
Join Date: Apr 2018
Location: Louisville Ky
Studying for Specialty
College: Eastern Kentucky University Graduate
Posts: 32
Default GLM Functions

Does anyone know where I can get a good summary of the different distributions and link functions associated with a GLM? In the new sample problem I was able to pick the Logit and Probit link functions as appropriate but really wasnt able to expound upon why. I dont think the modules go into very good detail on these topics.
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
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 12:41 AM.


Powered by vBulletin®
Copyright ©2000 - 2020, 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.23314 seconds with 12 queries