php中文网 | cnphp.com

 找回密码
 立即注册

QQ登录

只需一步,快速开始

搜索
查看: 519|回复: 0

regress多元回归拟合代码

[复制链接]

3146

主题

3156

帖子

1万

积分

管理员

Rank: 9Rank: 9Rank: 9

UID
1
威望
0
积分
7966
贡献
0
注册时间
2021-4-14
最后登录
2024-11-23
在线时间
763 小时
QQ
发表于 2022-7-8 08:08:48 | 显示全部楼层 |阅读模式
n=10;m=5;alpha=0.05;
x1=[10521667313.33,13880396970.82,12685660578.41,14048932040.99,15010921209.65,16103786351.41,16334811436.83,17277037490.47,20351939978.58,21610405402.53];

x2=[1041709112.47,1440816247.17,1268359415.28,1263787426.53,1368801995.54,1484218837.50,1490854303.85,1520329814.80,1798177056.32,1857104874.30];
x3=[0.0145,0.2215,0.0975,0.01472,0.0851,0.0254,0.0461,0.0788,0.0415,-0.0332];

x4=[3.7127,2.5508,1.8585,1.4840,1.6380,2.2226,4.4028,2.94,3.1862,4.6272];
x5=[37021382625.531,32045534525.480,23974111617.647,16287217039.656,22618981489.215,35640964099.679,116369639594.802,40158146232.970,35071362434.280,26814763200.536];
y=[9.37,15.18,13.02,6.56,6.07,8.99,20.36,14.39,7.93,4.97];
x=[ones(n,1),x1',x2',x3',x4',x5'];


[b,bint,r,rint,s]=regress(y',x);
s2=sum(r.^2)/(n-m-1);
%b,bint,s,s2;
rcoplot(r,rint);
title('残差图的绘制');
xlabel('数据 ');ylabel('残差');

回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

QQ|php中文网 | cnphp.com ( 赣ICP备2021002321号-2 )

GMT+8, 2024-11-23 20:03 , Processed in 0.260199 second(s), 35 queries , Gzip On.

Powered by Discuz! X3.4 Licensed

Copyright © 2001-2020, Tencent Cloud.

申明:本站所有资源皆搜集自网络,相关版权归版权持有人所有,如有侵权,请电邮(fiorkn@foxmail.com)告之,本站会尽快删除。

快速回复 返回顶部 返回列表