rate函数如何计算结果?
How does rate function calculate the result?
我在费率上看到了这个问题
second counter_value increase calculated by hand(call it ICH from now)
1 1 1
2 3 2
3 6 3
4 7 1
5 10 3
6 14 4
7 17 3
8 21 4
9 25 4
10 30 5
我没看懂
的结果
rate(counter[2s]): will get the average from the increment in 2 sec and distribute it among the seconds
So in the first 2 second we got an increment of total 3 which means the average is 1.5/sec. final result:
second result
1 1,5
2 1,5
3 2
4 2
5 3,5
6 3,5
7 3,5
8 3,5
9 4,5
10 4,5
和
rate(counter[5s]): will get the average from the increment in 5 sec and distribute it among the seconds
The same as for [2s] but we calculate the average from total increment of 5sec. final result:
second result
1 2
2 2
3 2
4 2
5 2
6 4
7 4
8 4
9 4
你能给我解释一下逻辑吗?
我认为问题中的OP只是计算错误。该问题的 对其进行了非常清楚和详细的解释,提供了要使用的确切公式。还有一个例子(在评论中):
if t1
is 1 and t5
is 5; and the value at t1
is 1 and the value at t5
is 10 (as above) then (v5 - v1) / (t5 - t1)
is (10 - 1) / (5 - 1)
, i.e. 2.25
这明显与第 5 秒原始示例中的 rate(counter[5s])
相矛盾,后者表示 2。另请注意,答案中第 1 秒的 ICH 应为 0。
我现在尝试手算一下:
rate(counter[5s]): (v_y - v_x) / (t_y - t_x)
second result calculation
1 N/A (1 - 1) / (1 - 1)
2 2 (3 - 1) / (2 - 1)
3 2.5 (6 - 1) / (3 - 1)
4 2 (7 - 1) / (4 - 1)
5 2.25 (10 - 1) / (5 - 1)
6 2.75 (14 - 3) / (6 - 2)
7 2.75 (17 - 6) / (7 - 3)
8 3.5 (21 - 7) / (8 - 4)
9 3.75 (25 - 10) / (9 - 5)
10 4 (30 - 14) / (10 - 6)
我在费率上看到了这个问题
second counter_value increase calculated by hand(call it ICH from now)
1 1 1
2 3 2
3 6 3
4 7 1
5 10 3
6 14 4
7 17 3
8 21 4
9 25 4
10 30 5
我没看懂
的结果rate(counter[2s]): will get the average from the increment in 2 sec and distribute it among the seconds
So in the first 2 second we got an increment of total 3 which means the average is 1.5/sec. final result:
second result
1 1,5
2 1,5
3 2
4 2
5 3,5
6 3,5
7 3,5
8 3,5
9 4,5
10 4,5
和
rate(counter[5s]): will get the average from the increment in 5 sec and distribute it among the seconds
The same as for [2s] but we calculate the average from total increment of 5sec. final result:
second result
1 2
2 2
3 2
4 2
5 2
6 4
7 4
8 4
9 4
你能给我解释一下逻辑吗?
我认为问题中的OP只是计算错误。该问题的
if
t1
is 1 andt5
is 5; and the value att1
is 1 and the value att5
is 10 (as above) then(v5 - v1) / (t5 - t1)
is(10 - 1) / (5 - 1)
, i.e.2.25
这明显与第 5 秒原始示例中的 rate(counter[5s])
相矛盾,后者表示 2。另请注意,答案中第 1 秒的 ICH 应为 0。
我现在尝试手算一下:
rate(counter[5s]): (v_y - v_x) / (t_y - t_x)
second result calculation
1 N/A (1 - 1) / (1 - 1)
2 2 (3 - 1) / (2 - 1)
3 2.5 (6 - 1) / (3 - 1)
4 2 (7 - 1) / (4 - 1)
5 2.25 (10 - 1) / (5 - 1)
6 2.75 (14 - 3) / (6 - 2)
7 2.75 (17 - 6) / (7 - 3)
8 3.5 (21 - 7) / (8 - 4)
9 3.75 (25 - 10) / (9 - 5)
10 4 (30 - 14) / (10 - 6)