Re: [問題] interpolation 的函數要如何呈現

看板Mathematica作者 (養花種魚數月亮賞星星)時間9年前 (2014/12/04 20:31), 編輯推噓0(000)
留言0則, 0人參與, 最新討論串2/2 (看更多)
※ 引述《abcd28s (乖小孩)》之銘言: : 魯蛇小弟我又遇到瓶頸了 : 想要將我做的interpolation函數用解析的方法去fit : 但是因為肯定不是linear的函數 : 所以不能直接用Fit的指令做(對吧@@) : 因此試了一些其他的指令 : 像是FindFit,NonlinearModelFit : 可是基本上好像都是我要先有一個預設的model去fit(?) : 想請教有沒有辦法直接讓mathematica給我一個analytic的形式? : 當然是近似的analytic並不是exact的 : 附上圖形 : http://ppt.cc/579p : 謝謝大大們QQ (* test data*) plot1=Plot[PDF[LogNormalDistribution[0,1],x],{x,0,5}] mypts=plot1[[1,1,-1,2,1]]; ListLinePlot[mypts] (* models and parameters *) myrule=b[coef_]:>ToExpression["b"<>ToString[coef]]; mymodel=Accumulate[b[#]*x^#&/@Range[0,10,1]/.myrule][[2;;-1]] myvar=b[#]&/@Range[0,10]/.myrule (* fitting models *) myfit=FindFit[mypts,mymodel[[#]],myvar[[1;;#+1]],x]&/@ Range[Length@mymodel] (* plot data and model *) Plot[mymodel[[#]]/.myfit[[#]],{x,0,5},Epilog->Point[mypts], PlotRange->{{0,5},{0,0.8}}]&/@Range[Length@mymodel] -- 我打研究室走過 那獨坐電腦前的容顏如苦瓜的糾結 靈感不來 長壽的煙霧不散 研究室如小小的寂寞的城 恰如商管的電梯向晚 http://chungyuandye.twbbs.org -- ※ 發信站: 批踢踢實業坊(ptt.cc), 來自: 1.172.254.150 ※ 文章網址: http://www.ptt.cc/bbs/Mathematica/M.1417696301.A.F5C.html
文章代碼(AID): #1KW5GjzS (Mathematica)
文章代碼(AID): #1KW5GjzS (Mathematica)