<?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 How does JMP compute AICc? in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/How-does-JMP-compute-AICc/m-p/377679#M62754</link>
    <description>&lt;P&gt;Hi. &amp;nbsp;I'd like to know how JMP computes AICc in the Distribution platform, or in the Fit Censored function? Research on &lt;A href="https://en.wikipedia.org/wiki/Akaike_information_criterion" target="_self"&gt;wiki&lt;/A&gt;&amp;nbsp;suggests it should be this format:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;AICc = 2k - 2*Ln(maxlikelihood) + (2k^2 + 2k)/(n - k - 1)&lt;/P&gt;&lt;P&gt;where n = # datapoint, k = # fit parameters.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;However, in this &lt;A href="https://community.jmp.com/t5/Discussions/how-do-you-get-an-r2-and-AICc-value-for-a-custom-nonlinear/m-p/187375/highlight/true#M40622" target="_self"&gt;topic&lt;/A&gt;&amp;nbsp;another 2 different formulas are provided. &amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;AICc2 = n*&lt;SPAN&gt;Ln&lt;/SPAN&gt;(sse/n) + &lt;SPAN&gt;2&lt;/SPAN&gt;*k + (&lt;SPAN&gt;2&lt;/SPAN&gt;*k^&lt;SPAN&gt;2&lt;/SPAN&gt; + &lt;SPAN&gt;2&lt;/SPAN&gt;*k)/(n - k - &lt;SPAN&gt;1&lt;/SPAN&gt;);&lt;/P&gt;&lt;P&gt;where sse is the sum of the squares of there residuals between the data and the fitted distribution&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;And the other formula in the same topic:&lt;/P&gt;&lt;P&gt;AICc3 = n*&lt;SPAN&gt;Ln&lt;/SPAN&gt;(sse/n) + (n*(n+k))/(n-k-&lt;SPAN&gt;2&lt;/SPAN&gt;);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I've found none of these formulas to agree with each other. &amp;nbsp;To check their consistency, I implemented this script:&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default to Here(1);

dt = New Table("Test", 
	Add Rows(100),
	New Column("Random Normal Data", Numeric,
		Formula(Random Normal(0, 1))
	)
);
dt &amp;lt;&amp;lt; Run Formulas;
Wait(0.001);
:Random Normal Data &amp;lt;&amp;lt; Suppress Eval;		//So data doesn't change between computations.

//Compute AICc from Distribution platform
dist = dt &amp;lt;&amp;lt; Distribution(Column("Random Normal Data"));
dist &amp;lt;&amp;lt; Fit Distribution(Normal(Density Curve(1)));				//AICc = +285

//Independently compute AICc using method described here: https://en.wikipedia.org/wiki/Akaike_information_criterion
x_vec = :Random Normal Data &amp;lt;&amp;lt; Get Values;
mu = Mean(x_vec);
sig = Stddev(x_vec);
maxlikelihood = Normal Distribution(mu, mu, sig);		//e.g. 0.5
k=2;
n=100;
aicc1 = 2*k - 2*Ln(maxlikelihood) + (2*k^2 + 2*k)/(n - k - 1);	//AICc = +5.51
Show(aicc1);

