1200字范文,内容丰富有趣,写作的好帮手!
1200字范文 > 数学基础(9)--MATLAB 数据拟合 SSE MSE RMSE R-square

数学基础(9)--MATLAB 数据拟合 SSE MSE RMSE R-square

时间:2023-08-25 16:17:09

相关推荐

数学基础(9)--MATLAB 数据拟合 SSE MSE RMSE R-square

本来主要介绍机器学习、曲线拟合中常见的损失函数MSE的定义以及它的求导特性。

数理统计中均方误差是指参数估计值与参数值之差平方的期望值,记为MSE。MSE是衡量“平均误差”的一种较方便的方法,MSE可以评价数据的变化程度,MSE的值越小,说明预测模型描述实验数据具有更好的精确度。

SSE(和方差、误差平方和):The sum of squares due to errorMSE(均方差、方差):Mean squared errorRMSE(均方根、标准差):Root mean squared errorR-square(确定系数):Coefficient of determination

% num返回的是excel中的数据,txt输出的是文本内容,raw输出的是未处理数据% [num,txt,raw]=xlsread('C:\Users\Administrator\Desktop\test\a.xls') % % 一般情况下,我们读取的是excel中的数据,所以可以直接用下面的命令,只输出数据矩阵便可[num]=xlsread('E:\matlab_ws\0922单臂轨迹重复测试\0923-数据启用\traj_1.xlsx') ;[num1]=xlsread('E:\matlab_ws\0922单臂轨迹重复测试\0923-数据启用\traj_2.xlsx') ;[num2]=xlsread('E:\matlab_ws\0922单臂轨迹重复测试\0923-数据启用\traj_3.xlsx') ;[num3]=xlsread('E:\matlab_ws\0922单臂轨迹重复测试\0923-数据启用\traj_4.xlsx') ;[num4]=xlsread('E:\matlab_ws\0922单臂轨迹重复测试\0923-数据启用\traj_5.xlsx') ;% 第一段轨迹数据x_t1 = num2(1:800,1);y_t1 = num2(1:800,2);z_t1 = num2(1:800,3);% 第二段轨迹数据x_t2 = num1(1:800,1);y_t2 = num1(1:800,2);z_t2 = num1(1:800,3);% 第三段轨迹数据x_t3 = num3(1:800,1);y_t3 = num3(1:800,2);z_t3 = num3(1:800,3);% 计算两段轨迹中轨迹点的欧氏距离dst = sqrt((x_t1-x_t2).^2 + (y_t1-y_t2).^2 +(z_t1-z_t2).^2 );cnt = 800;mn = mean(dst); mn_vec = ones(cnt,1)*mn;% sseSSE(和方差、误差平方和):The sum of squares due to error% MSE(均方差、方差):Mean squared error% RMSE(均方根、标准差):Root mean squared error% SSEs = (dst-mn_vec).^2;SSE = sum(s);% MSEMSE = SSE/cnt;% RMSERMSE = sqrt(MSE);disp("Trajectory Mean Error:"+mn+"(mm)");disp("Trajectory SSE: "+SSE+"(mm)");disp("Trajectory MSE: "+MSE+"(mm)");disp("Trajectory RMSE: "+RMSE+"(mm)");% 绘图time_stp = linspace(0,13,cnt);plot(time_stp,mn_vec,'Color','b','LineWidth',1);hold on;plot(time_stp,dst,'Color','r','LineWidth',1);

Trajectory Mean Error: 0.5599(mm)

Trajectory SSE: 146.9341(mm)

Trajectory MSE: 0.18367(mm)

Trajectory RMSE: 0.42856(mm)

参考:

MATLAB拟合中SSE,MSE,RMSE,R-square,Adjusted R-quuare含义_qhsong的博客-CSDN博客SSE(和方差、误差平方和):The sum of squares due to errorMSE(均方差、方差):Mean squared errorRMSE(均方根、标准差):Root mean squared errorR-square(确定系数):Coefficient of determinationAdjusted R-square:Degree-of-freedom /qq_25614747/article/details/55194007

损失函数 | MSE - 知乎

Picking Loss Functions - A comparison between MSE, Cross Entropy, and Hinge Loss – Rohan Varma – Software Engineer @ Facebookhttps://rohanvarma.me/Loss-Functions/

本内容不代表本网观点和政治立场,如有侵犯你的权益请联系我们处理。
网友评论
网友评论仅供其表达个人看法,并不表明网站立场。