【问题标题】:Simple Linear Regression with constraint using Math.net and C#使用 Math.net 和 C# 进行带约束的简单线性回归
【发布时间】:2016-05-22 05:45:38
【问题描述】:

我正在使用 Math.net 和 C# 对两个包含生理数据的双数组(XValues、YValues)进行简单的线性回归。将截距限制在原点是有充分理由的。 目前我正在使用:

Tuple<double, double> r = Fit.Line(XValues, YValues);
double YIntercept = r.Item1;
double Slope = r.Item2; ...etc.

谁能提供代码 sn-p 来强制回归线通过零。 - 我无法理解 StackOverflow 上唯一相关问题中提供的答案

【问题讨论】:

  • 您能否提供另一个问题的链接?

标签: c# linear-regression mathnet-numerics


【解决方案1】:

你可能想使用Fit.LineThroughOrigin,它强制截距为0

Tuple<double, double> r = Fit.LineThroughOrigin(XValues, YValues);

如果您想要的是函数本身,请使用LineThroughOriginFunc。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2018-11-18
    • 2021-01-27
    • 2015-06-19
    • 1970-01-01
    • 2012-04-26
    • 2018-12-13
    • 2018-07-31
    • 1970-01-01
    相关资源
    最近更新 更多