optimization is too slow in R. Resorting to naive model