# How to find maximum likelihood in glmnet and comparing AIC?

I need to find AIC for my multinomial logistic regression analysis. I applied lasso method in r using the glmnet package. Unfortunately, I have no idea how to find the "-2 log likelihood" value of my model.

As we know, AIC = 2k - 2 ln(L) . So I need to know the value of -2ln(L) which is a the "- 2 log likelihood" I was after. But I can't find function in glmnet that leads to maximum likelihood. So the thing is, I tried to compare the AICs between two methods: common maximum likelihood estimation(MLE) and lasso. My MLE's AIC is 3140,812. I only need the AIC from Lasso Method.

I recently found a similar question in this particular question: Is it possible to calculate AIC and BIC for lasso regression models?

But, I wasn't clear about the "tLL" variable, which is found in the code mentioned in the latest answer because I got a negative value of AIC using that code. Is that possible for AIC having negative value? Or, the AICs of lasso are always negative?

So if anyone could help me (better if you have code), I'll really appreciate.

• AIC's (whether for LASSO or not) are often negative but don't have to be. – Glen_b Nov 21 '17 at 5:41
• Alright, thank you. So if I compare positive with negative AIC, is it OK? – Hafid W. Ramadhan Nov 21 '17 at 5:58
• there's no difficulty in identifying that an AIC of -4 is less than an AIC of 3. – Glen_b Nov 21 '17 at 6:51