<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: getting AIC/likelihood from model coefficients in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/getting-AIC-likelihood-from-model-coefficients/m-p/47437#M27057</link>
    <description>&lt;P&gt;&lt;SPAN&gt;Excuse me, do you have reference on "Deviance(null) - Deviance(fit) = 2(L(model)-L(null))"?&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;With&amp;nbsp;&amp;nbsp;2(L(model)-L(null) do you mean it's "&lt;EM&gt;2 log likelihood&lt;/EM&gt;" or "&lt;EM&gt;2 log (L0/L1)&lt;/EM&gt;"?&amp;nbsp; Shouldn't it be "&lt;EM&gt;-2 log likelihood"&lt;/EM&gt;, or the equation of&amp;nbsp;Deviance(null) - Deviance(fit)&amp;nbsp;ignore the negative (-) sign?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Sorry for the rapid question.&lt;/SPAN&gt;&lt;/P&gt;</description>
    <pubDate>Tue, 21 Nov 2017 06:20:35 GMT</pubDate>
    <dc:creator>hafidwr</dc:creator>
    <dc:date>2017-11-21T06:20:35Z</dc:date>
    <item>
      <title>getting AIC/likelihood from model coefficients</title>
      <link>https://community.jmp.com/t5/Discussions/getting-AIC-likelihood-from-model-coefficients/m-p/31056#M19670</link>
      <description>&lt;P&gt;Maybe a bit off topic, but:&lt;/P&gt;
&lt;P&gt;I'm getting a model from R GLMNet (a general regression elastic net package, because the customer won't upgrade from JMP 10) and I need to calculate the AIC. &amp;nbsp;This package doesn't seem to give me likelihood. &amp;nbsp;So ... is it possible to calculate the max likelihood from the coefficients? The model is made using the max likelihood so I'm hoping that there is some way to pull this information if I have the chosen model. &amp;nbsp;It probably isn't, but I'm grasping at straws right now. &amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 01 Dec 2016 21:41:28 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/getting-AIC-likelihood-from-model-coefficients/m-p/31056#M19670</guid>
      <dc:creator>vince_faller</dc:creator>
      <dc:date>2016-12-01T21:41:28Z</dc:date>
    </item>
    <item>
      <title>Re: getting AIC/likelihood from model coefficients</title>
      <link>https://community.jmp.com/t5/Discussions/getting-AIC-likelihood-from-model-coefficients/m-p/31090#M19681</link>
      <description>&lt;P&gt;The R glmnet package manual provides these details:&lt;/P&gt;
&lt;P&gt;"&lt;EM&gt;A glmnet object has components dev.ratio and nulldev. The former is the fraction of (null) deviance explained. The deviance calculations incorporate weights if present in the model. The deviance is defined to be 2*(loglike_sat - loglike), where loglike_sat is the log-likelihood for the saturated model (a model with a free parameter per observation). Null deviance is defined to be 2*(loglike_sat -loglike(Null)); The NULL model refers to the intercept model, except for the Cox, where it is the 0 model. Hence dev.ratio=1-deviance/nulldev, and this deviance method returns (1-dev.ratio)*nulldev.&lt;/EM&gt;"&lt;/P&gt;
&lt;P&gt;This information is intended to be used to assess goodness of fit.&lt;/P&gt;</description>
      <pubDate>Fri, 02 Dec 2016 13:29:19 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/getting-AIC-likelihood-from-model-coefficients/m-p/31090#M19681</guid>
      <dc:creator>Mark_Bailey</dc:creator>
      <dc:date>2016-12-02T13:29:19Z</dc:date>
    </item>
    <item>
      <title>Re: getting AIC/likelihood from model coefficients</title>
      <link>https://community.jmp.com/t5/Discussions/getting-AIC-likelihood-from-model-coefficients/m-p/31117#M19696</link>
      <description>&lt;P&gt;So just so I'm making sure I have this correct. &amp;nbsp;&lt;/P&gt;
