Class for penalty function 4 for AIC. More...
Public Member Functions | |
PenAIC4 (double cc) | |
cxsc::real | operator() (const AdaptiveHistogram *const adh, int deltaLeaf) const |
the penalty function. |
Class for penalty function 4 for AIC.
Penalty is just some multiple of logCatK. Should have c = 0.5 to stop splitting on one point with AIC EMP, or with c=2, penalty before taking logs is (CatK)^2).
real subpavings::PenAIC4::operator() | ( | const AdaptiveHistogram *const | adh, |
int | deltaLeaf | ||
) | const [virtual] |
the penalty function.
adh | is the histogram object to calculate the penalty on. |
deltaLeaf | change in number leaves to take into account. |
Implements subpavings::PenObj.
{ dotprecision penalty(0.0); int k = adh->getRootLeaves() + deltaLeaf - 1; // leaves-1 double logCatk= lCk(k); accumulate(penalty, c, logCatk); // pen = c*logCatk return (rnd(penalty)); // return c*logCatk }