我试图确定数据集的向上和向下趋势开始和结束的点,这些趋势可能发生在 X 轴内的任何给定点。例如,对于给定的数据集,我们可以看到从点 x = 1 到 x = 10 开始呈上升趋势,随后从 x = 11 到 x = 20 呈下降趋势,然后呈上升趋势。肯定有一种数学方法可以做到这一点吗?
x = [1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30]
y = [2,5,7,9,10,13,16,18,21,22,21,20,19,18,17,14,10,9,7,5,7,9,10,12,13,15,16,17,22,27]
提前致谢