全部版块 我的主页
论坛 提问 悬赏 求职 新闻 读书 功能一区 悬赏大厅
1693 6
2014-11-18
悬赏 80 个论坛币 未解决
请帮忙写一下这个程序,成功了,我付50论坛币。谢谢。
我要求出参数a和N
函数:f=-a*x(t)^2/N+(a+1)x(t)-x(t+1)
数据:x(t)=[13        13        26        52        52        102        145        174        205        249        257        263        282        294        303        321        344        358        340        276        214        225        237        255        279        288        272        225        219        228        251        268        279        271        266        232        216        222        234        254        269        264        230        195        187        193        208        218        237        239        220        198        195        207        214        223        231        239        233        212        208        218        228        237        244        244        240        226        200        200        213        232        241        243        240        231        236        260        282        302        315        325        307        295        289        295        305        321        335        313        289        264        263        263        277        290        291        284        271        242        236        241        256        273        274        267        247        235        242        267        285        303        321        325        312        307        304        309        331        355        364        354        338        313        305        306        319        322        336        336        317        299        295        298        317        342        352        364        361        366        375        379        391        410        425        429        414        391        389        410        437        457        450        439        412        395        389        406        425        453        470        444        408        409        410        423        442        464        475        472        457        438        428        441        456        471        473        465        443        407        409        428        444        460        463        461        447        420        408        413        441        462        457        437        423        409        389        399        416        433        430        426        400        384        382        395        415        432        440        445        442        432        433        462        489        538        560        564        539        534        521        523        547        575        590        583        555        541        537        543        558        575        577        570        556        538        520        526        543        558        562        553        527        507        495        492        507        527        539        531        517        510        508        511        523        554        562        554        544        537        541        546        553        567        566        554        528        516        522        510        523        542        563        570        558        553        559        557        561        581        596        585        599        583        578        562        553        558        584        589        587        590        582        580        590        624        640        649        653        647        619        624        631        659        678        688        695        681        657        632        644        674        703        733        741        724        701        686        677        687        697        707        694        682        657        642        645        666        675        675        666        655        644        647        655        675        691        692        696        686        685        687        696        705        714        703        697        697        700        689        707        729        746        755        761        768        775        780        786        807        813        809        811        807        813        796        791        807        815        818        799        809        811        791        791        781        773        781        777        784        801        787        785        784        805        809        804        807        819        818        813        813        833        830        840        851        844        837        834        842        854        859        865        864        860        847        841        855        861        879        893        888        873        837        814        812        819        837        849        862        862        874        873        889        892        915        931        930        921        918        914        892        894        899        896        874        879        876        864        849        859        869        879        872        875        873        831        816        834        858        868        874        880        879        878        877        887        913        930        935        945        959        976        990        1003        1023        1019        1003        993        985        993        998        971        958        971        984        994        1013        1019        1020        1018        1029        1025        1028        1045        1042        1043        1028        1027        1031        1032        1042        1037        1007        996        973        979        977        992        1006        1007        996        996        995        992        1004        1013        1015        1012        1011        995        1000        1003        987        990        1001        975        946        949        949        952        955        964        958        972        967        953        960        959        970        967        964        959        934        927        915        919        930        958        986        997        998        991        981        972        982        990        992        991        995        975        973        977        997        1026        1022        1006        1006        1005        1000        1002        988        1002        1018        1019        1006        983        978        989        975        991        1016        1010        1016        1019        1033        1040        1036        1061        1069        1067        1059        1055        1056        1056        1045        1060        1073        1081        1062        1055        1057        1040        1035        1032        1041        1044        1053        1034        1015        976        963        984        1001        1018        1028        1033        1025        1024        1031        1045        1066        1079        1095        1081        1084        1116        1127        1134        1158        1159        1174        1158        1158        1155        1156        1163        1190        1180        1164        1142        1146        1126        1113        1128        1151        1159        1136        1131        1115        1096        1079        1079        1086        1094        1075        1077        1063        1068        1047        1054        1073        1096        1094        1078        1066        1057        1054        1049        1066        1085        1091        1078        1077        1067        1087        1104        1115        1142        1139        1143        1155        1151        1157        1160        1147        1165        1164        1148        1131        1113        1105        1105        1098        1117        1131        1132        1145        1137        1127        1128        1123        1130        1135        1152
]
用funtion f=nlinear()





二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

全部回复
2014-11-18 21:03:54
是80论坛币。
二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

2014-11-19 19:03:30
顺手一帮~
附件列表

nlinear.txt

大小:163 Bytes

只需: 10 个论坛币  马上下载

修改成.m的扩展名

二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

2014-11-19 21:53:23
谢谢关注。
二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

2014-11-25 12:47:56
the problem is unclear, if you have data for x, but not for f,  then you are unlikely to find the a and N you want   (they can be anything, which can produce f(t) that do not match the f you have)

you may need to provide data for both x and f.  thanks
二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

2014-12-25 05:43:09
您在私信里告知 t=[1,2,3,4, ...];   但没有成对的 x(t), f(t),   还是无法确定参数。 我将您问的问题稍微改成 x(t)=[1,2,3,4, ...],  且把您的x(t) 作为您的输出 f(t).  这样就可用 least-square 解。  (code attached below, in which both linear and quadratic least squares are used.  You can see from the attached figure that the approximations are quite good.   Your original model is likely not the better model since you had three terms but asked for only two parameters. Your model can be easily upgraded to a quadratic one (by adding a 3rd parameter b) for a better least-squre solution.  Thanks.)



附件列表
ntest.png

原图尺寸 19.82 KB

ntest.png

二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

点击查看更多内容…
相关推荐
栏目导航
热门文章
推荐文章

说点什么

分享

扫码加好友,拉您进群
各岗位、行业、专业交流群