你好,
我使用的是JMP pro 12。
我想知道,在神經網絡分析中如何從可能性中獲得AIC或BIC?
問候,
安傑洛
對不起,我很確定我是為神經網絡做的,但實際上是非線性平台。 這是代碼:
dt = Open("$SAMPLE_DATA/Nonlinear Examples/Chemical Kinetics.jmp");
fit = dt << Nonlinear(
Y( :Name( "Velocity (y)" ) ),
X( :Name( "Model (x)" ) ),
Newton,
Finish
);
rep = fit << Report;
matRmse = rep[NumberColBox(5)] << Get As Matrix;
/***************************************************
/ calculate AICc /
***************************************************/
// AIC = N.ln(SS/N) + 2k
// where N = # data points
// k = # parameters + 1
// SS = sum of squares for the residuals
// AICc = AIC + [ 2k(k+1) / (N-k-1) ]
N = NRows(dt);
nParameters = 2;
k = nParameters + 1;
rmse = matRmse[1];
dfSS = N - nParameters;
MS = rmse^2;
SS = dfSS * MS; // this is correct compared to fit model
LL = N*Log(2*Pi()*e()*SS/N);
AIC = LL + 2*k;
AICc = AIC + ( (2*k*(k+1))/(N-k-1) );
/***************************************************
/ calculate BIC /
***************************************************/
BIC = LL + k*Log(N);
在這段代碼中,我必須確定對數似然值,而神經網絡給你這樣,所以它應該更容易。 我想你只需要考慮k的價值是什麼。 我假設它將是1加上估計的權重數(對於單層網絡,它將是#factors x #nodes);
我有一些代碼,我可以與你分享這樣做 - 不幸的是我現在正在旅行 - 如果你沒有得到別人的回复,我將能夠在星期一發布。
有沒有一種方法可以從神經的快速列公式中獲取k?還是我必須知道如何創建模型?例如
Names default to here(1);
dt = open("$SAMPLE_DATA/Boston Housing.jmp");
nn = dt << Neural(
Y( :mvalue ),
X(
:crim,
:zn,
:indus,
:chas,
:nox,
:rooms,
:age,
:distance,
:radial,
:tax,
:pt,
:b,
:lstat
),
Informative Missing( 0 ),
Validation Method( "Holdback", 0.3333 ),
Fit( NTanH( 3 ), NLinear( 2 ), NLinear2( 1 ), NGaussian2( 1 ) )
);
nn << (Fit[1] << Save Fast Formulas);
pred = Column(dt, ncols(dt));
pred << Get Formula();
返回值:
T#1 = Matrix(
{{:crim, :zn, :indus, Design Nom( :chas, [0 1], <<ELSE missing=""></ELSE>
提前致謝。