24小时热门版块排行榜    

查看: 884  |  回复: 8

goldfish2683

禁虫 (小有名气)

本帖内容被屏蔽

已阅   关注TA 给TA发消息 送TA红花 TA的回帖

wangjn

铜虫 (小有名气)

楼主
呢有相同问题?
可有热心人。。。
2楼2013-06-14 15:33:56
已阅   关注TA 给TA发消息 送TA红花 TA的回帖

dbb627

荣誉版主 (著名写手)

【答案】应助回帖


感谢参与,应助指数 +1
ben_ladeng: 金币+1, 谢谢指点 2013-06-14 23:19:52
这个就一回归模型吧
不知道你的方程是不是这个
%y=k*x(1)^a*x(2)^b*x(3)^c
%logy=logk+a*logx1+b*logx2+c*logx3
data=[0.678  0.710        0.388        0.020
0.661        0.711        0.127        0.010
0.555        0.707        0.086        0.011
0.639        0.469        0.038        0.010
1.207        0.465        0.069        0.011
1.182        0.452        0.129        0.021
1.156        0.327        0.348        0.023
0.948        0.426        0.078        0.021
1.109        0.670        0.284        0.020
1.199        0.691        0.113        0.019];
Y=log(data(:,4));X=[ones(length(Y),1) log(data(:,1:3))];
[B,BINT,R,RINT,STATS] = regress(Y,X)
rcoplot(R, RINT)
yp=exp(X*B);
plot(1:length(Y),log(data(:,4)),'ro-',1:length(Y),log(yp),'b-*')
The more you learn, the more you know, the more you know, and the more you forget. The more you forget, the less you know. So why bother to learn.
3楼2013-06-14 19:26:57
已阅   关注TA 给TA发消息 送TA红花 TA的回帖

goldfish2683

禁虫 (小有名气)

本帖内容被屏蔽

4楼2013-06-15 07:32:13
已阅   关注TA 给TA发消息 送TA红花 TA的回帖

dbb627

荣誉版主 (著名写手)

【答案】应助回帖

★ ★
ben_ladeng: 金币+2, 谢谢指点 2013-06-16 23:07:42
fun=@(x,data)sum((x(1)*data(:,1).^x(2).*data(:,2).^x(3)./(1+data(:,3).^x(4))-data(:,4)).^2);
xdata=[0.678  0.710        0.388        0.020
0.661        0.711        0.127        0.010
0.555        0.707        0.086        0.011
0.639        0.469        0.038        0.010
1.207        0.465        0.069        0.011
1.182        0.452        0.129        0.021
1.156        0.327        0.348        0.023
0.948        0.426        0.078        0.021
1.109        0.670        0.284        0.020
1.199        0.691        0.113        0.019];
[x,feval] =fminsearch(@(x)fun(x,xdata),[-3.6651;0.4309;-0.2177;0.2787])
x =

    0.0219
    0.6231
   -0.2977
    0.2968


feval =

  2.6115e-004

» 本帖已获得的红花(最新10朵)

The more you learn, the more you know, the more you know, and the more you forget. The more you forget, the less you know. So why bother to learn.
5楼2013-06-15 10:09:20
已阅   关注TA 给TA发消息 送TA红花 TA的回帖

goldfish2683

禁虫 (小有名气)

送红花一朵
本帖内容被屏蔽

6楼2013-06-15 11:38:28
已阅   关注TA 给TA发消息 送TA红花 TA的回帖

goldfish2683

禁虫 (小有名气)

本帖内容被屏蔽

7楼2013-06-15 12:07:16
已阅   关注TA 给TA发消息 送TA红花 TA的回帖

dbb627

荣誉版主 (著名写手)

【答案】应助回帖

引用回帖:
7楼: Originally posted by goldfish2683 at 2013-06-15 12:07:16
有出错信息??? Error: File: C:\MATLAB6p5\work\dbb627.m Line: 1 Column: 6 "identifier" expected, "(" found.“”

但fun=@(x,data)sum((x(1)*data(:,1).^x(2).*data(:,2).^x(3)./(1+da ...

下个7.0以上的版本,6.5不支持函数句柄匿名函数fun=@(x,data)语法
The more you learn, the more you know, the more you know, and the more you forget. The more you forget, the less you know. So why bother to learn.
8楼2013-06-15 12:23:15
已阅   关注TA 给TA发消息 送TA红花 TA的回帖

goldfish2683

禁虫 (小有名气)

本帖内容被屏蔽

9楼2013-06-15 20:43:47
已阅   关注TA 给TA发消息 送TA红花 TA的回帖
相关版块跳转 我要订阅楼主 goldfish2683 的主题更新
信息提示
请填处理意见