The code manually derives the expression fm(x1,x2,x3,...,xk) for
the equally spaced points in (k+1) dimensions, where m is the order of the approximation f.
Example:
x1=[6 7 8 5 3 2 1 2 5 8];
x2=[9 7 0 8 5 6 4 3 2 10];
y=[9 7 6 4 3 2 5 6 8 1];
mreg([x1;x2],y,1)
ans =
5.542073-.2829251*x2+.2310048*x1
mreg([x1;x2],y,2)
ans =
3.797949-.6754073*x2-.2393447e-1*x2^2
+2.256645*x1+.8248780e-1*x1*x2
-.2478672*x1^2
mreg([x1;x2],y,3)
ans =
-24.62814+33.15517*x2-9.837215*x2^2+.8316257*x2^3
-17.31119*x1+7.450905*x1*x2-.6438069*x1*x2^2
+.3614982*x1^2-.4148167*x1^2*x2+.2851207*x1^3
Example:
x1=[6 7 8 5 3 2 1 2 5 8 5 4];
x2=[9 7 0 8 5 6 4 3 2 10 5 7];
x3=[8 9 7 6 5 4 3 5 6 7 5 3];
y=[9 7 6 4 3 2 5 6 8 1 8 0];
mreg([x1;x2;x3],y,2)
ans =
32.48905-7.049319*x3+.1384845*x3^2-6.246954*x2
+1.259510*x2*x3-.4498889e-1*x2^2+5.668323*x1
-.4038119*x1*x3-.3257156*x1*x2-.1031725*x1^2
Required Products Symbolic Math Toolbox
MATLAB release MATLAB 7.4 (R2007a)
Other requirements A MATLAB version with the Maple Symbolic Math Toolbox, i.e. MATLAB versions EARLIER than 7.6 (R2008a).
没有合适的资源?快使用搜索试试~ 我知道了~
通用最小二乘回归Matlab代码General+Least+Squares+Regression
共2个文件
m:1个
txt:1个
5星 · 超过95%的资源 需积分: 17 30 下载量 80 浏览量
2012-05-02
16:37:17
上传
评论
收藏 3KB RAR 举报
温馨提示
通用最小二乘回归Matlab代码General+Least+Squares+Regression
资源推荐
资源详情
资源评论
收起资源包目录
通用最小二乘回归Matlab代码(General+Least+Squares+Regression)=mreg.rar (2个子文件)
Readme.txt 1KB
mreg.m 6KB
共 2 条
- 1
资源评论
- song_266_good2012-09-11不好用呢,不过程序还是可以运行的
LuckQuant
- 粉丝: 0
- 资源: 22
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功