I was looking through the various cost function(deviances) in GBM's implementation of R and got confused by the cost function. I had always thought that the cost function for bernoulli would be log likelihood or something that approximates log likelihood. However, it seems different in the R source code of GBM
if (dist$name != "pairwise")
{
switch(dist$name,
gaussian = weighted.mean((y - f)^2,w) - baseline,
bernoulli = -2*weighted.mean(y*f - log(1+exp(f)),w) - baseline,
laplace = weighted.mean(abs(y-f),w) - baseline,
adaboost = weighted.mean(exp(-(2*y-1)*f),w) - baseline,
poisson = -2*weighted.mean(y*f-exp(f),w) - baseline,
stop(paste("Distribution",dist$name,"is not yet supported for method=permutation.test.gbm")))
}
The above is the code from the GBM source code. Can someone explain the cost function in case of Bernoulli, and Poisson?