SAMME.R implementation

this should be done outside loop