&lt;P&gt;deviance = (1-dev.ratio)*nulldev&lt;/P&gt;
&lt;P&gt;and this deviance would be the exact same as the -2LogLikelihood in the AICc equation?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="AICc.png" style="width: 468px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/4238i1F2653C959CE3F5A/image-size/large?v=v2&amp;amp;px=999" role="button" title="AICc.png" alt="AICc.png" /&gt;&lt;/span&gt;﻿&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;This could make my life MUCH better. &amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 02 Dec 2016 20:43:05 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/getting-AIC-likelihood-from-model-coefficients/m-p/31117#M19696</guid>
      <dc:creator>vince_faller</dc:creator>
      <dc:date>2016-12-02T20:43:05Z</dc:date>
    </item>
    <item>
      <title>Re: getting AIC/likelihood from model coefficients</title>
      <link>https://community.jmp.com/t5/Discussions/getting-AIC-likelihood-from-model-coefficients/m-p/31122#M19701</link>
      <description>&lt;P&gt;I'm afraid that the two quantities&amp;nbsp;available from the &lt;STRONG&gt;glmnet&lt;/STRONG&gt; object (&lt;STRONG&gt;dev.ratio&lt;/STRONG&gt;, &lt;STRONG&gt;nulldev&lt;/STRONG&gt;) are not enough to obtain the likelihood for the model, which you need to compute AICc. You have two equations&amp;nbsp;in&amp;nbsp;three unknowns: likelihood(null), likelihood(model), and likelihood(saturated). I can't get the likelihood(model) free from the likelihood(null).&lt;/P&gt;</description>
      <pubDate>Fri, 02 Dec 2016 21:56:21 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/getting-AIC-likelihood-from-model-coefficients/m-p/31122#M19701</guid>
      <dc:creator>Mark_Bailey</dc:creator>
      <dc:date>2016-12-02T21:56:21Z</dc:date>
    </item>
    <item>
      <title>Re: getting AIC/likelihood from model coefficients</title>
      <link>https://community.jmp.com/t5/Discussions/getting-AIC-likelihood-from-model-coefficients/m-p/31123#M19702</link>
      <description>&lt;P&gt;The deviance is a measure of the lack of fit. It is not the likelihood of&amp;nbsp;the model but twice the difference between&amp;nbsp;likelihoods of the saturated model and your model.&lt;/P&gt;</description>
      <pubDate>Fri, 02 Dec 2016 21:58:10 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/getting-AIC-likelihood-from-model-coefficients/m-p/31123#M19702</guid>
      <dc:creator>Mark_Bailey</dc:creator>
      <dc:date>2016-12-02T21:58:10Z</dc:date>
    </item>
    <item>
      <title>Re: getting AIC/likelihood from model coefficients</title>
      <link>https://community.jmp.com/t5/Discussions/getting-AIC-likelihood-from-model-coefficients/m-p/31124#M19703</link>
      <description>&lt;P&gt;Well thanks for trying either way. &amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 02 Dec 2016 21:58:25 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/getting-AIC-likelihood-from-model-coefficients/m-p/31124#M19703</guid>
      <dc:creator>vince_faller</dc:creator>
      <dc:date>2016-12-02T21:58:25Z</dc:date>
    </item>
    <item>
      <title>Re: getting AIC/likelihood from model coefficients</title>
      <link>https://community.jmp.com/t5/Discussions/getting-AIC-likelihood-from-model-coefficients/m-p/31142#M19711</link>
      <description>&lt;P&gt;You might be able to get the likelihood of the model after all.&lt;/P&gt;
&lt;P&gt;Fit the null model (no terms except the intercept) and save the glmnet object&amp;nbsp;as &lt;FONT face="courier new,courier"&gt;fit0&lt;/FONT&gt;. Fit the desired model and save it as &lt;FONT face="courier new,courier"&gt;fit1&lt;/FONT&gt;. Get the deviance for both, that is &lt;FONT face="courier new,courier"&gt;dev0=deviance(fit0)&lt;/FONT&gt; and &lt;FONT face="courier new,courier"&gt;dev1=deviance(fit1)&lt;/FONT&gt;. The deviance is 2(L(saturated)-L(model)), so now you have two equations and two unknown likelihoods. The L(saturated) is common and drops out. One of the components of the &lt;FONT face="courier new,courier"&gt;fit0&lt;/FONT&gt; and &lt;FONT face="courier new,courier"&gt;fit1&lt;/FONT&gt; objects if the null deviance (&lt;FONT face="courier new,courier"&gt;nulldev&lt;/FONT&gt;) to help.&lt;/P&gt;
&lt;P&gt;So you were correct earlier. That is, you can use the deviance (somewhat) directly for computing AICc. Deviance(null) - Deviance(fit) = 2(L(model)-L(null)). The L(null) is just a constant offset so the difference in deviance is a substitute for 2L(model). Hope this helps!&lt;/P&gt;
&lt;P&gt;BTW, the package provides the deviance ratio as a measure of goodness of fit. I know that is not the same as using AICc to select the best model. Rather like using R square (bad idea).&lt;/P&gt;</description>
      <pubDate>Mon, 05 Dec 2016 14:12:42 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/getting-AIC-likelihood-from-model-coefficients/m-p/31142#M19711</guid>
      <dc:creator>Mark_Bailey</dc:creator>
      <dc:date>2016-12-05T14:12:42Z</dc:date>
    </item>
    <item>
      <title>Re: getting AIC/likelihood from model coefficients</title>
      <link>https://community.jmp.com/t5/Discussions/getting-AIC-likelihood-from-model-coefficients/m-p/31193#M19738</link>
      <description>&lt;P&gt;Thanks for helping with this (On Saturday no less). &amp;nbsp;Just so I'm clear, If I do the steps below, I should get something proportional to JMPs AIC?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default to here(1);