//Independently compute AICc using method described in JMP Forum: https://community.jmp.com/t5/Discussions/how-do-you-get-an-r2-and-AICc-value-for-a-custom-nonlinear/m-p/187375/highlight/true#M40622
ord = Rank(x_vec);
xsort = x_vec[ord];
p_vec = (1::n)`/n;
sse = SSQ(p_vec - Normal Distribution(xsort, mu, sig));
aicc2 = n*Ln(sse/n) + 2*k + (2*k^2 + 2*k)/(n - k - 1);			//AICc = -763
Show(aicc2);

//Independently compute AICc using Other method described in JMP Forum: https://community.jmp.com/t5/Discussions/how-do-you-get-an-r2-and-AICc-value-for-a-custom-nonlinear/m-p/9715
aicc3 = n*Ln(sse/n) + (n*(n+k))/(n-k-2);						//AICc = -661
Show(aicc3);&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;My results:&lt;/P&gt;&lt;P&gt;Distribution Platform AICc = +285&lt;/P&gt;&lt;P&gt;Formula from wiki AICc = +5.51&lt;/P&gt;&lt;P&gt;Fomula1 in post AICc = -763&lt;/P&gt;&lt;P&gt;Formula2 in post AICc = -661&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Since the initial data is generated from a random function, your results may vary somewhat. &amp;nbsp;Nonetheless, it should be apparent that none of these formulas agrees with any other. &amp;nbsp;Most importantly, they do not agree with the value given in the distribution platform. &amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So, does anyone know how the Distribution platform computes AICc? &amp;nbsp;I need this because I've developed some of my own distributions and I'd like to compare these to those existing in JMP.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;FTR, using JMP Pro 15.2.1 on a Mac with Catalina OS.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;</description>
    <pubDate>Fri, 09 Jun 2023 22:11:17 GMT</pubDate>
    <dc:creator>nikles</dc:creator>
    <dc:date>2023-06-09T22:11:17Z</dc:date>
    <item>
      <title>How does JMP compute AICc?</title>
      <link>https://community.jmp.com/t5/Discussions/How-does-JMP-compute-AICc/m-p/377679#M62754</link>
      <description>&lt;P&gt;Hi. &amp;nbsp;I'd like to know how JMP computes AICc in the Distribution platform, or in the Fit Censored function? Research on &lt;A href="https://en.wikipedia.org/wiki/Akaike_information_criterion" target="_self"&gt;wiki&lt;/A&gt;&amp;nbsp;suggests it should be this format:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;AICc = 2k - 2*Ln(maxlikelihood) + (2k^2 + 2k)/(n - k - 1)&lt;/P&gt;&lt;P&gt;where n = # datapoint, k = # fit parameters.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;However, in this &lt;A href="https://community.jmp.com/t5/Discussions/how-do-you-get-an-r2-and-AICc-value-for-a-custom-nonlinear/m-p/187375/highlight/true#M40622" target="_self"&gt;topic&lt;/A&gt;&amp;nbsp;another 2 different formulas are provided. &amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;AICc2 = n*&lt;SPAN&gt;Ln&lt;/SPAN&gt;(sse/n) + &lt;SPAN&gt;2&lt;/SPAN&gt;*k + (&lt;SPAN&gt;2&lt;/SPAN&gt;*k^&lt;SPAN&gt;2&lt;/SPAN&gt; + &lt;SPAN&gt;2&lt;/SPAN&gt;*k)/(n - k - &lt;SPAN&gt;1&lt;/SPAN&gt;);&lt;/P&gt;&lt;P&gt;where sse is the sum of the squares of there residuals between the data and the fitted distribution&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;And the other formula in the same topic:&lt;/P&gt;&lt;P&gt;AICc3 = n*&lt;SPAN&gt;Ln&lt;/SPAN&gt;(sse/n) + (n*(n+k))/(n-k-&lt;SPAN&gt;2&lt;/SPAN&gt;);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I've found none of these formulas to agree with each other. &amp;nbsp;To check their consistency, I implemented this script:&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default to Here(1);

dt = New Table("Test", 
	Add Rows(100),
	New Column("Random Normal Data", Numeric,
		Formula(Random Normal(0, 1))
	)
);
dt &amp;lt;&amp;lt; Run Formulas;
Wait(0.001);
:Random Normal Data &amp;lt;&amp;lt; Suppress Eval;		//So data doesn't change between computations.

//Compute AICc from Distribution platform
dist = dt &amp;lt;&amp;lt; Distribution(Column("Random Normal Data"));
dist &amp;lt;&amp;lt; Fit Distribution(Normal(Density Curve(1)));				//AICc = +285

//Independently compute AICc using method described here: https://en.wikipedia.org/wiki/Akaike_information_criterion
x_vec = :Random Normal Data &amp;lt;&amp;lt; Get Values;
mu = Mean(x_vec);
sig = Stddev(x_vec);
maxlikelihood = Normal Distribution(mu, mu, sig);		//e.g. 0.5
k=2;
n=100;
aicc1 = 2*k - 2*Ln(maxlikelihood) + (2*k^2 + 2*k)/(n - k - 1);	//AICc = +5.51
Show(aicc1);

//Independently compute AICc using method described in JMP Forum: https://community.jmp.com/t5/Discussions/how-do-you-get-an-r2-and-AICc-value-for-a-custom-nonlinear/m-p/187375/highlight/true#M40622
ord = Rank(x_vec);
xsort = x_vec[ord];
p_vec = (1::n)`/n;
sse = SSQ(p_vec - Normal Distribution(xsort, mu, sig));
aicc2 = n*Ln(sse/n) + 2*k + (2*k^2 + 2*k)/(n - k - 1);			//AICc = -763
Show(aicc2);

//Independently compute AICc using Other method described in JMP Forum: https://community.jmp.com/t5/Discussions/how-do-you-get-an-r2-and-AICc-value-for-a-custom-nonlinear/m-p/9715
aicc3 = n*Ln(sse/n) + (n*(n+k))/(n-k-2);						//AICc = -661
Show(aicc3);&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;My results:&lt;/P&gt;&lt;P&gt;Distribution Platform AICc = +285&lt;/P&gt;&lt;P&gt;Formula from wiki AICc = +5.51&lt;/P&gt;&lt;P&gt;Fomula1 in post AICc = -763&lt;/P&gt;&lt;P&gt;Formula2 in post AICc = -661&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Since the initial data is generated from a random function, your results may vary somewhat. &amp;nbsp;Nonetheless, it should be apparent that none of these formulas agrees with any other. &amp;nbsp;Most importantly, they do not agree with the value given in the distribution platform. &amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So, does anyone know how the Distribution platform computes AICc? &amp;nbsp;I need this because I've developed some of my own distributions and I'd like to compare these to those existing in JMP.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;FTR, using JMP Pro 15.2.1 on a Mac with Catalina OS.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;</description>
      <pubDate>Fri, 09 Jun 2023 22:11:17 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-does-JMP-compute-AICc/m-p/377679#M62754</guid>
      <dc:creator>nikles</dc:creator>
      <dc:date>2023-06-09T22:11:17Z</dc:date>
    </item>
    <item>
      <title>Re: How does JMP compute AICc?</title>
      <link>https://community.jmp.com/t5/Discussions/How-does-JMP-compute-AICc/m-p/377686#M62755</link>
      <description>&lt;P&gt;Here is the direct link to the Help on AIC which I got to by selecting the ? tool and then clicking on the AIC table&lt;/P&gt;
