feat(tsl-api-reference): expand API and module coverage

This commit is contained in:
csh
2026-08-14 17:12:55 +08:00
parent 8f1056130d
commit 3d3036ebe1
571 changed files with 47842 additions and 14458 deletions
@@ -0,0 +1,54 @@
# 数学函数 / 统计推断
## `estimate_sp(mx, n, alpha, tail)`
声明:function
估计单个总体比率的置信区间
<!-- tags: 统计推断 比率 概率 置信区间 proportion confidence interval -->
| 参数 | 类型 | 说明 |
| ------- | ------- | --------------------------------------------------- |
| `mx` | real | 样本比率 |
| `n` | integer | 样本容量 |
| `alpha` | real | 显著性水平,范围 0 到 1 |
| `tail` | string | 可选。区间方向,可取 both、left 或 right,默认 both |
返回:array
### 示例
范例01:计算双侧置信区间
```tsl
return estimate_sp(0.3, 120, 0.05, "both");
// 输出:array("Lower":0.218009,"upper":0.381991)
```
## `estimate_tp(p, n, alpha, tail)`
声明:function
估计两个总体比率之差的置信区间
<!-- tags: 统计推断 比率差 概率 置信区间 proportion difference -->
| 参数 | 类型 | 说明 |
| ------- | ------ | --------------------------------------------------- |
| `p` | array | 两个样本的比率 |
| `n` | array | 两个样本的容量 |
| `alpha` | real | 显著性水平,范围 0 到 1 |
| `tail` | string | 可选。区间方向,可取 both、left 或 right,默认 both |
返回:array
### 示例
范例01:计算两个总体比率差的双侧置信区间
```tsl
return estimate_tp(
array(0.478, 0.328), array(1000, 750), 0.05, "both");
// 输出:array("Lower":0.104311,"upper":0.195689)
```