当前位置:网站首页>Matlab与1stOpt多元非线性回归
Matlab与1stOpt多元非线性回归
2022-07-19 16:31:00 【A-Chin】
使用Matlab和1stOpt对 y = b1 * x1b2 * x2b3 * x3b4 进行拟合。
1 Matlab多元非线性回归
Matlab常使用nlinfit函数进行多元非线性回归,主要语法:beta = nlinfit(X, Y, modelfun, beta0)
,其中,X为预测变量,Y为响应值,modelfun为指定的模型,beta0为参数初始值。其中,beta0对参数beta的估计起到很重要的作用,直接影响beta的优劣。
Matlab中,首先构造modelfun = ‘beta(1) .* X(:,1) .^ beta(2) .* X(:,2) .^ beta(3) .* X(:,3) .^ beta(4)’,以及beta0,然后使用beta = nlinfit(X, Y, mymodel, beta0)语句求解,结果为:
[1.125319074808870e-11; 0.206682275666316; 9.346992572477125; -0.713319766492658],R值为0.849547658794089。
2 1stOpt多元非线性回归
为了避免初始值对beta估计的影响,可以使用1stOpt软件进行估计,需要试用版软件可以下载1stOpt试用版本安装包及操作手册,或者在评论区留下联系方式,不过试用版本的参数不得超过4个。
多元非线性回归,使用1stOpt的编码很简单:
Parameter b1, b2, b3, b4;
Variable x1, x2, x3, y;
Function y=b1*x1^b2*x2^b3*x3^b4;
Data;
//x1 x2 x3 y
3673831.01000000 39.5763140000000 74.3562590000000 12700.0100000000
2897388.01000000 39.6674820000000 112.371992000000 5200.01000000000
2357076.01000000 40.3692350000000 95.2484480000000 9000.01000000000
769326.010000000 39.4360980000000 133.780490000000 13100.0100000000
//...共计693条数据
只需定义好参数名,变量名,方程模型以及数据,完场上述后运行,在结果栏进行查看。最重要的是,多元非线性回归中无需设置初始值。
边栏推荐
- XSS(跨站脚本攻击)漏洞理解
- 常见的跨域场景
- 教你使用CANN将照片一键转换成卡通风格
- Go fastdfs distributed file system construction (implementation sorting)
- 用户名枚举漏洞怎么解决
- Fix the error reported by the redis connection of the celery configuration under windows (typeerror: _initu () got an unexpected keyword argument)
- 理想L9,过不了路上一个坑?
- 地学学术资源II
- 项目经验总结——送给测试岗做项目的朋友们
- Docker configuration mysql, redis
猜你喜欢
VRRP技术(详解)
You can definitely use the carefully selected 100 soft test high-frequency interview questions before the interview
tp5.1 foreach在控制器记录中新增加一个字段,其它字段不变也不用重新全部写一遍 (不在模板中操作)(分页)
Matlab cell保存为.csv格式
Meta深陷泥潭:广告主压缩支出,撤离平台
There are 13 steps to install pychart, isn't it? (super detailed tutorial)
celery ValueError: not enough values to uppack(expected 3, got 0)
Summary of project experience - send it to the friends of the testing post who are doing the project
教你使用CANN将照片一键转换成卡通风格
go-fastDFS 分布式文件系统搭建(实现梳理)
随机推荐
error: redefinition of
统计学习——朴素贝叶斯法
怎么设置数据库的报警
若依框架-表单按照字段合计,按照某个字段排序
XSS(跨站脚本攻击)漏洞理解
php7.4升级php8.0后重启系统网站访问异常问题
Paging storage management mode
Table & Index bloat of PG
matlab获取原数组在排序后数组中的位置
《深度学习应用开发》学习笔记汇总(二)
VRRP技术(详解)
R语言“Error in nls 循环次数超过了50”解决方案
go-fastDFS 分布式文件系统搭建(实现梳理)
软件测试岗——面试时三大灵魂拷问,你受得住吗?
【300+精选大厂面试题持续分享】大数据运维尖刀面试题专栏(五)
食腐秃鹫还是啄木鸟?如何正确理解做空
地学学术资源II
Under the epidemic, where is the way out for software testing?
常见的跨域场景
mysql迁移金仓数据库主键、索引丢失问题解决方案