How can i define my own handle weight function in "nlinfit "command in MATLAB

조회 수: 2 (최근 30일)
zahid
zahid 2016년 5월 11일
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