trend computation inside the model