&lt;P&gt;&lt;A href="https://www.jmp.com/support/help/en/15.2/#page/jmp/statistical-details-for-continuous-fit-distributions-legacy.shtml#ww1685917" target="_self"&gt;The AIC Help&lt;/A&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 19 Apr 2021 03:55:52 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-does-JMP-compute-AICc/m-p/377686#M62755</guid>
      <dc:creator>txnelson</dc:creator>
      <dc:date>2021-04-19T03:55:52Z</dc:date>
    </item>
    <item>
      <title>Re: How does JMP compute AICc?</title>
      <link>https://community.jmp.com/t5/Discussions/How-does-JMP-compute-AICc/m-p/378440#M62819</link>
      <description>&lt;P&gt;The calculation of likelihood and SSE are incorrect, so the second, third, and fourth AICc are also incorrect. The third and fourth formulas use different approximations of the penalty, so will not agree.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Please see these current formulas, which agree with the article in Wikipedia.&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 );

n = 100;

Random Reset( 27513 );
y = J( n, 1, Random Normal() );

dt = New Table( "Test AICc Formula", New Column( "Random Normal Data", Numeric, Continuous, Values( y ) ) );

// Compute AICc with Distribution platform
dist = dt &amp;lt;&amp;lt; Distribution( Y( :Random Normal Data ) );
dist &amp;lt;&amp;lt; Fit Distribution( Normal( Density Curve( 1 ) ) );
distr = dist &amp;lt;&amp;lt; Report;
aiccFromDistribution = distr["Parameter Estimates"][Number Col Box( 4 )] &amp;lt;&amp;lt; Get( 2 );
Show( aiccFromDistribution );
dist &amp;lt;&amp;lt; Close Window;

// Compute AICc with Fit Least Squares platform
fit = dt &amp;lt;&amp;lt; Fit Model(
	Y( :Random Normal Data ),
	Effects,
	Personality( "Standard Least Squares" ),
	Emphasis( "Minimal Report" ),
	Run(
		:Random Normal Data &amp;lt;&amp;lt; {Summary of Fit( 1 ), Analysis of Variance( 1 ),
		Parameter Estimates( 1 ), Lack of Fit( 0 ), Scaled Estimates( 0 ),
		Plot Actual by Predicted( 0 ), Plot Regression( 0 ),
		Plot Residual by Predicted( 0 ), Plot Studentized Residuals( 0 ),
		Plot Effect Leverage( 0 ), Plot Residual by Normal Quantiles( 0 ),
		Box Cox Y Transformation( 0 ), AICc( 1 )}
	)
);
fitr = fit &amp;lt;&amp;lt; Report;
aiccFromOLS = fitr["Summary of Fit"][NumberColBox(2)] &amp;lt;&amp;lt; Get( 1 );
sse = fitr["Analysis of Variance"][NumberColBox(2)] &amp;lt;&amp;lt; Get( 2 );
Show( aiccFromOLS );
fit &amp;lt;&amp;lt; Close Window;

// Compute AICc using method described in JMP Help (https://www.jmp.com/support/help/en/16.0/#page/jmp/likelihood-aicc-and-bic.shtml#ww293087)
loglikelihood = Summation( i = 1, n, Log( Normal Density( y[i] ) ) );
k = 2;
aiccFromHelp = -2*loglikelihood + 2*k + (2*k*(k+1)/(n-(k+1)));
Show( aiccFromHelp );

//Independently compute AICc using method described in JMP Forum: https://community.jmp.com/t5/Discussions/how-do-you-get-an-r2-and-AICc-value-for-a-custom-nonlinear/m-p/187375/highlight/true#M40622
sse = Sum( (y - Mean( y )) ^ 2 );
aiccFromForum = n*Log( sse/n ) + 2*k + (2*k*(k+1)/(n-(k+1))) + n*Log( 2*Pi() ) + n;
Show( aiccFromForum );&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 20 Apr 2021 17:33:17 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-does-JMP-compute-AICc/m-p/378440#M62819</guid>
      <dc:creator>Mark_Bailey</dc:creator>
      <dc:date>2021-04-20T17:33:17Z</dc:date>
    </item>
  </channel>
</rss>

