How can i define my own handle weight function in "nlinfit "command in MATLAB
2 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
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 comentarios
Respuestas (0)
Ver también
Categorías
Más información sobre Least Squares en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!