I got the following error:
Error 2 Value restriction. The value \'gbmLikelihood\' has been inferred to have generic type val gbm
\'gbmLikelihood\'
val gbm
Instead of making the parameters of gbmLikelihood explicit you might also just add a generic type annotation to the function:
gbmLikelihood
let gbmLikelihood<'a> = likelihood (fun data p -> Array.get p 0) (fun datac p -> Array.get p 1)