Matlab之用最小二乘建立模型预测值以下例子使用1960,1970,1990和2000的人口估计1980的人口。分别用了直线估计和抛物线估计

该博客展示了如何使用Matlab的最小二乘法进行人口预测,通过直线和抛物线两种模型估计1980年的人口。比较了两种方法的误差,并通过图形展示结果,得出抛物线拟合效果更优的结论。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

以下例子使用1960,1970,1990和2000的人口估计1980的人口。分别用了直线估计和抛物线估计。

% page 199 3
% this problem is to estimate the populatipn in 1980 and
% compare the error using different method to estimate
% one use line and the other is parabale
% input:none
% output:plot the figure and display error
function page_199_3_script
format long;
x0 = [0 10 30 40];
y0 = [3039585530 3707475887 5281653820 6079603571];
x1 = 0:.01:450;
c1 = polyfit(x0,y0,1);

评论 3
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值