Robust & non negative non linear least squares: nlsq & nnnlsqnlsq Robust non linear least squares uses singular value decomposition and attempts a solution to singular and near singular cases.nnnlsq Robust non negative non linear least squares uses robust version of nnls and constrains parameters to be positive.Both can be used with regularisation techniques to solve ill conditioned problems.p=nlsq(@fnct,data,p0) % robust non linear least squaresp=nnnlsq(@fnct,data,p0) % non linear non negative least squareswhere err=fnct(p,data) calculates a vector of error terms for parameters p, optionally [err,der]=fnct(p,data) for given derivatives.data contains all the values needed by fnct to calculate the error terms s. Can be any type but typically a struct.p0 is an initial value for the parameters p. Note for singular cases fitted parameters p may vary with p0For regularisation append in fnct a small multiple of p to the error terms calculated.See nlsqdemo.html, doc nlsq, doc nnnlsqIncludes:38003 nnls - Non negative least squares38881 Optional function argumentsWill run ok in earlier Matlab versions.
↧