【问题标题】:How can i use the curve Goodness of Fit?我如何使用曲线拟合优度?
【发布时间】:2018-06-29 16:09:31
【问题描述】:

我想使用曲线拟合优度 (GOF) 来比较 Matlab 中原始信号和滤波信号之间的相似率

【问题讨论】:

    标签: matlab signal-processing


    【解决方案1】:

    通常,拟合优度检验假定在经验数据和理论数据之间进行比较……换句话说,在真实观察结果和近似它们的函数产生的值之间进行比较。由于您正在使用曲线,fit function 已经提供了执行测试所需的所有内容:

    [fitobject,gof] = fit(x,y,fitType)
    
      gof — Goodness-of-fit statistics, returned as the gof structure including the fields in this table:
    
        sse - Sum of squares due to error
        rsquare - R-squared (coefficient of determination)
        dfe - Degrees of freedom in the error
        adjrsquare - Degree-of-freedom adjusted coefficient of determination
        rmse - Root mean squared error (standard error)
    

    我们举个例子:

    x = (0:0.2:5).';
    y = 2 .* exp(-0.2 .* x);
    
    [f1,gof1] = fit(x,y,'exp1');
    figure(),plot(f1,x,y);
    
    [f2,gof2] = fit(x,y,'poly1');
    figure(),plot(f2,x,y);
    

    y 的声明中,由于没有添加噪声,我们知道与a = 2b = -0.2 的指数拟合会产生完美的结果,而多项式拟合会产生良好的结果(但不完美)结果。

    R2 统计数据可以取介于01 之间的任何值,更接近1 的值表示更适合。由于我们没有使用额外的系数,因此评估我们的拟合度已经绰绰有余,并且代表了在许多之间选择模型的良好标准。查看 gof1gof2 结构(rsquare 字段)中包含的 R2 值,我们可以看到我们的假设得到了证实:在 gof1 中,R2 统计量的值为 1(完美拟合) ,而在gof2 中,相同的统计数据的值非常接近1,但不等于1(非常适合)。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2017-07-12
      • 2019-08-08
      • 1970-01-01
      • 1970-01-01
      • 2020-12-06
      • 2018-04-19
      • 2019-10-06
      • 2020-05-05
      相关资源
      最近更新 更多