Class for penalty function 5 for AIC. More...
Public Member Functions | |
PenAIC5 (double cc) | |
cxsc::real | operator() (const AdaptiveHistogram *const adh, int deltaLeaf) const |
the penalty function. |
Class for penalty function 5 for AIC.
Penalty is just some multiple of logCatK. Should have c = 1 to stop splitting on one point with AIC EMP.
real subpavings::PenAIC5::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*k, log(2.0)); // pen = c*k*log(2) return (rnd(penalty)); // return c*k*log(2) }