我有相同数据集和相同时间间隔的时间序列数据和移动平均数据。我想提取重叠点。我想根据趋势反转的方向提取当前和最后一个交叉点(移动平均线和时间序列之间的交叉点)之间的极值点。我不知道是根据表格执行它(1-时间序列表包括温度和时间戳 2-移动平均表仅包括温度的移动平均结果)还是根据我添加移动平均线的图执行它到时间序列图。
时间序列表:
ambtemp dt
1 -1.14 2007-09-29 00:01:57
2 -1.12 2007-09-29 00:03:57
3 -1.33 2007-09-29 00:05:57
4 -1.44 2007-09-29 00:07:57
5 -1.54 2007-09-29 00:09:57
6 -1.29 2007-09-29 00:11:57
7 -1.42 2007-09-29 00:13:57
8 -1.37 2007-09-29 00:15:57
9 -1.32 2007-09-29 00:17:57
10 -1.37 2007-09-29 00:19:57
11 -1.14 2007-09-29 00:21:57
12 -1.16 2007-09-29 00:23:57
13 -1.08 2007-09-29 00:25:57
14 -1.21 2007-09-29 00:27:57
15 -1.26 2007-09-29 00:29:57
16 -1.50 2007-09-29 00:31:57
17 -1.35 2007-09-29 00:33:57
18 -1.56 2007-09-29 00:35:57
19 -1.60 2007-09-29 00:37:57
20 -1.30 2007-09-29 00:39:57
21 -1.24 2007-09-29 00:41:57
22 -1.24 2007-09-29 00:43:57
23 -1.10 2007-09-29 00:45:57
24 -0.99 2007-09-29 00:47:57
25 -1.04 2007-09-29 00:49:57
26 -0.97 2007-09-29 00:51:57
27 -0.92 2007-09-29 00:53:57
28 -0.70 2007-09-29 00:55:57
29 -0.58 2007-09-29 00:57:57
30 -0.49 2007-09-29 00:59:57
31 -0.54 2007-09-29 01:01:57
32 -0.37 2007-09-29 01:03:57
33 -0.24 2007-09-29 01:05:57
34 -0.34 2007-09-29 01:07:57
35 -0.43 2007-09-29 01:09:57
36 -0.52 2007-09-29 01:11:57
37 -0.16 2007-09-29 01:13:57
38 -0.50 2007-09-29 01:15:57
39 -0.15 2007-09-29 01:17:57
40 -0.04 2007-09-29 01:19:57
41 0.00 2007-09-29 01:21:57
42 -0.08 2007-09-29 01:23:57
43 -0.30 2007-09-29 01:25:57
44 -0.14 2007-09-29 01:27:57
45 -0.06 2007-09-29 01:29:57
46 -0.02 2007-09-29 01:31:57
47 -0.25 2007-09-29 01:33:57
48 -0.33 2007-09-29 01:35:57
49 0.01 2007-09-29 01:37:57
50 -0.28 2007-09-29 01:39:57
51 -0.26 2007-09-29 01:41:57
52 -0.34 2007-09-29 01:43:57
53 -0.43 2007-09-29 01:45:57
54 -0.20 2007-09-29 01:47:57
55 0.19 2007-09-29 01:49:57
56 0.28 2007-09-29 01:51:57
57 0.07 2007-09-29 01:53:57
58 -0.32 2007-09-29 01:55:57
59 -0.20 2007-09-29 01:57:57
60 -0.42 2007-09-29 01:59:57
61 -0.40 2007-09-29 02:01:57
62 -0.54 2007-09-29 02:03:57
63 -0.67 2007-09-29 02:05:57
64 -0.42 2007-09-29 02:07:57
65 -0.57 2007-09-29 02:09:57
66 -0.73 2007-09-29 02:11:57
67 -0.54 2007-09-29 02:13:57
68 -0.70 2007-09-29 02:15:57
69 -0.70 2007-09-29 02:17:57
70 -0.58 2007-09-29 02:19:57
移动平均线表:
[1] NA NA NA NA NA NA NA NA NA
[10] NA NA NA NA NA NA NA NA NA
[19] NA -1.3250 -1.3300 -1.3360 -1.3245 -1.3020 -1.2770 -1.2610 -1.2360
[28] -1.2025 -1.1655 -1.1215 -1.0915 -1.0520 -1.0100 -0.9665 -0.9250 -0.8760
[37] -0.8165 -0.7635 -0.6910 -0.6280 -0.5660 -0.5080 -0.4680 -0.4255 -0.3765
[46] -0.3290 -0.2955 -0.2770 -0.2475 -0.2370 -0.2230 -0.2215 -0.2310 -0.2240
[55] -0.1930 -0.1530 -0.1415 -0.1325 -0.1350 -0.1540 -0.1740 -0.1970 -0.2155
[64] -0.2295 -0.2550 -0.2905 -0.3050 -0.3235 -0.3590 -0.3740 -0.3860 -0.3880
[73] -0.3695 -0.4045 -0.4450 -0.4900 -0.5125 -0.5215 -0.5515 -0.5825 -0.6140
不同窗口大小的时间序列和移动平均值的重叠
窗口大小为 40 的预期结果