how do one weight lsqcurvefit with standard error from dependent data?
7 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
I ran into this post about weighted lsqcurvefit:
https://www.mathworks.com/matlabcentral/answers/48802-nonlinear-fit-with-constraints-in-r2012b
Shouldn't the weight from:
Weights = 1./(N.*SE.^2);
nonlinmodelW = @(B,t) Weights .* nonlinearmodel(B,t);
x = lsqcurvefit(nonlinmodelW,x0,xdata,ydata,lb,ub);
Be:
Weights = 1./(N.*SE);
nonlinmodelW = @(B,t) Weights .* nonlinearmodel(B,t);
x = lsqcurvefit(nonlinmodelW,x0,xdata,ydata.*Weights,lb,ub);
I noticed it did mentioned earlier in the post the weight ydata as well. The reason I don't square SE is because the function value return:
sum([(nonlinmodelW(B,xdata) - ydata)/(N*SE)].^2);
so if you weight with Weights = 1./SE it will returns the above equation, rather than:
the quadrature of the weight:
sum([(nonlinmodelW(B,xdata) - ydata)/((N*SE).^2)].^2);
Also, on the standard error of the fitted parameters, I found other source that it can be found by:
v=residuals from nonlinear least squares;
J=jacobian;
Q_xx = resnorm*inv(J'*J)/length(ydata);
% Precision measures ,i.e. the standard deviation of each parameter
Precision_of_solved_parameters = sqrt(diag(Q_xx));
Can anyone confirm this standard deviation? The code Star Strider provided will give error.
0 Commenti
Risposte (0)
Vedere anche
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!