nnCostFunction<-function(g,b1,b2){ bb1<-as.vector(g(b1))*rep(1,5) bb2<-b2/2 return(list(bb1,bb2)) }