1: local 字集库 = require("u8_to_a")
2: local 历排取联库 = require(字集库.u8_to_a("算机_程语_月_基类_能_传能_历_基类_表_排_取联"))
3: local 返参库 = require(字集库.u8_to_a("算机_程语_月_基类_能_返参"))
4: local 基算库 = require(字集库.u8_to_a("算机_程语_月_基类_数_基算"))
5: local 历排库 = require(字集库.u8_to_a("算机_程语_月_基类_能_传能_历_基类_表_排_取全"))
6: local 数库 = require(字集库.u8_to_a("算机_程语_月_基类_数"))
7: local s = {}
8: --~ 排
5b9fb5e09f 2024-02-13 9: function s.总和(o1_0)
5b9fb5e09f 2024-02-13 10: return 历排取联库.历排(o1_0, 基算库.加法, 返参库.一参)
11: end
12: --~ 排
5b9fb5e09f 2024-02-13 13: function s.均值(o1_0)
14: local k1
15: --~ 总和
5b9fb5e09f 2024-02-13 16: k1 = s.总和(o1_0)
5b9fb5e09f 2024-02-13 17: return 基算库.除法(k1, #o1_0)
18: end
19: --~ 排
20: --~ 标准值
5b9fb5e09f 2024-02-13 21: function s.方差(o1_0, o1)
22: local k1, k2
23: local k1_0
24: --~ 标准值
5b9fb5e09f 2024-02-13 25: k1 = o1 or s.均值(o1_0)
26: --~ 排,用于算方差
5b9fb5e09f 2024-02-13 27: k1_0 = 历排库.历排(o1_0, 基算库.减法, k1)
28: k1_0 = 历排库.历排(k1_0, 数库.指数, 2)
29: --~ 方差
30: k2 = 基算库.除法(s.总和(k1_0), #k1_0)
31: return k2
32: end
33: --~ 排
34: --~ 标准值
5b9fb5e09f 2024-02-13 35: function s.标准差(o1_0, o1)
36: local k1
37: --~ 方差
5b9fb5e09f 2024-02-13 38: k1 = s.方差(o1_0, o1)
39: return 数库.指数(k1, 1, 2)
40: end
41: --~ 排
42: --~ 标准值
5b9fb5e09f 2024-02-13 43: function s.均差(o1_0, o1)
44: local k1, k2
45: local k1_0
46: --~ 标准值
5b9fb5e09f 2024-02-13 47: k1 = o1 or s.均值(o1_0)
48: --~ 排,用于算均差
5b9fb5e09f 2024-02-13 49: k1_0 = 历排库.历排(o1_0, 基算库.减法, k1)
50: k1_0 = 历排库.历排(k1_0, 数库.正数)
51: --~ 均差
52: k2 = 基算库.除法(s.总和(k1_0), #k1_0)
53: return k2
54: end
55: return s