Files
playbook/skills/tsl-api-reference/references/codegen/dotnet/math/regression-regression_test.md
T
2026-08-14 17:15:41 +08:00

1019 B

数学函数 / 回归 / 回归检验

regress_ridge(y, x, k, constant, alpha)

声明:function

执行岭回归并返回回归系数、残差和统计检验结果

参数 类型 说明
y array of real 被解释变量序列
x array of real 解释变量矩阵,每列对应一个解释变量
k real|array 可选。岭参数或岭参数序列
constant boolean 可选。是否包含常数项,默认 true
alpha real 可选。显著性水平,默认 0.05

返回:array

示例

范例01:使用指定岭参数执行回归

y := array(49.0, 50.2, 50.5, 48.5);
x := array(
    (1.0, 2.0),
    (2.0, 1.0),
    (3.0, 4.0),
    (4.0, 3.0));
return regress_ridge(y, x, 0.1, true, 0.05);