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 个)

类别

Help CenterFile Exchange 中查找有关 Least Squares 的更多信息

标签

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by