logistic人口模型python代码_用Matlab程序对logistic人口模型进行拟合?

本文介绍了如何使用Matlab的cftool对Logistic人口模型进行拟合,展示了拟合的详细过程,包括模型方程、系数及置信区间,并给出了Matlab的代码示例。尽管在拟合过程中遇到未收敛的问题,但仍然得到了较好的拟合结果,R平方接近0.99。
摘要由CSDN通过智能技术生成

使用cftool

logistic人口模型进行拟合

General model:

f(x) = a/(1+b*exp(-k*(x-1790)))

Coefficients (with 95% confidence bounds):

a =       446.6  (371.1, 522)

b =       57.01  (48.93, 65.09)

k =     0.02155  (0.01945, 0.02365)

Goodness of fit:

SSE: 457.7

R-square: 0.9972

Adjusted R-square: 0.9969

RMSE: 4.908

x(t)=xm+(-xm+x0)exp(-rt)

Fit computation did not converge:

Maximum number of function evaluations exceeded. Increasing

MaxFunEvals (in fit options) may allow for a better fit, or

the current equation may not be a good model for the data.

Fit found when optimization terminated:

General model:

f(x) = ym+(-ym+3.9)*exp(-r*(x-1790))

Coefficients (with 95% confidence bounds):

r =  3.682e-006  (-0.005956, 0.005964)

ym =   2.66e+005  (-4.301e+008, 4.307e+008)

Goodness of fit:

SSE: 2.485e+004

R-square: 0.8455

Adjusted R-square: 0.8378

RMSE: 35.25

matlab程序如下:

----------------------------------------------

x=[1790 1800 1810 1820 1830 1840 1850 1860 1870 1880 1890 1900 1910 1920 1930 1940 1950 1960 1970 1980 1990 2000];

y=[3.9 5.3 7.2 9.6 12.9 17.1 23.2 31.4 38.6 50.2 62.9 76.0 92.0 106.5 123.2 131.7 150.7 179.3 204.0 226.5 251.4 281.4];

x=x';y=y';

st_ = [500 20 0.2];

ft_ = fittype('a/(1+b*exp(-k*(x-1790)))' ,...

'dependent',{'y'},'independent',{'x'},...

'coefficients',{'a', 'b', 'k'});

cf_ = fit(x,y,ft_ ,'Startpoint',st_)

----------------------------------------------

运行结果

cf_ =

General model:

cf_(x) = a/(1+b*exp(-k*(x-1790)))

Coefficients (with 95% confidence bounds):

a =       446.6  (371.1, 522)

b =       57.01  (48.93, 65.09)

k =     0.02155  (0.01945, 0.02365)

名师点评:

袁袁乐mFOc

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值