poly_trend function

Polynomial trend