trend_analysis function

Trend analysis