updating trendpred... the result of matlab and R version are close...