How can i define my own handle weight function in "nlinfit "command in MATLAB
2 次查看(过去 30 天)
显示 更早的评论
Dear ALL; Suppose have data, x = (1:10)'; y = 10 - 2*x + randn(10,1); beta0=[10,-2];(initial values vector), modelfun=@(b,x)(b(1)+(b(2))*x); (linear model is taken intentionally).Now when i run nlinfit i get my beta as options = statset('Display','iter','RobustWgtFun','bisquare');[beta]=nlinfit(x,y,modelfun,beta0,options).This function give me the answer for linear model but using bisquare weight function as i have given in options.Suppose i want to define my own weight function like w= 1 ./ (1 + r.^4).How can i do it ?I mean how can i adjust my own weight function in nlinfit command.
Thanks
0 个评论
回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Least Squares 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!