JMP 如何计算 AICc?你好。 我想知道 JMP 如何在分布平台或拟合删失函数中计算 AICc? 研究维基百科建议应该是这种格式:
AICc = 2k - 2*Ln(最大似然) + (2k^2 + 2k)/(n - k - 1)
其中 n = # 数据点,k = # 拟合参数。
然而,在这个话题还提供了另外 2 个不同的公式。
AICc2 = n*熔点(sse/n) + 2 *k + ( 2 *k^ 2 + 2 *k)/(n - k - 1 );
其中 sse 是数据与拟合分布之间残差的平方和
以及同一主题中的另一个公式:
AICc3 = n*熔点(sse/n) + (n*(n+k))/(nk- 2 );
我发现这些公式都不一致。 为了检查它们的一致性,我实现了这个脚本:
Names Default to Here(1);
dt = New Table("Test",
Add Rows(100),
New Column("Random Normal Data", Numeric,
Formula(Random Normal(0, 1))
)
);
dt << Run Formulas;
Wait(0.001);
:Random Normal Data << Suppress Eval; //So data doesn't change between computations.
//Compute AICc from Distribution platform
dist = dt << Distribution(Column("Random Normal Data"));
dist << 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 << 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);我的结果:
分销平台 AICc = +285
维基百科的公式 AICc = +5.51
AICc 后的公式 1 = -763
AICc 后的 Formula2 = -661
由于初始数据是根据随机函数生成的,因此您的结果可能会有所不同。 尽管如此,很明显这些公式都不与其他公式一致。 最重要的是,他们不认同发行平台给出的价值。
那么,有人知道Distribution平台是如何计算AICc的吗? 我需要这个,因为我已经开发了一些自己的发行版,并且我想将它们与 JMP 中现有的发行版进行比较。
FTR,在装有 Catalina 操作系统的 Mac 上使用 JMP Pro 15.2.1。
谢谢。
数据存取数据探索和可视化质量和工艺工程分享和交流结果回复:JMP 如何计算 AICc?似然度和SSE的计算不正确,因此第二、第三、第四个AICc也不正确。 第三个和第四个公式使用不同的惩罚近似值,因此不会同意。
请参阅这些当前公式,它们与维基百科中的文章一致。
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 << Distribution( Y( :Random Normal Data ) );
dist << Fit Distribution( Normal( Density Curve( 1 ) ) );
distr = dist << Report;
aiccFromDistribution = distr["Parameter Estimates"][Number Col Box( 4 )] << Get( 2 );
Show( aiccFromDistribution );
dist << Close Window;
// Compute AICc with Fit Least Squares platform
fit = dt << Fit Model(
Y( :Random Normal Data ),
Effects,
Personality( "Standard Least Squares" ),
Emphasis( "Minimal Report" ),
Run(
:Random Normal Data << {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 << Report;
aiccFromOLS = fitr["Summary of Fit"][NumberColBox(2)] << Get( 1 );
sse = fitr["Analysis of Variance"][NumberColBox(2)] << Get( 2 );
Show( aiccFromOLS );
fit << 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 );回复:JMP 如何计算 AICc?这是 AIC 帮助的直接链接,我可以通过选择 ? 来访问该帮助。工具,然后单击 AIC 表
AIC 帮助