k =[0, 1, 1, 2, 2];
n=500;
nulldev = 1100;
devs = [1100, 1099, 1098, 1097, 1096]; //calculated from (1-dev.ratio)*nulldev
fake2L = nulldev-devs;
AIC = -fake2L+2*k+2*k:*(k+1):/(n-k-1);&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;*Edit* changed AIC to be correct&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 05 Dec 2016 20:40:33 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/getting-AIC-likelihood-from-model-coefficients/m-p/31193#M19738</guid>
      <dc:creator>vince_faller</dc:creator>
      <dc:date>2016-12-05T20:40:33Z</dc:date>
    </item>
    <item>
      <title>Re: getting AIC/likelihood from model coefficients</title>
      <link>https://community.jmp.com/t5/Discussions/getting-AIC-likelihood-from-model-coefficients/m-p/31195#M19740</link>
      <description>&lt;P&gt;The first term in the equation should be negative. As the deviance decreases, AICc should get better (smaller).&lt;/P&gt;</description>
      <pubDate>Mon, 05 Dec 2016 19:49:47 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/getting-AIC-likelihood-from-model-coefficients/m-p/31195#M19740</guid>
      <dc:creator>Mark_Bailey</dc:creator>
      <dc:date>2016-12-05T19:49:47Z</dc:date>
    </item>
    <item>
      <title>Re: getting AIC/likelihood from model coefficients</title>
      <link>https://community.jmp.com/t5/Discussions/getting-AIC-likelihood-from-model-coefficients/m-p/47436#M27056</link>
      <description>&lt;P&gt;Excuse me, where is the reference stating that "D&lt;SPAN&gt;eviance(null) - Deviance(fit) = 2(L(model)-L(null))"?&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Also, did you mean 2L(model) is 2 log likelihood? or the&amp;nbsp;2(L(model)-L(null) is the 2 log likelihood?&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 21 Nov 2017 05:56:52 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/getting-AIC-likelihood-from-model-coefficients/m-p/47436#M27056</guid>
      <dc:creator>hafidwr</dc:creator>
      <dc:date>2017-11-21T05:56:52Z</dc:date>
    </item>
    <item>
      <title>Re: getting AIC/likelihood from model coefficients</title>
      <link>https://community.jmp.com/t5/Discussions/getting-AIC-likelihood-from-model-coefficients/m-p/47437#M27057</link>
      <description>&lt;P&gt;&lt;SPAN&gt;Excuse me, do you have reference on "Deviance(null) - Deviance(fit) = 2(L(model)-L(null))"?&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;With&amp;nbsp;&amp;nbsp;2(L(model)-L(null) do you mean it's "&lt;EM&gt;2 log likelihood&lt;/EM&gt;" or "&lt;EM&gt;2 log (L0/L1)&lt;/EM&gt;"?&amp;nbsp; Shouldn't it be "&lt;EM&gt;-2 log likelihood"&lt;/EM&gt;, or the equation of&amp;nbsp;Deviance(null) - Deviance(fit)&amp;nbsp;ignore the negative (-) sign?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Sorry for the rapid question.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 21 Nov 2017 06:20:35 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/getting-AIC-likelihood-from-model-coefficients/m-p/47437#M27057</guid>
      <dc:creator>hafidwr</dc:creator>
      <dc:date>2017-11-21T06:20:35Z</dc:date>
    </item>
  </channel>
</rss>

